help with clock synchronization on filesrc/multifilesrc

Nicolas Dufresne nicolas at ndufresne.ca
Wed May 26 12:10:47 UTC 2021


Le mer. 26 mai 2021 04 h 45, Marianna S. Buschle via gstreamer-devel <
gstreamer-devel at lists.freedesktop.org> a écrit :

> I'm trying to play a MPEG-TS file (with H264 encoded video) like this:
>
> "multifilesrc loop=1 location=/home/msb/test.ts
> caps=video/mpegts,framerate=30/1 ! "
> "tsdemux : h264parse ! avdec_h264 ! video/x-raw,framerate=30/1 !
> videoconvert ! ximagesink sync=0"
>
> However, instead of playing at 30fps, the video is playing as fast as it
> can
> ('sync=0').
> If I change to 'sync=1' in the 'ximagesink' it plays as expected.
>
> Unfortunately it is not an option for me to use 'sync=1', since my real
> pipeline is a lot more complex and this is just a simple way to show the
> issue.
>
> I would like to be able to get the same behavior I get with a live source,
> fx:
>
> "videotestsrc is-live=true ! video/x-raw,framerate=30/1,format=NV12 !
> timeoverlay ! videoconvert ! ximagesink sync=0 "
>
> So far I can make it work if I add a fakesink with 'sync=1' to the
> pipeline,
> but that looks a bit too much like a hack:
>
> "multifilesrc loop=1 location=/home/msb/test.ts
> caps=video/mpegts,framerate=30/1 ! "
> "tsdemux : h264parse ! avdec_h264 ! video/x-raw,framerate=30/1 ! tee name=t
> ! queue ! videoconvert ! ximagesink sync=0 t. ! queue ! fakesink sync=1"
>
> Isn't there a better way to make 'multifilesrc' or 'filesrc' behave like a
> livesrc?
>

You can use mpegtsparse, there is parameters you have to set (smoothing
delays and add-timestamp, something near that) and the use identity sync=1

multifilesrc ! mpegtsparse add-timestamps=1 smooth... ! identity sync=1 !
....


>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210526/e2fb86bc/attachment.htm>


More information about the gstreamer-devel mailing list