Timeshifting using Queue2 for mpegts container with h264 encoded stream

Agarwal, Piyush - 0446 - MITLL Piyush.Agarwal at ll.mit.edu
Tue Jan 19 09:33:59 PST 2016


Hi All,

Just had a question about how to use the queue2 in ring-buffer mode to support time shifting during playback of an h264 encoded mpegts stream. (Haven't found any thing on google or the mailing list that matches exactly what I am trying to achieve).

My pipeline is as follows:

udpsrc address=xxx.xxx.xxx.xxx port=xxxx ! tsdemux ! queue2 ring-buffer-max-size=10240000 ! h264parse ! capsfilter ! video/x-h264,stream-format=byte-stream ! avdec_h264 ! videoconvert ! autovideosink

The pipeline itself seems to be working, if I specify temp-template and temp-remove false I can see a file being written to up to the max-size I have specified. But I wasn't sure if I have the queue2 element at the right spot in the pipeline for it to keep all the information that is needed to allow seeking.

My goal is to be able to store the last 5-10 seconds of a stream and then seek to the beginning of that point and allow the user to play back from there. Unfortunately with the above if I try to seek nothing seems to change. If I query the pipeline for duration it always returns 00:00:00. I thought that the queue2 element with the ring-buffer property would allow me to do that.

Is the Queue2 element the right one to do what I am trying to do? If so any thoughts on what I might be doing wrong?

Otherwise I was thinking maybe I could somehow use the downloadbuffer element and keep overwriting the file for every 5-10 seconds and when user wants to timeshift it just loads the downloaded file, but that would be less ideal.

Thanks,
Piyush


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160119/032deb34/attachment.html>


More information about the gstreamer-devel mailing list