Seeking when streaming to udpSink
Tim Müller
tim at centricular.com
Tue Sep 27 21:40:13 UTC 2016
On Tue, 2016-09-27 at 12:54 -0700, doubledw wrote:
Hi,
At first glance it looks like the encoder not handling seeks / flushing
properly.
I have something else for you to try which might work better for you:
Create two separate pipelines in the same application - one that
encodes/streams and one that decodes/seeks/etc.
In the playback pipeline you use intervideosink as video sink, and in
the encoding pipeline you use intervideosrc as source element.
The video data from the intervideosink will be sent to the
intervideosrc, but both are decoupled, so if you pause the playback
pipeline, the streaming pipeline will just keep repeating and streaming
the last frame (or go black after a while, depending what you set the
timeout to). If you seek on the playback pipeline the streaming part
will repeat the last frame until the seek is complete and then output
frames from the new position (but with monotonically increasing
timestamps, so the encoder will never know there was a discontinuity).
If you play back at half speed or double speed, the streaming part will
encode that at the playback speed and stream it out normally.
For the decoding pipeline you can just use a playbin element and set
the "video-sink" property to an intervideosink (GstElement *).
On the streaming pipeline you want something like:
intervideosrc ! video/x-raw,framerate=25/1 ! videoconvert
! avenc_mpeg2video ! mpegtsmux ! udpsink
If you want audio as well, there's also interaudiosink/src which work
the same way.
Good luck!
Cheers
-Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com
Join us at the GStreamer Conference!
10-11 October 2016 in Berlin,
Germany
http://gstreamer.freedesktop.org/conference/
More information about the gstreamer-devel
mailing list