gtksink is not rendering my video (black screen)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

gtksink is not rendering my video (black screen)

pisymbol .
If I do the following on the command line:

gst-launch-1.0  filesrc location="/mnt/storage/2cam/20190608_050606Z_00000000.mkv" ! matroskademux name=demux demux.video_0 ! h264parse ! avdec_h264 ! videoconvert ! gtksink

I see the video in the Cairo window.

However, if I do the exact same thing in Python:

on_realize():
 53        self.pipeline = Gst.Pipeline()
 54        factory = self.pipeline.get_factory()
 55        gtksink = factory.make('gtksink')
 56        self.pipeline.add(gtksink)
 57        self.pipeline.add(self.bin) # self.bin = Gst.parse_bin_from_dsecription(pipeline above)
 58        self.bin.link(gtksink)
 59        self.pack_start(gtksink.props.widget, True, True, 0)
 60        self.pipeline.set_state(Gst.State.PLAYING)
 61        gtksink.props.widget.show_all()

It pops open a dialog with a black screen.

HOWEVER, if I simply make my pipline above just 'videotestsrc' it plays the test stream without issue in my window.

Why does 'videotestsrc' work but my custom pipeline above does not?

-aps

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gtksink is not rendering my video (black screen)

pisymbol .


On Sat, Jun 8, 2019 at 1:26 AM pisymbol . <[hidden email]> wrote:
If I do the following on the command line:

gst-launch-1.0  filesrc location="/mnt/storage/2cam/20190608_050606Z_00000000.mkv" ! matroskademux name=demux demux.video_0 ! h264parse ! avdec_h264 ! videoconvert ! gtksink

I see the video in the Cairo window.

However, if I do the exact same thing in Python:

on_realize():
 53        self.pipeline = Gst.Pipeline()
 54        factory = self.pipeline.get_factory()
 55        gtksink = factory.make('gtksink')
 56        self.pipeline.add(gtksink)
 57        self.pipeline.add(self.bin) # self.bin = Gst.parse_bin_from_dsecription(pipeline above)
 58        self.bin.link(gtksink)
 59        self.pack_start(gtksink.props.widget, True, True, 0)
 60        self.pipeline.set_state(Gst.State.PLAYING)
 61        gtksink.props.widget.show_all()



Weird, the pipe is actually failing within Gst:

0:00:05.944147506 12757      0x11d0f70 INFO            GST_PIPELINE grammar.y:518:gst_parse_found_pad: trying delayed linking pad  video_0 of GstMatroskaDemux named demux to some pad of GstH264Parse named h264parse0
0:00:05.944179026 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element demux:video_0 to element h264parse0:(any)
0:00:05.944199121 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad demux:video_0
0:00:05.944260817 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad h264parse0:sink
0:00:05.944287952 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstutils.c:1124:gst_element_get_compatible_pad:<h264parse0> Could not find a compatible pad to link to demux:video_0
0:00:05.944307568 12757      0x11d0f70 INFO                 default gstutils.c:1962:gst_element_link_pads_filtered: Could not link pads: demux:video_0 - h264parse0:(null)
0:00:05.944373647 12757      0x11d0f70 WARN                 default grammar.y:506:gst_parse_no_more_pads:<demux> warning: Delayed linking failed.
0:00:05.944391151 12757      0x11d0f70 WARN                 default grammar.y:506:gst_parse_no_more_pads:<demux> warning: failed delayed linking pad  video_0 of GstMatroskaDemux named demux to some pad of GstH264Parse named h264parse0
0:00:05.944422927 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<demux> posting message: Delayed linking failed.
0:00:05.944459054 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<demux> posted warning message: Delayed linking failed.
0:00:05.944496014 12757      0x11d0f70 INFO               GST_EVENT gstevent.c:760:gst_event_new_segment: creating segment event time segment start=0:00:00.648000000, offset=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:05.945143367 12757      0x11d0f70 WARN           matroskademux matroska-demux.c:4761:gst_matroska_demux_loop:<demux> error: stream stopped, reason not-linked
0:00:05.945192006 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<demux> posting message: GStreamer encountered a general stream error.
0:00:05.945221830 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<demux> posted error message: GStreamer encountered a general stream error.
0:00:05.945249445 12757      0x11d0f70 INFO                    task gsttask.c:316:gst_task_func:<demux:sink> Task going to paused

