How to stream a file in loop without timestamp reset

Pedro Côrte-Real pedro at pedrocr.net
Sun Jan 19 02:56:54 PST 2014


Here's what I do instead for a similar use case:

1. Setup the pipeline
2. Attach an event probe to the sink pad downstream of the element
that you want to loop
3. Attach a data probe to the same pad as well

Now here's what you do:

- When the probe in 2) catches an EOS you swap the element(s) upstream
of that pad, in your case create a new filesrc to replace the previous
one, and then DROP the EOS event. You also store the timestamp of that
event into an offset
- When the probe in 3) catches a frame you fix it's timestamp with the
offset saved in 2

If you don't actually need the timestamps to be correct (because
you're displaying to a screen and not sending it to a mux) you can
just ignore the data probe and offset stuff.

Here's my code if you want a complete example:

https://github.com/pedrocr/camerasink/blob/11ca86d9f79a529fb72c40d386be758789d7916b/bin/filejoin.c

Pedro

On Sun, Jan 19, 2014 at 10:05 AM, Baby Octopus
<jagadishkamathk at gmail.com> wrote:
> Hi,
>
> I'm able to stream a file in loop the following way
> 1. Construct the pipeline
> 2. Set the pipeline to playing mode
> 3. Catch EOS
> 4. Set the pipeline to NULL
> 5. Repeat 1 to 4
>
> But here the timestamps are reset during every execution. I'm using RTP/UDP
> streaming here. I will have to restart my custom android player during every
> run
>
> Is there any way to this work without resetting the timestamp, instead let
> it continue from the previous end state?
>
> Thanks in advance :)
>
> ~BO
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-stream-a-file-in-loop-without-timestamp-reset-tp4664762.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list