After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 659924 - Fix some MPEG-2 transport streams containing audio and private data
Fix some MPEG-2 transport streams containing audio and private data
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.36
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 647769 660778
Blocks:
 
 
Reported: 2011-09-23 09:17 UTC by Simon Farnsworth
Modified: 2012-02-08 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The mentioned 30 second recording of the problem transport stream. (640.00 KB, video/mpeg)
2011-09-23 09:17 UTC, Simon Farnsworth
  Details
mpegtsdemux: signal no-more-pads when appropriate (3.02 KB, patch)
2011-09-26 11:46 UTC, Vincent Penquerc'h
committed Details | Review
mpegtsdemux: handle pads with no data (2.74 KB, patch)
2011-09-26 11:46 UTC, Vincent Penquerc'h
none Details | Review
mpegtsdemux: handle pads with no data (2.78 KB, patch)
2011-09-26 14:24 UTC, Vincent Penquerc'h
none Details | Review
mpegtsdemux: handle pads with no data (2.84 KB, patch)
2011-09-26 14:35 UTC, Vincent Penquerc'h
committed Details | Review
Pipeline diagram when subtitles are working (163.06 KB, image/svg+xml)
2011-09-29 08:10 UTC, Tvrtko Ursulin
  Details
Pipeline diagram when subtitles are not working (122.05 KB, image/svg+xml)
2011-09-29 08:18 UTC, Tvrtko Ursulin
  Details
expose what we can (1.81 KB, patch)
2011-09-30 13:12 UTC, Vincent Penquerc'h
none Details | Review
Try to add all streams early (5.36 KB, patch)
2011-09-30 13:13 UTC, Vincent Penquerc'h
committed Details | Review

Description Simon Farnsworth 2011-09-23 09:17:33 UTC
Created attachment 197328 [details]
The mentioned 30 second recording of the problem transport stream.

I have multicast MPEG-2 transport streams, which are a copy of the data from BBC 6 Music on Stra 28.2E, put on the network by an Exterity DVB-S TV Gateway. These transport streams fail to play.

I've got a 640kbyte recording of the problem stream (~30 seconds of audio), which I've been testing with.

I started with a playbin2, which simply failed. I've been able to build a pipeline that works:

gst-launch filesrc location=~/stream.mpg ! mpegtsdemux name=demux demux. ! mpegaudioparse ! decodebin2 ! queue ! alsasink

with output:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstAudioSinkClock
Got EOS from element "pipeline0".
Execution ended after 29212984766 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

and a minimal alteration to the pipeline that fails:

gst-launch filesrc location=~/stream.mpg ! mpegtsdemux name=demux demux. ! mpegaudioparse ! decodebin2 ! queue ! alsasink demux. ! fakesink

with output (note interrupt after 15 seconds - the first pipeline plays within a second):
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

It looks like GStreamer isn't coping with the private sections mentioned in the PMT, but not actually present in the stream; this isn't an uncommon configuration for this sort of setup, as the private sections are both unusable and relatively high bitrate compared to the useful audio data.
Comment 1 Vincent Penquerc'h 2011-09-23 12:22:39 UTC
playbin2 works for me on that stream. The private data streams ought not be autoplugged to anything unless you have an autopluggable element that can take in 
application/x-mpegts-private-section caps, which AFAIK we don't, so should not block the pipeline.

The last pipeline you give does block for me, since you're manually adding a link. It would make sense to treat these as discontinuous streams, and keep a running segment sync on those pads when no data is received, which should allow that last pipeline to run.

There might be another issue though, if playbin2 hangs for you. I haven't seen it hang once in a couple dozen runs. If you run it with GST_DEBUG=GST_ELEMENT_FACTORY:3, do you see any decoder created for those private sections ?
Comment 2 Simon Farnsworth 2011-09-23 12:49:15 UTC
Playbin2 can handle the file, but it can't cope with the same data in a live stream.

I can play it out as a live stream using:

gst-launch filesrc location=stream.mpg ! identity datarate=$((655360 / 30)) ! udpsink host=127.0.0.1 port=12345

With that running:

gst-launch udpsrc uri=udp://127.0.0.1:12345/ ! mpegtsdemux ! mpegaudioparse ! decodebin2 ! queue ! alsasink # works

GST_DEBUG=GST_ELEMENT_FACTORY:3 gst-launch playbin2 flags=0x12 uri=udp://127.0.0.1:12345 # fails with the following output:


