No video when gstreamer decoder started after udp stream
Dear all,
I am trying to decode udp multicast mpegts stream containing one program with h264 video + one audio ac3 track
Server start command line at linux PC-1:
multicat test.ts 239.232.10.1:5004
And stream decoding is started at PC-2. No audio is decoded for brevity:
gst-launch-1.0 -v --gst-debug='_videodec_:6,basevideosink:6,GST_QOS:6' \\\
--no-fault --no-position udpsrc port=5004 multicast-group=239.232.0.1 \\\
caps="application/x-rtp,media=video,clock-rate=90000" \\\
blocksize=8192 retrieve-sender-address=false do-timestamp=false loop=false \\\
\\\
! rtpmp2tdepay \
! tsparse ! tsdemux name=dmx dmx. \
\\\
! "video/x-h264" ! queue ! parsebin ! queue \
! avdec_h264 \\\
! xvimagesink qos=true render-rectangle='\<100,100,240,136\>'
When udp streaming is started @ PC-1 before gstreamer decoding at PC-2, the video appears after ~ 2 sec. Great.
But, when gstreamer decoder at PC-2 is started several seconds before the PC-1 udp server, then video never appears.
All decoded frames are dropped in gstvideodecoder.c with similar message:
GST_QOS gstbasesink.c:4040:gst_base_sink_chain_unlocked: qos: dropped buffer rt 0:00:00.780000000, st 0:00:00.780000000, ts 0:00:00.780000000, dur 0:00:00.040000000
If I set 'qos=false' in gtsreamer command, video appears.
How to reproduce quickly:
Create gstreamer command listening to a live udp stream, add suitable GST_DEBUG=...
Start udp stream ~ 5 sec later. No video will appear.
Stop udp stream, stop gstreamer decoder
Change to 'qos=false'
Start gstreamer decoder
Start udp stream ~ 5 sec later. The video will appear, probably jerky because of missing QoS
My gut feeling is that gstbasesink.c does not update its base time when stream events are sent from gstvideodecoder.c after first finished frame
Consequently, gstbasesink.c sends incorrect QoS messages to decoder, resulting in all video frames dropped
The same drop messages also observed with fakevideosink
gst-launch-1.0 --version
gst-launch-1.0 version 1.22.6
GStreamer 1.22.6
Thanks.
I do not attach logs because issue is easy to reproduce with basic commands, no problem to add :-)