[Bug 774600] mpegtsdemux: Pipeline hang on lossy transport stream

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Nov 17 22:27:54 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=774600

--- Comment #3 from minfrin at sharp.fm ---
Unfortunately I don't understand the reasoning behind the current behaviour of
GstVideoDecoder, and so can't practically provide a patch. What I was hoping
for is confirmation of what the videodecoder expects from upstream, I have no
idea what is normal and what isn't alas.

Removing the part where the invalid PTS is set to DTS makes no difference to
the stream, we still hang:

diff --git a/gst-libs/gst/video/gstvideodecoder.c
b/gst-libs/gst/video/gstvideodecoder.c
index fdbc7d2..db15514 100644
--- a/gst-libs/gst/video/gstvideodecoder.c
+++ b/gst-libs/gst/video/gstvideodecoder.c
@@ -2697,7 +2697,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder *
     if (!priv->reordered_output &&
         !GST_CLOCK_TIME_IS_VALID (frame->pts) && !seen_none &&
         GST_CLOCK_TIME_IS_VALID (priv->pts_delta)) {
-      frame->pts = min_ts + priv->pts_delta;
+//      frame->pts = min_ts + priv->pts_delta;
       GST_DEBUG_OBJECT (decoder,
           "no valid PTS, using oldest DTS %" GST_TIME_FORMAT,
           GST_TIME_ARGS (frame->pts));

It appears that the videodecoder suddenly starts receiving packets in a
corrupted order, which eventually freezes up the decoded completely.

The PTS values below are all over the show, they run backwards, then jump
forwards, then run backwards again.

minfrin at towerofpi9:/var/www/html/stream $ GST_TRACE="live"
G_DEBUG="fatal-warnings" LD_LIBRARY_PATH=/usr/local/lib gst-launch-1.0
--gst-debug=1,videotag:1,souphttpclientsink:2,pixelsample:1,mpegtsbase:0,tdttsparse:5,transcoder:5,omxvideodec:1,omxvideoenc:1,tsdemux:5,encodebin:1,videodecoder:5
filesrc location=/mnt/stream/raw.ts ! progressreport update-freq=5 ! tsdemux !
queue ! h264parse ! omxh264dec ! omxh264enc ! h264parse ! mpegtsmux ! hlssink
target-duration=0 2>&1 | grep "decreasing timestamp"
0:01:30.313825356 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.632708481 < 0:07:15.832708481)
0:01:30.316706261 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.552708481 < 0:07:15.832708481)
0:01:30.318355305 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.512708481 < 0:07:15.832708481)
0:01:30.319121754 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.592708481 < 0:07:15.832708481)
0:01:30.320096587 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.712708481 < 0:07:15.832708481)
0:01:30.321267303 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.672708481 < 0:07:15.832708481)
0:01:30.322132397 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.752708481 < 0:07:15.832708481)
0:01:30.324218728 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.952708481 < 0:07:16.112708481)
0:01:30.325133405 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.872708481 < 0:07:16.112708481)
0:01:30.326079071 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.832708481 < 0:07:16.112708481)
0:01:30.326970520 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.912708481 < 0:07:16.112708481)
0:01:30.327863218 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.032708481 < 0:07:16.112708481)
0:01:30.328728677 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:15.992708481 < 0:07:16.112708481)
0:01:30.329690749 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.072708481 < 0:07:16.112708481)
0:01:30.331694425 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.272708481 < 0:07:16.432708481)
0:01:30.332536863 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.192708481 < 0:07:16.432708481)
0:01:30.333387218 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.152708481 < 0:07:16.432708481)
0:01:30.334488091 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.232708481 < 0:07:16.432708481)
0:01:30.335555110 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.352708481 < 0:07:16.432708481)
0:01:30.336482860 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.312708481 < 0:07:16.432708481)
0:01:30.337385558 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.392708481 < 0:07:16.432708481)
0:01:30.343763923 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.512708481 < 0:07:16.592708481)
0:01:30.344523342 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.472708481 < 0:07:16.592708481)
0:01:30.345333593 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.552708481 < 0:07:16.592708481)
0:01:30.347091490 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.632708481 < 0:07:16.672708481)
0:01:30.349699169 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.912708481 < 0:07:17.072708481)
0:01:30.350496555 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.832708481 < 0:07:17.072708481)
0:01:30.351306182 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.792708481 < 0:07:17.072708481)
0:01:30.352110547 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.872708481 < 0:07:17.072708481)
0:01:30.352951319 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.992708481 < 0:07:17.072708481)
0:01:30.353880996 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:16.952708481 < 0:07:17.072708481)
0:01:30.354788434 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.032708481 < 0:07:17.072708481)
0:01:30.356623465 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.232708481 < 0:07:17.392708481)
0:01:30.357527465 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.152708481 < 0:07:17.392708481)
0:01:30.358418289 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.112708481 < 0:07:17.392708481)
0:01:30.359328903 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.192708481 < 0:07:17.392708481)
0:01:30.360204570 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.312708481 < 0:07:17.392708481)
0:01:30.361147581 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.272708481 < 0:07:17.392708481)
0:01:30.361996113 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.352708481 < 0:07:17.392708481)
0:01:30.363952184 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.552708481 < 0:07:17.712708481)
0:01:30.364770039 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.472708481 < 0:07:17.712708481)
0:01:30.365663936 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.432708481 < 0:07:17.712708481)
0:01:30.366567988 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.512708481 < 0:07:17.712708481)
0:01:30.367426311 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.632708481 < 0:07:17.712708481)
0:01:30.368308906 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.592708481 < 0:07:17.712708481)
0:01:30.369254624 30367  0x208def0 WARN            videodecoder
gstvideodecoder.c:2767:gst_video_decoder_prepare_finish_frame:<omxh264dec-omxh264dec0>
decreasing timestamp (0:07:17.672708481 < 0:07:17.712708481)

Am I right in understanding that for the videodecoder to work properly, it must
receive PTS values that are monotonically increasing?

If this is true, then I need to be searching for the bug upstream of
videodecoder.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list