0:00:00.025044623  1215  0x9f2d050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "playbin2"
Setting pipeline to PAUSED ...
0:00:00.026247400  1215  0x9f2d050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "uridecodebin"
0:00:00.027241056  1215  0x9f2d050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "udpsrc" named "source"
0:00:00.027561701  1215  0x9f2d050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "decodebin2"
0:00:00.028264319  1215  0x9f2d050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "typefind" named "typefind"
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.181311058  1215  0xa05cb20 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "mpegtsdemux"
0:00:00.547420327  1215  0xa05cb20 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "multiqueue"
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
0:00:00.551629957  1215  0xa05cb20 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "mpegaudioparse"
0:00:00.737414431  1215 0xb6d5a6f0 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "mad"

^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 41545851872 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Comment 3 Vincent Penquerc'h 2011-09-26 11:46:27 UTC
Created attachment 197463 [details] [review]
mpegtsdemux: signal no-more-pads when appropriate

We track streams for which a data callback is set (and for which
pads will be added only when data is received), and signal
no-more-pads when the last pad is added.
Comment 4 Vincent Penquerc'h 2011-09-26 11:46:34 UTC
Created attachment 197464 [details] [review]
mpegtsdemux: handle pads with no data

Some streams declare PIDs but will not send data for them.
Ensure we time out on those, and both send new segments to
keep their time synchronized with the rest, and do not wait
forever before deciding to signal no-more-pads.
Comment 5 Simon Farnsworth 2011-09-26 13:57:07 UTC
With these two patches added to a previously working setup, audio-only streams now work, but streams with video in fail:

GST_DEBUG=GST_ELEMENT_FACTORY:3 gst-launch playbin2 flags=0x12 uri=udp://239.192.134.203:5000
0:00:00.024496817  1694  0x886a050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "playbin2"
Setting pipeline to PAUSED ...
0:00:00.025711404  1694  0x886a050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "uridecodebin"
0:00:00.026698521  1694  0x886a050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "udpsrc" named "source"
0:00:00.027009147  1694  0x886a050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "decodebin2"
0:00:00.027702558  1694  0x886a050 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:373:gst_element_factory_create: creating element "typefind" named "typefind"
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.038617672  1694  0x8999bc0 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "mpegtsdemux"
0:00:00.259851328  1694  0x8999bc0 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "multiqueue"
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'application/x-mpegts-private-section'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
0:00:00.266699715  1694  0x8999bc0 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "mpegvideoparse"

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed
0:00:00.268240108  1694  0x8999bc0 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "multiqueue"
WARNING: from element /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0: No decoder available for type 'private/teletext'.
Additional debug info:
gsturidecodebin.c(867): unknown_type_cb (): /GstPlayBin2:playbin20/GstURIDecodeBin:uridecodebin0
0:00:00.271392524  1694  0x8999bc0 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "mpegaudioparse"
0:00:00.479168213  1694 0xb6c703e8 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "mad"
0:00:00.509392486  1694 0xb6c63da0 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "ffdec_mpegvideo"
0:00:00.511541079  1694 0xb6c63da0 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:375:gst_element_factory_create: creating element "input-selector"

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed

(gst-launch-0.10:1694): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 19272577486 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

No audio or video output happens.
Comment 6 Vincent Penquerc'h 2011-09-26 14:24:20 UTC
Created attachment 197482 [details] [review]
mpegtsdemux: handle pads with no data

Some streams declare PIDs but will not send data for them.
Ensure we time out on those, and both send new segments to
keep their time synchronized with the rest, and do not wait
forever before deciding to signal no-more-pads.
Comment 7 Simon Farnsworth 2011-09-26 14:26:23 UTC
Is the patch in comment 6 a replacement for the patch in comment 4, or a replacement for both previous patches?
Comment 8 Vincent Penquerc'h 2011-09-26 14:26:42 UTC
Err, did not mean to refile this yet, only rebasing.
Comment 9 Vincent Penquerc'h 2011-09-26 14:35:28 UTC
Created attachment 197483 [details] [review]
mpegtsdemux: handle pads with no data

Some streams declare PIDs but will not send data for them.
Ensure we time out on those, and both send new segments to
keep their time synchronized with the rest, and do not wait
forever before deciding to signal no-more-pads.
Comment 10 Vincent Penquerc'h 2011-09-26 14:37:40 UTC
Sorry about that. New patch fixing broken video.
This patch replaces the previous one of the same name, from comment 4.
Tested with several streams sent over UDP.
Comment 11 Simon Farnsworth 2011-09-26 15:21:58 UTC
Putting the two current patches into place works for me, including subtitles on video streams.
Comment 12 Tvrtko Ursulin 2011-09-28 16:44:34 UTC
We think the fix for this issue potentially introduces a race condition with streams which have video, audio and subtitles. There pipeline can start playing before subtitles are detected and then later dvbsuboverlay is not connected/inserted.

