Timeshifting using Queue2 for mpegts container with h264 encoded stream

Agarwal, Piyush - 0446 - MITLL Piyush.Agarwal at ll.mit.edu
Wed Jan 20 11:08:03 PST 2016


Hello again,

I tried moving the queue2 before the tsdemux and that seems to have helped. Now what I am seeing is when I issue the seek command with a time 5 seconds prior to the current time it seems to jump to the data at the beginning of the ring buffer regardless of what time information I give in the seek command. Then it looks as if it is playing back the frames as fast as possible until it catches up to real-time instead of playing it at the proper rate.

I realized I forgot to mention that I am using GStreamer 1.6.1.

Thanks,
Piyush
________________________________
From: Agarwal, Piyush - 0446 - MITLL
Sent: Tuesday, January 19, 2016 12:33 PM
To: gstreamer-devel at lists.freedesktop.org
Subject: Timeshifting using Queue2 for mpegts container with h264 encoded stream

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/20160120/51fd6d8a/attachment.html>


More information about the gstreamer-devel mailing list