Seeking when streaming to udpSink

doubledw dwood at mak.com
Fri Jul 15 19:01:35 UTC 2016


I am attempting to seek to a new position in a mpeg video while I am
streaming it to a udpSink. I have used the basic-tutorial-13.c as a starting
point. I am viewing the stream with the VLC media player with network stream
("udp://@:5000 " and cacheing 10ms).

When I submit the seek event, I get a lot of errors of the form below. The
playback hangs for a while and may start again. If play starts again, it
does so at some offset past the requested seek point.

If I instead just use playbin, the seek works as expected and immediately.

I have a similar problem when performing a playback rate change (using
gst_element_query_position to get the current position).

Is there something I can do to adjust the PTS to make them valid after
submitting the seek? Is there a way to eliminate the hang and delay when
performing the seek?

This is my pipeline configuration for the udpSink:

      data.pipeline = gst_parse_launch ("filesrc location=test2.mpeg !
decodebin ! identity single-segment=true ! avenc_mpeg2video ! mpegtsmux !
udpsink host=\"127.0.0.1\" port=5000", NULL);

This is my pipeline configuration with playbin:

      data.pipeline = gst_parse_launch ("playbin
uri=file:///C:/gstream/test2.mpeg", NULL);

This is my seek event (rate=1.0):

       seek_event = gst_event_new_seek (data->rate, GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SKIP,
         GST_SEEK_TYPE_SET, position, GST_SEEK_TYPE_NONE, 0);

   gst_element_send_event (data->pipeline, seek_event);


gstreamer diagnostic output after seek is submitted:

0:00:16.312514219  9348 00000000035D2A40 ERROR                  libav :0::
Invalid pts (0) <= last (378)
0:00:16.313970803  9348 00000000035D2A40 ERROR                  libav
gstavvidenc.c:706:gst_ffmpegvidenc_handle_frame:<avenc_mpeg2video0>
avenc_mpeg2video: failed to encode buffer
...

[and ending with]

0:00:17.612929299  9348 00000000035D2A40 ERROR                  libav
gstavvidenc.c:706:gst_ffmpegvidenc_handle_frame:<avenc_mpeg2video0>
avenc_mpeg2video: failed to encode buffer
0:00:17.615227075  9348 00000000035D2A40 ERROR                  libav :0::
Invalid pts (378) <= last (378)
0:00:17.615642325  9348 00000000035D2A40 ERROR                  libav
gstavvidenc.c:706:gst_ffmpegvidenc_handle_frame:<avenc_mpeg2video0>
avenc_mpeg2video: failed to encode buffer
0:00:17.621328818  9348 00000000035D2A40 WARN                basesink
gstbasesink.c:3382:gst_base_sink_chain_unlocked:<udpsink0> warning: Internal
data flow problem.
0:00:17.621889898  9348 00000000035D2A40 WARN                basesink
gstbasesink.c:3382:gst_base_sink_chain_unlocked:<udpsink0> warning: Received
buffer without a new-segment. Assuming timestamps start from 0.






--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Seeking-when-streaming-to-udpSink-tp4678702.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list