Connecting decodebin2 to autovideosink
Mike Mitchell
mike.mitchell at panometric.net
Mon Nov 7 10:13:06 PST 2011
Your original pipeline does not negotiate on my h264 encoded file. It
requires ffmpegcolorspace to work. I've attached some before and after
diagrams as well as the script I used to generate them. The diagrams
provide visibility into the auto-plugging process that decodebin2 creates.
*Mike Mitchell*
On Mon, Nov 7, 2011 at 8:27 AM, David Walker <dwalker0044 at gmail.com> wrote:
> Hi,
>
> I'm having some trouble connecting decodebin2 to autovideosink in order to
> play mp4 video. So far, using the command line, I have managed to play mp4
> video by creating the following pipe:
>
> gst-launch filesrc location="file.mp4" ! decodebin2 ! autovideosink
>
> I now want to create the same pipeline but in C. Noticing that decodebin2
> has a dynamic pad, I've attached a callback to the "pad-added" signal in
> which I then try to link the pads of decodebin2 and autovideosink - however
> with no success.
>
> I then investigated the caps and noticed that the caps of decodebin2
> are: video/quicktime, variant=(string)iso which isn't a cap of
> autovideosink which would explain the GST_PAD_LINK_NOFORMAT error I am
> seeing.
>
>
> How is it possible that the pipeline on the command line is able to play
> the video but my program seems to provide incompatible type? Is there
> something else that needs to be done?
>
> I'd really appreciate any help, been trying to get my head round this for
> a couple of days now!
>
> Thanks.
>
>
> PS my callback looks like this (I am also using Qt libraries - qDebug
> simply writes to terminal like printf):
>
> static void on_pad_added(GstElement *element, GstPad *srcpad, gpointer
> data)
>
> {
>
> qDebug("on_pad_added");
>
>
> GstElement *videosink = (GstElement *)data;
>
> GstPad *sinkpad = gst_element_get_static_pad(videosink, "sink");
>
>
> qDebug("src caps are %s", gst_caps_to_string(gst_pad_get_caps(srcpad)));
>
> qDebug("sink caps are %s", gst_caps_to_string(gst_pad_get_caps(sinkpad)));
>
>
> if (!gst_pad_can_link(srcpad, sinkpad)) // can link fails
>
> qDebug("Cannot link these pads");
>
>
> switch (gst_pad_link(srcpad, sinkpad)) {
>
> case GST_PAD_LINK_OK:
>
> qDebug("1");
>
> break;
>
> case GST_PAD_LINK_WRONG_HIERARCHY:
>
> qDebug("2");
>
> break;
>
> case GST_PAD_LINK_WAS_LINKED:
>
> qDebug("3");
>
> break;
>
> case GST_PAD_LINK_WRONG_DIRECTION:
>
> qDebug("4");
>
> break;
>
> case GST_PAD_LINK_NOFORMAT: // reason for link error
>
> qDebug("5");
>
> break;
>
> case GST_PAD_LINK_NOSCHED:
>
> qDebug("6");
>
> break;
>
> case GST_PAD_LINK_REFUSED:
>
> qDebug("7");
>
> break;
>
> default:
>
> qDebug("8");
>
> break;
>
> }
>
>
> gst_object_unref (sinkpad);
>
> }
>
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111107/579746d0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp4play_good.png
Type: image/png
Size: 175121 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111107/579746d0/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp4play_error.png
Type: image/png
Size: 138386 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111107/579746d0/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp4playback.sh
Type: application/x-sh
Size: 392 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111107/579746d0/attachment-0001.sh>
More information about the gstreamer-devel
mailing list