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 [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
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 <[hidden email]> wrote: Hi,
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel mp4play_good.png (234K) Download Attachment mp4play_error.png (184K) Download Attachment mp4playback.sh (536 bytes) Download Attachment |
Hi Mike,
Thank you for your response. The diagrams were very helpful. I see from the diagrams that the output media type should be video/x-raw-yuv. However, when my program receives the pad-added signal the pad still has caps of video/quicktime. Is it required/possible to force the output type of decodebin2?
I also receive an "autoplug-continue" signal which I currently don't do anything with. Not sure if that is important at this stage. Please find attached my code should you wish to take a look.
Many thanks, On 7 November 2011 18:13, Mike Mitchell <[hidden email]> wrote:
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel player.c (9K) Download Attachment |
Free forum by Nabble | Edit this page |