Again, why does this work on the command line but not in my Python window?

-aps

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gtksink is not rendering my video (black screen)

pisymbol .


On Sat, Jun 8, 2019 at 7:54 AM pisymbol . <[hidden email]> wrote:


On Sat, Jun 8, 2019 at 1:26 AM pisymbol . <[hidden email]> wrote:
If I do the following on the command line:

gst-launch-1.0  filesrc location="/mnt/storage/2cam/20190608_050606Z_00000000.mkv" ! matroskademux name=demux demux.video_0 ! h264parse ! avdec_h264 ! videoconvert ! gtksink

I see the video in the Cairo window.

However, if I do the exact same thing in Python:

on_realize():
 53        self.pipeline = Gst.Pipeline()
 54        factory = self.pipeline.get_factory()
 55        gtksink = factory.make('gtksink')
 56        self.pipeline.add(gtksink)
 57        self.pipeline.add(self.bin) # self.bin = Gst.parse_bin_from_dsecription(pipeline above)
 58        self.bin.link(gtksink)
 59        self.pack_start(gtksink.props.widget, True, True, 0)
 60        self.pipeline.set_state(Gst.State.PLAYING)
 61        gtksink.props.widget.show_all()



Weird, the pipe is actually failing within Gst:

0:00:05.944147506 12757      0x11d0f70 INFO            GST_PIPELINE grammar.y:518:gst_parse_found_pad: trying delayed linking pad  video_0 of GstMatroskaDemux named demux to some pad of GstH264Parse named h264parse0
0:00:05.944179026 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element demux:video_0 to element h264parse0:(any)
0:00:05.944199121 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad demux:video_0
0:00:05.944260817 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad h264parse0:sink
0:00:05.944287952 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstutils.c:1124:gst_element_get_compatible_pad:<h264parse0> Could not find a compatible pad to link to demux:video_0
0:00:05.944307568 12757      0x11d0f70 INFO                 default gstutils.c:1962:gst_element_link_pads_filtered: Could not link pads: demux:video_0 - h264parse0:(null)
0:00:05.944373647 12757      0x11d0f70 WARN                 default grammar.y:506:gst_parse_no_more_pads:<demux> warning: Delayed linking failed.
0:00:05.944391151 12757      0x11d0f70 WARN                 default grammar.y:506:gst_parse_no_more_pads:<demux> warning: failed delayed linking pad  video_0 of GstMatroskaDemux named demux to some pad of GstH264Parse named h264parse0
0:00:05.944422927 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<demux> posting message: Delayed linking failed.
0:00:05.944459054 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<demux> posted warning message: Delayed linking failed.
0:00:05.944496014 12757      0x11d0f70 INFO               GST_EVENT gstevent.c:760:gst_event_new_segment: creating segment event time segment start=0:00:00.648000000, offset=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:05.945143367 12757      0x11d0f70 WARN           matroskademux matroska-demux.c:4761:gst_matroska_demux_loop:<demux> error: stream stopped, reason not-linked
0:00:05.945192006 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<demux> posting message: GStreamer encountered a general stream error.
0:00:05.945221830 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<demux> posted error message: GStreamer encountered a general stream error.
0:00:05.945249445 12757      0x11d0f70 INFO                    task gsttask.c:316:gst_task_func:<demux:sink> Task going to paused

Again, why does this work on the command line but not in my Python window?


In general: Are gst-launch-1.0 pipelines equivalent to Gst.parse_from_description() ones? This has me a bit confuzzled.

-aps

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gtksink is not rendering my video (black screen)

Matthew Waters
On 10/6/19 9:18 am, pisymbol . wrote:


On Sat, Jun 8, 2019 at 7:54 AM pisymbol . <[hidden email]> wrote:


