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).PIPELINE_DEF = "udpsrc do-timestamp=true name=src closefd=false !" \ # Create gstreamer pipeline to stream video For the 1.0 I'm building the pipeline using add and link instead of parse_launch. My code is: 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: 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. _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
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:[hidden email]]
On Behalf Of Higinio Martí Ribés 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 !" \ # Create gstreamer pipeline to stream video For the 1.0 I'm building the pipeline using add and link instead of parse_launch. My code is: 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:
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.
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thanks, Shishir. I add the listener to the "pad-added" signal for qtdemux and try to link the pad with queue:
def pad_added_handler(self, src, new_pad): print("Received new pad {0} from {1}".format(new_pad, src)) if new_pad.is_linked(): print ("We are already linked. Ignoring") return new_pad_type = new_pad.query_caps(None).to_string() print ("New pad added of type: {0}".format(new_pad_type)) ret = new_pad.link(self.queue.get_static_pad("sink")) return But now I'm having "Incompatible pads" with tsdemux and queue: 0:00:01.809406744 9876 0x2b378f0 WARN default descriptions.c:612:format_info_get_desc: Unexpected MPEG-1 layer in audio/mpeg, mpegversion=(int)1 0:00:01.809443654 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad tsdemux0:sink 0:00:01.809525077 9876 0x2b378f0 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:01.809591660 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<tsdemux0> adding pad 'audio_0041' Received new pad <Pad object at 0x7fc2591ebaf0 (GstPad at 0x29aba70)> from <__main__.GstTSDemux object at 0x7fc263a36370 (GstTSDemux at 0x29d0100)> New pad added of type: audio/mpeg, mpegversion=(int)1 0:00:01.810264717 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad queue0:sink 0:00:01.810389462 9876 0x2b378f0 INFO GST_PADS gstpad.c:2120:gst_pad_link_prepare: trying to link tsdemux0:audio_0041 and queue0:sink 0:00:01.810412086 9876 0x2b378f0 INFO GST_PADS gstpad.c:2176:gst_pad_link_prepare: caps are incompatible 0:00:01.810429086 9876 0x2b378f0 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.812892209 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<tsdemux0> adding pad 'video_0040' Received new pad <Pad object at 0x7fc2591ebaf0 (GstPad at 0x29abca0)> from <__main__.GstTSDemux object at 0x7fc263a36370 (GstTSDemux at 0x29d0100)> New pad added of type: video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal 0:00:01.813000182 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad queue0:sink 0:00:01.813021020 9876 0x2b378f0 INFO GST_PADS gstpad.c:2120:gst_pad_link_prepare: trying to link tsdemux0:video_0040 and queue0:sink 0:00:01.813047798 9876 0x2b378f0 INFO GST_PADS gstpad.c:2176:gst_pad_link_prepare: caps are incompatible 0:00:01.813118214 9876 0x2b378f0 INFO basesrc gstbasesrc.c:2785:gst_base_src_loop:<src> pausing after gst_pad_push() = not-linked 0:00:01.813134546 9876 0x2b378f0 WARN basesrc gstbasesrc.c:2865:gst_base_src_loop:<src> error: Internal data flow error. 0:00:01.813139330 9876 0x2b378f0 WARN basesrc gstbasesrc.c:2865:gst_base_src_loop:<src> error: streaming task paused, reason not-linked (-1) 0:00:01.813154141 9876 0x2b378f0 INFO GST_ERROR_SYSTEM gstelement.c:1835:gst_element_message_full:<src> posting message: Internal data flow error. 0:00:01.813175931 9876 0x2b378f0 INFO GST_ERROR_SYSTEM gstelement.c:1858:gst_element_message_full:<src> posted error message: Internal data flow error. 0:00:01.813260218 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:766:gst_element_remove_pad:<tsdemux0> removing pad 'audio_0041' 0:00:01.813287556 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:766:gst_element_remove_pad:<tsdemux0> removing pad 'video_0040' ('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)')) 0:00:01.813342610 9876 0x2b378f0 INFO task gsttask.c:300:gst_task_func:<src:src> Task going to paused |
I think that following lines had errors:
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())) They should be: self.udpsrc = Gst.ElementFactory.make('udpsrc', 'src') self.udpsrc.set_property("socket",Gio.Socket().new_from_fd(self.videosocket.fileno())) self.pipeline.add(self.udpsrc) |
In reply to this post by HM
You might be linking wrong pads. Check for pad type (audio/video) and link accordingly
Something like this: def on_pad_added(self, element, pad): """Callback to link a/v sink to decoder source.""" string = pad.query_caps(None).to_string() if string.startswith('video/'): print "linking videoqueue with decoder" pad.link(self.video_queue.get_static_pad("sink")) elif string.startswith('audio/'): print "linking audioqueue with decoder" pad.link(self.audio_queue.get_static_pad("sink")) -----Original Message----- From: gstreamer-devel [mailto:[hidden email]] On Behalf Of HM Sent: Wednesday, June 22, 2016 3:44 AM To: [hidden email] Subject: RE: Python Gstreamer: Internal data flow error porting program from 0.10 to 1.0 Thanks, Shishir. I add the listener to the "pad-added" signal for qtdemux and try to link the pad with queue: def pad_added_handler(self, src, new_pad): print("Received new pad {0} from {1}".format(new_pad, src)) if new_pad.is_linked(): print ("We are already linked. Ignoring") return new_pad_type = new_pad.query_caps(None).to_string() print ("New pad added of type: {0}".format(new_pad_type)) ret = new_pad.link(self.queue.get_static_pad("sink")) return But now I'm having "Incompatible pads" with tsdemux and queue: 0:00:01.809406744 9876 0x2b378f0 WARN default descriptions.c:612:format_info_get_desc: Unexpected MPEG-1 layer in audio/mpeg, mpegversion=(int)1 0:00:01.809443654 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad tsdemux0:sink 0:00:01.809525077 9876 0x2b378f0 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:01.809591660 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<tsdemux0> adding pad 'audio_0041' Received new pad <Pad object at 0x7fc2591ebaf0 (GstPad at 0x29aba70)> from <__main__.GstTSDemux object at 0x7fc263a36370 (GstTSDemux at 0x29d0100)> New pad added of type: audio/mpeg, mpegversion=(int)1 0:00:01.810264717 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad queue0:sink 0:00:01.810389462 9876 0x2b378f0 INFO GST_PADS gstpad.c:2120:gst_pad_link_prepare: trying to link tsdemux0:audio_0041 and queue0:sink 0:00:01.810412086 9876 0x2b378f0 INFO GST_PADS gstpad.c:2176:gst_pad_link_prepare: caps are incompatible 0:00:01.810429086 9876 0x2b378f0 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.812892209 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:646:gst_element_add_pad:<tsdemux0> adding pad 'video_0040' Received new pad <Pad object at 0x7fc2591ebaf0 (GstPad at 0x29abca0)> from <__main__.GstTSDemux object at 0x7fc263a36370 (GstTSDemux at 0x29d0100)> New pad added of type: video/x-h264, stream-format=(string)byte-stream, alignment=(string)nal 0:00:01.813000182 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:897:gst_element_get_static_pad: found pad queue0:sink 0:00:01.813021020 9876 0x2b378f0 INFO GST_PADS gstpad.c:2120:gst_pad_link_prepare: trying to link tsdemux0:video_0040 and queue0:sink 0:00:01.813047798 9876 0x2b378f0 INFO GST_PADS gstpad.c:2176:gst_pad_link_prepare: caps are incompatible 0:00:01.813118214 9876 0x2b378f0 INFO basesrc gstbasesrc.c:2785:gst_base_src_loop:<src> pausing after gst_pad_push() = not-linked 0:00:01.813134546 9876 0x2b378f0 WARN basesrc gstbasesrc.c:2865:gst_base_src_loop:<src> error: Internal data flow error. 0:00:01.813139330 9876 0x2b378f0 WARN basesrc gstbasesrc.c:2865:gst_base_src_loop:<src> error: streaming task paused, reason not-linked (-1) 0:00:01.813154141 9876 0x2b378f0 INFO GST_ERROR_SYSTEM gstelement.c:1835:gst_element_message_full:<src> posting message: Internal data flow error. 0:00:01.813175931 9876 0x2b378f0 INFO GST_ERROR_SYSTEM gstelement.c:1858:gst_element_message_full:<src> posted error message: Internal data flow error. 0:00:01.813260218 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:766:gst_element_remove_pad:<tsdemux0> removing pad 'audio_0041' 0:00:01.813287556 9876 0x2b378f0 INFO GST_ELEMENT_PADS gstelement.c:766:gst_element_remove_pad:<tsdemux0> removing pad 'video_0040' ('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)')) 0:00:01.813342610 9876 0x2b378f0 INFO task gsttask.c:300:gst_task_func:<src:src> Task going to paused -- View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Python-Gstreamer-Internal-data-flow-error-porting-program-from-0-10-to-1-0-tp4678062p4678203.html Sent from the GStreamer-devel mailing list archive at Nabble.com. _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |