HI,
I’m working on a GStreamer pipeline to process an RTP stream containing MP2T packets. The pipeline demuxes the stream, decodes and re-encodes the video, and outputs both an RTP stream and segmented MP4 files using splitmuxsink
. Here’s my pipeline:
GST_DEBUG=3 gst-launch-1.0 \
udpsrc address=239.202.108.52 port=6310 do-timestamp=true timeout=60000000000 buffer-size=0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)103" ! rtpbin name=recv_rtp ! watchdog timeout=300000 ! rtpmp2tdepay2 ! tsparse set-timestamps=true ! tsdemux ! multiqueue ! h264parse ! queue ! decodebin ! videoconvert ! video/x-raw,format=RGBA ! videorate drop-only=true ! queue ! videoflip method=none ! queue ! videoconvert ! deinterlace method=vfir fields=top ! videoconvert ! videorate drop-only=true ! openh264enc ! h264parse ! splitmuxsink name=mp4mux max-size-time=10000000000 max-size-bytes=0 location=stream_%d.mp4
While this works fine for some sources, I’m seeing inconsistent MP4 file durations (e.g., 16s
, 6s
, 12s
) for other source this issue doesn’t occurs.
Without GST_DEBUG
, I noticed frequent Redistribute latency...
logs.
etting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
WARNING: from element /GstPipeline:pipeline0/GstTSDemux:tsdemux0: CONTINUITY: Mismatch packet 9, stream 2 (pid 0x1011)
Additional debug info:
../gstreamer/subprojects/gst-plugins-bad/gst/mpegtsdemux/tsdemux.c(2782): gst_ts_demux_queue_data (): /GstPipeline:pipeline0/GstTSDemux:tsdemux0
Redistribute latency...
Errors Observed -
0:00:10.449183111 84605 0x7fd45403b1e0 ERROR libav :0:: mmco: unref short failure
0:00:10.465825945 84605 0x7fd45403b1e0 ERROR libav :0:: decode_slice_header error
0:00:10.465901908 84605 0x7fd45403b1e0 ERROR libav :0:: reference picture missing during reorder
0:00:10.465916354 84605 0x7fd45403b1e0 ERROR libav :0:: Missing reference picture, default is 65803
0:00:10.491030073 84605 0x7fd45403b1e0 WARN videodecoder gstvideodecoder.c:3133:gst_video_decoder_prepare_finish_frame:<avdec_h264-0> decreasing timestamp (0:00:05.461545066 < 0:00:05.695109070)
Attached pipeline diagram when played with gst-play
Observations:
- The stream appears to contain packet loss or corruption, which may be causing the decoding issues.
If the problem originates from the source, is there any way to mitigate or fix it within the pipeline? For example, are there specific elements or settings in GStreamer that can help handle source-specific errors or irregularities better?
Any insights, debugging tips, or suggestions would be greatly appreciated!