Python Gstreamer: Internal data flow error porting program from 0.10 to 1.0

Shishir Pokharel Shishir.Pokharel at on24.com
Thu Jun 16 18:51:13 UTC 2016


You are missing pad link  for qtdemux and queue.

Listen to signal “pad-added” for qtdemux and on call callback link the pad with queue sink pad.



From: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org] On Behalf Of Higinio Martí Ribés
Sent: Wednesday, June 15, 2016 4:49 AM
To: gstreamer-devel at lists.freedesktop.org
Subject: Python Gstreamer: Internal data flow error porting program from 0.10 to 1.0

Hi!
I'm having problems to port a Python gstreamer 0.10 program to the 1.0 version. The program connects with a device (eye-tracking system) and tries to reproduce the video sent by the scene camera. The live video from the scene camera (full HD, 1920x1080, 25 fps), is encoded into the h.264 compression format with key-frames every 16 frames at ~5mbit and the audio is encoded into the mp3 compressions format. It is transmitted via UDP as mpeg-ts packets (188 bytes each).
The code for the 0.10 version, which works well is (I'm only posting the function where the gstreamer pipeline is created, please ask if more information is needed):

PIPELINE_DEF = "udpsrc do-timestamp=true name=src closefd=false !" \
               "mpegtsdemux !" \
               "queue !" \
               "ffdec_h264 max-threads=0 !" \
               "ffmpegcolorspace !" \
               "xvimagesink name=video"

# Create gstreamer pipeline to stream video
pipeline = gst.parse_launch(PIPELINE_DEF)

# Source element: video socket. Sockfd file for UDP reception. socket.fileno() returns socket descriptor
src = pipeline.get_by_name("src")
src.set_property("sockfd", videoLive.fileno())

pipeline.set_state(gst.STATE_PLAYING)

For the 1.0 I'm building the pipeline using add and link instead of parse_launch. My code is:

# Setting gstreamer pipeline
self.pipeline = Gst.Pipeline()

self.udpsrc = Gst.ElementFactory.make('udpsrc', 'src')
self.pipeline.add(self.udpsrc)
self.udpsrc.set_property('socket', Gio.Socket().new_from_fd(self.videosocket.fileno()))

self.tsparse = Gst.ElementFactory.make('tsparse', None)
self.pipeline.add(self.tsparse)

self.demux = Gst.ElementFactory.make('tsdemux', None)
self.pipeline.add(self.demux)

self.queue = Gst.ElementFactory.make('queue', None)
self.pipeline.add(self.queue)

self.h264 = Gst.ElementFactory.make('avdec_h264', None)
self.pipeline.add(self.h264)

self.videoconvert = Gst.ElementFactory.make('videoconvert', None)
self.pipeline.add(self.videoconvert)

self.imagesink = Gst.ElementFactory.make('xvimagesink', None)
self.pipeline.add(self.imagesink)

self.udpsrc.link(self.tsparse)
self.tsparse.link(self.demux)
self.demux.link(self.queue)
self.queue.link(self.h264)
self.h264.link(self.videoconvert)
self.videoconvert.link(self.imagesink)

self.bus = self.pipeline.get_bus()
self.bus.add_signal_watch()
self.bus.connect('message::eos', self.on_eos)
self.bus.connect('message::error', self.on_error)

self.pipeline.set_state(Gst.State.PLAYING)

Nothing is shown when I execute it. I've set the debug to threshold 4, and the output has some warnings before error is thrown:

0:00:01.937727762  9549      0x3047ca0 INFO               GST_EVENT gstevent.c:709:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, stop=99:99:99.999999999, rate=1,000000, applied_rate=1,000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:01.937776032  9549      0x3047ca0 INFO                 basesrc gstbasesrc.c:2772:gst_base_src_loop:<src> marking pending DISCONT
0:00:02.097347324  9549      0x3047ca0 INFO        mpegtspacketizer mpegtspacketizer.c:770:mpegts_try_discover_packet_size: have packetsize detected: 188 bytes
0:00:02.097410369  9549      0x3047ca0 INFO              mpegtsbase mpegtsbase.c:726:mpegts_base_apply_pat:<mpegtsparse2-0> PAT
0:00:02.098061088  9549      0x3047ca0 INFO        GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad mpegtsparse2-0:sink
0:00:02.098093377  9549      0x3047ca0 INFO               GST_EVENT gstevent.c:628:gst_event_new_caps: creating caps event video/mpegts, systemstream=(boolean)true, packetsize=(int)188
0:00:02.098133309  9549      0x3047ca0 INFO               GST_EVENT gstevent.c:709:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, stop=99:99:99.999999999, rate=1,000000, applied_rate=1,000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:02.098167255  9549      0x3047ca0 INFO        mpegtspacketizer mpegtspacketizer.c:770:mpegts_try_discover_packet_size: have packetsize detected: 188 bytes
0:00:02.098192084  9549      0x3047ca0 INFO              mpegtsbase mpegtsbase.c:726:mpegts_base_apply_pat:<tsdemux0> PAT
0:00:02.098325493  9549      0x3047ca0 INFO        GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad tsdemux0:sink
0:00:02.098340146  9549      0x3047ca0 INFO               GST_EVENT gstevent.c:628:gst_event_new_caps: creating caps event audio/mpeg, mpegversion=(int)1
0:00:02.098364200  9549      0x3047ca0 WARN                 default descriptions.c:612:format_info_get_desc: Unexpected MPEG-1 layer in audio/mpeg, mpegversion=(int)1
0:00:02.098403181  9549      0x3047ca0 INFO        GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad tsdemux0:sink
0:00:02.098413243  9549      0x3047ca0 INFO               GST_EVENT gstevent.c:628:gst_event_new_caps: creating caps event video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal
0:00:02.098489834  9549      0x3047ca0 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<tsdemux0> adding pad 'audio_0041'
0:00:02.098501372  9549      0x3047ca0 INFO               GST_EVENT gstevent.c:709:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, stop=99:99:99.999999999, rate=1,000000, applied_rate=1,000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:02.110068408  9549      0x3047ca0 INFO        GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<tsdemux0> adding pad 'video_0040'
0:00:02.110145009  9549      0x3047ca0 INFO                 basesrc gstbasesrc.c:2785:gst_base_src_loop:<src> pausing after gst_pad_push() = not-linked
0:00:02.110162087  9549      0x3047ca0 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<src> error: Internal data flow error.
0:00:02.110166484  9549      0x3047ca0 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<src> error: streaming task paused, reason not-linked (-1)
0:00:02.110180920  9549      0x3047ca0 INFO        GST_ERROR_SYSTEM gstelement.c:1835:gst_element_message_full:<src> posting message: Internal data flow error.
0:00:02.110201183  9549      0x3047ca0 INFO        GST_ERROR_SYSTEM gstelement.c:1858:gst_element_message_full:<src> posted error message: Internal data flow error.
0:00:02.110291520  9549      0x3047ca0 INFO        GST_ELEMENT_PADS gstelement.c:766:gst_element_remove_pad:<tsdemux0> removing pad 'audio_0041'
0:00:02.110323251  9549      0x3047ca0 INFO        GST_ELEMENT_PADS gstelement.c:766:gst_element_remove_pad:<tsdemux0> removing pad 'video_0040'
0:00:02.110350647  9549      0x3047ca0 INFO                    task gsttask.c:300:gst_task_func:<src:src> Task going to paused
('on_error():', (GError('Internal data flow error.',), 'gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:src:\nstreaming task paused, reason not-linked (-1)'))

I guess the warning "Unexpected MPEG-1 layer in audio/mpeg, mpegversion=(int)1" has to do with the Internal data flow error, but I don't know how to solve it.

Any help would be appreciate. Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160616/1e9b41e5/attachment-0001.html>


More information about the gstreamer-devel mailing list