udpgstreamerh.264mpeggstreamer-1.0

Gstreamer tsdemux reports "CONTINUITY: Mismatch packet" while receiving MPEG TS payload via UDP


My pipeline is the following (I recieving MPEG TS H264 video over RTP):

gst-launch-1.0 -v udpsrc address=127.0.0.1 port=1200 ! decodebin ! rtpvrawpay ! rtpbin ! udpsink host=127.0.0.1 port=2250

After start video transmits ok for a few seconds but then an error appears:

tsdemux.c:2413:gst_ts_demux_queue_data: CONTINUITY: Mismatch packet 2, stream 6

followed by the error:

libav gstavauddec.c:628:gst_ffmpegauddec_drain:<avdec_mp2float0> send packet failed, could not drain decoder

After that no more normal playback is possible and I need to restart pipeline again. What causes the error and how it can be fixed?


Solution

  • It turned out that the issue is in transmitter that does not send keyframes by some reason. This maybe also caused by UDP connection issues - it may sometimes miss packets.

    Nevertheless VLC played the original stream fine, so this should have been achievable with gtsreamer as well (by playing stream with udp://@:1200 address).

    I managed to solve the issue by increasing a buffer size up to 100 megabytes as below (I also supplied test to play video from the stream to check it works fine):

    gst-launch-1.0 udpsrc address=127.0.0.1 port=1200 buffer-size=100000000 ! tsdemux parse-private-sections=TRUE ! h264parse ! avdec_h264 ! autovideosink sync=false