I will investigate in more detail tomorrow.
Comment 13 Tvrtko Ursulin 2011-09-29 08:10:57 UTC
Created attachment 197732 [details]
Pipeline diagram when subtitles are working
Comment 14 Tvrtko Ursulin 2011-09-29 08:18:35 UTC
Created attachment 197734 [details]
Pipeline diagram when subtitles are not working

Subtitle stream is detected but not connected anywhere. I guess it is all about the timing on startup - when the first subtitle data arrives.

If I understand the "handle pads with no data" patch correctly, it will carry on as soon as there is video and audio. Should it be made to wait for subtitles as well?

Downside I can think of is that pipeline start will be more delayed then, possibly for quite a while if subtitles are far in between. I wonder if that means the real fix should be somewhere else, like always connecting in dvbsuboverlay if subtitle stream is mentioned (assuming this is always/continuously known from the stream), or possibly even simply if subtitles were requested?
Comment 15 Vincent Penquerc'h 2011-09-29 09:43:32 UTC
It should carry on when there one stream reaches two seconds ahead of the other.
It seems that some streams that work can have more than two seconds difference between their comoponent streams though. It seems a really large gap, but I'm seeing it here :/

I'll try to get a repro of what you're seeing, then see how I can fix the original issue in another way.
Comment 16 Vincent Penquerc'h 2011-09-29 12:59:10 UTC
Another solution is to tweak the queue size limits in decodebin2.
Currently, the time limits are unbounded, with a size limit of 2 MB.
For a radio only stream, this means quite a long time before that limit is reached (see #584104).
Moreover, reaching that limit triggers decodebin2 to go ahead, assuming no data will be forthcoming from pads which have stayed without data so far. This is the same kind of approach I used in my previous patch, but relying on decodebin2 avoids having two thresholds.
However, for non seekable streams, there is currently no limit, but this is a bug and should be changed shortly (see #647769, marking as dependency). Fixing this makes the sample audio stream attached above preroll and play.
However, since there can be some largeish time gap between streams, that default threshold should not be too small. Setting it too large (currently 10 seconds for seekable streams) means that, for a streamed stream where we have to read at "live" speed, there will be, eg, 10 seconds of waiting while the queue fills up before deciding to go ahead. This may be too much. If it's a problem for your case, I could make this time threshold a property so it can be set before prerolling.
Comment 17 Tvrtko Ursulin 2011-09-29 13:14:01 UTC
Ten seconds would indeed be too long. We kind of have to be close to how long it takes a typical TV to change a channel which is below four seconds. 

What happens if this timeout is too small?

Also, what happens with subtitles and dvbsuboverlay with this approach?
Comment 18 Vincent Penquerc'h 2011-09-29 13:41:41 UTC
If it is too small, decodebin2 will finish preroll before having seen data on all the pads - if there was indeed data to be coming in.

Subtitles *should* be OK, as this is using the normal decodebin2 behavior, and AFAIK there's no such issue with it. However, I'm nowhere near acquainted enough with decodebin2 to say that with any assurance.
Comment 19 Tvrtko Ursulin 2011-09-29 14:10:01 UTC
I can't claim I understand this fully - but we can always test it to see what happens. :)

If I understand correctly final fix for 647769 will replace both patches from this bug so we should test with that?

Situation then will be that pre-roll will only finish after time limit expires ie. there is no way it can start sooner if some conditions are met? Would it be somehow possible to combine both approaches and finish pre-roll as soon as some data is received but still do not fail to wire up dvbsuboverlay or introduce other regressions?
Comment 20 Vincent Penquerc'h 2011-09-29 14:34:42 UTC
Final fix for 647769 would indeed replace those two patches, yes, and would incur the 10 seconds delay.

However, I'm looking now at trying to add the pads as soon as I can, without waiting for data from each pad in turn. If that works, I can emit no-more-pads at once, and will hopefully both avoid hitting that timeout, and avoid missing subtitle streams that may come through late. We'll see if that can be made to work, and if there was a particular reason the pads are added delayed.
Comment 21 Vincent Penquerc'h 2011-09-30 13:08:22 UTC
I've now got something that works well here so far:

There's a patch to mpegtsdemux to try to add all known pads as soon as data is received. It works very well in some cases, and will start playing pretty much instantly. Since all pads are added at once, subtitles *should* never be forgotten.

When it works, it works pretty nicely :) It does make some other cases stall though, where no data at all is received for known streams. These will hit the decodebin2 overrun threshold as a fallback. In some cases, though, some streams being incomplete would cause the entire demuxed group to not be added. I have a patch to decodebin2 to cut off those incomplete streams, to allow the complete ones to start.

The coming change from 647769 should ensure that, for those cases where early addition is impossible, the overrun does not happen after too long a delay.

All radio streams I tried come up almost instantly, some video streams almost instantly, and some after the initial overrun. I don't think I've got one that fails to start now.

Patches attached below. They replace the two patches above. Last patch from 647769 should also be applied, and is currently included in the -base patch below.
Comment 22 Vincent Penquerc'h 2011-09-30 13:12:16 UTC
Created attachment 197877 [details] [review]
expose what we can
Comment 23 Vincent Penquerc'h 2011-09-30 13:13:52 UTC
Created attachment 197878 [details] [review]
Try to add all streams early
Comment 24 Tvrtko Ursulin 2011-09-30 14:05:07 UTC
Looks good after a quick test. Will let you know how it fares after more extensive probing. Thanks!
Comment 25 Tvrtko Ursulin 2011-09-30 14:49:41 UTC
Bad news. Patch to mpegtsdemux causes DVB-T BBC ONE not to play at the moment. Also another strange behaviour on DVB-S BBC ONE was that it sometimes starts in a kind of a frame by frame mode (haven't tried determining which patch causes this). I have GST_DEBUG=5 logs for both but they are quite big so please fetch them from our download server.
Comment 26 Vincent Penquerc'h 2011-10-04 11:46:14 UTC
(In reply to comment #14)
> Created an attachment (id=197734) [details]
> Pipeline diagram when subtitles are not working

Interestingly, I've now seen this issue with another stream, but it's the video that ends up on a dead end path. This is without the patch that we thought might cause a race, so it looks like it's a preexisting issue that the patch just happened to trigger on this stream.
Comment 27 Sebastian Dröge (slomo) 2011-11-24 09:39:34 UTC
Any news on this?
Comment 28 Vincent Penquerc'h 2011-11-24 15:12:00 UTC
The "bad news" was because I had the multiqueue patch locally, AFAIK Tvrtko had success after applying it too.

Tvrtko, can you confirm please ?
Comment 29 Tvrtko Ursulin 2011-11-24 15:35:35 UTC
The first draft of incorrect patch from 647769, yes I remember that was the culprit.

Four patches from this bug are all in use on our side. Which means they are most likely good. I am afraid exact details escape me now - whether these four on their own were sufficient for reasonable behaviour, or only when combined when fixes from some other bug report.
Comment 30 Sebastian Dröge (slomo) 2011-11-25 09:20:36 UTC
Ok, let's push this then
Comment 31 Vincent Penquerc'h 2011-11-28 15:19:05 UTC
Pushed, except the one in core to force deadend on incomplete streams, as it's really a hack needed for the obsolete mpegdemux, and I'm told this is not needed for the new tsdemux.


commit f1a4791f7419b5b3e07f0cf5dc0877e26152956f
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Mon Nov 28 15:10:39 2011 +0000

    mpegdemux: Try to add all streams early
    
    This will allow us to signal no-more-pads to avoid hitting
    the decodebin2 overrun.

commit fb66b3c2acc0fc63f894ca04a6dae577cca698f0
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Mon Sep 26 12:43:27 2011 +0100

    mpegtsdemux: handle pads with no data
    
    Some streams declare PIDs but will not send data for them.
    Ensure we time out on those, and both send new segments to
    keep their time synchronized with the rest, and do not wait
    forever before deciding to signal no-more-pads.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=659924

commit f909c5754693d9c62fe779b8216712894b9ca494
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Mon Sep 26 12:16:30 2011 +0100

    mpegtsdemux: signal no-more-pads when appropriate
    
    We track streams for which a data callback is set (and for which
    pads will be added only when data is received), and signal
    no-more-pads when the last pad is added.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=659924
Comment 32 Tvrtko Ursulin 2012-02-08 15:54:47 UTC
Is this now broken by commits cf74b0bc76106d77bea1a346becc158740d4fdd5 and	2eef9828d6735572e5f1bfd0409108e40963696c?