On Sat, Jun 8, 2019 at 1:26 AM pisymbol . <[hidden email]> wrote:
If I do the following on the command line:

gst-launch-1.0  filesrc location="/mnt/storage/2cam/20190608_050606Z_00000000.mkv" ! matroskademux name=demux demux.video_0 ! h264parse ! avdec_h264 ! videoconvert ! gtksink

I see the video in the Cairo window.

However, if I do the exact same thing in Python:

on_realize():
 53        self.pipeline = Gst.Pipeline()
 54        factory = self.pipeline.get_factory()
 55        gtksink = factory.make('gtksink')
 56        self.pipeline.add(gtksink)
 57        self.pipeline.add(self.bin) # self.bin = Gst.parse_bin_from_dsecription(pipeline above)
 58        self.bin.link(gtksink)


This working depends on the exact pipeline and the arguments you passed to 'Gst.parse_bin_from_description'.  You may need to extract videoconvert's src pad and expose that as a ghost pad before 'self.bin.link(gtksink)' may work.

matroskademux also exposes pads dynamically so you need to connect to the 'pad-added' signal and connect it to the h264parse when it exposes the video src pad.  This is most likely the cause of your not-linked error.

The python equivalent of 'gst_debug_bin_to_dot_file_with_ts' is your friend here.

Cheers
-Matt

 59        self.pack_start(gtksink.props.widget, True, True, 0)
 60        self.pipeline.set_state(Gst.State.PLAYING)
 61        gtksink.props.widget.show_all()



Weird, the pipe is actually failing within Gst:

0:00:05.944147506 12757      0x11d0f70 INFO            GST_PIPELINE grammar.y:518:gst_parse_found_pad: trying delayed linking pad  video_0 of GstMatroskaDemux named demux to some pad of GstH264Parse named h264parse0
0:00:05.944179026 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstutils.c:1573:gst_element_link_pads_full: trying to link element demux:video_0 to element h264parse0:(any)
0:00:05.944199121 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad demux:video_0
0:00:05.944260817 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstelement.c:907:gst_element_get_static_pad: found pad h264parse0:sink
0:00:05.944287952 12757      0x11d0f70 INFO        GST_ELEMENT_PADS gstutils.c:1124:gst_element_get_compatible_pad:<h264parse0> Could not find a compatible pad to link to demux:video_0
0:00:05.944307568 12757      0x11d0f70 INFO                 default gstutils.c:1962:gst_element_link_pads_filtered: Could not link pads: demux:video_0 - h264parse0:(null)
0:00:05.944373647 12757      0x11d0f70 WARN                 default grammar.y:506:gst_parse_no_more_pads:<demux> warning: Delayed linking failed.
0:00:05.944391151 12757      0x11d0f70 WARN                 default grammar.y:506:gst_parse_no_more_pads:<demux> warning: failed delayed linking pad  video_0 of GstMatroskaDemux named demux to some pad of GstH264Parse named h264parse0
0:00:05.944422927 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<demux> posting message: Delayed linking failed.
0:00:05.944459054 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<demux> posted warning message: Delayed linking failed.
0:00:05.944496014 12757      0x11d0f70 INFO               GST_EVENT gstevent.c:760:gst_event_new_segment: creating segment event time segment start=0:00:00.648000000, offset=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:05.945143367 12757      0x11d0f70 WARN           matroskademux matroska-demux.c:4761:gst_matroska_demux_loop:<demux> error: stream stopped, reason not-linked
0:00:05.945192006 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<demux> posting message: GStreamer encountered a general stream error.
0:00:05.945221830 12757      0x11d0f70 INFO        GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<demux> posted error message: GStreamer encountered a general stream error.
0:00:05.945249445 12757      0x11d0f70 INFO                    task gsttask.c:316:gst_task_func:<demux:sink> Task going to paused

Again, why does this work on the command line but not in my Python window?


In general: Are gst-launch-1.0 pipelines equivalent to Gst.parse_from_description() ones? This has me a bit confuzzled.

-aps

_______________________________________________
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

signature.asc (499 bytes) Download Attachment