0

I have cross compiled Qt for the Raspberry pi with QtMultimedia and Gstreamer1.0 support with platform xcb and eglfs

Now if I run an app to play a video using platform eglfs it runs and video plays and if I use platform xcb for app it gives an error that videosink is not working

So how can I get video played using xcb plugins?

The errors I am getting are

xvimagesink xvimagesink.c:1443:gst_xvimagesink_get_xv_support:<xvimagesink1> error: Could not initialise Xv output

xvimagesink xvimagesink.c:1443:gst_xvimagesink_get_xv_support:<xvimagesink1> error: No port available

I am working on Raspbian Wheezy armv7

Greenonline
  • 1,330
  • 8
  • 23
  • 31
haresh
  • 63
  • 10
  • these packages may be required - libx11-xcb1 and libx11-xcb-dev, also check qtbase/src/plugins/platforms/xcb/README – nayana Sep 16 '15 at 09:50
  • I have installed all required packages – haresh Sep 16 '15 at 10:01
  • have you tried running some Qt example app for xcb gstreamer? can you post the error messages you get after running your app? you may try running your app with exported variable: `GST_DEBUG=3 ./your_app` this will turn gstreamer debugging on. I dont know if its possible but you can also test gstreamer by running `gst-launch-1.0 videotestsrc ! autovideosink` – nayana Sep 16 '15 at 10:40
  • using GST_DEBUG=3 it gives error somewhere in missle stating that "Could not initialize Xv output" No port available – haresh Sep 16 '15 at 10:58
  • ok, please fill all the details (copy paste all warnings etc you found out so far) into the question.. you can check output for xvinfo, do you have libxv1 package? please update your question with other relevant infos like - what kind of distro, CPU, GPU .. – nayana Sep 16 '15 at 11:13
  • ok I have edited the errors in question – haresh Sep 16 '15 at 11:57
  • ok, what about output for `xvinfo` ? you can also ask on gstreamer [IRC](http://irc.lc/freenode/gstreamer), they are quite responsive, you can install gstreamer utilities like gst-launch and try the pileline I posted above, also you can check the source code for given files – nayana Sep 16 '15 at 12:33
  • Thanks for your help xvinfo says no adaptors support.I searched on google and it seems it is problem with X server.So do you know any way to set Qtmultimedia to use ximagesink or any other videosink rather than xvimagesink. – haresh Sep 16 '15 at 12:37

1 Answers1

0

Ok I will compose an answer instead of making tons of comments.

You could try to change the source code for the QGstreamerVideoWidget here In that function you see xvimagesink.

Interesting is that there already is fallback to ximagesink if xvimagesink is not working.. I would try autovideosink which should always work..

void QGstreamerVideoWidgetControl::createVideoWidget()
{
    if (m_widget)
        return;

    m_widget = new QGstreamerVideoWidget;

    m_widget->installEventFilter(this);
    m_windowId = m_widget->winId();

    /// --- CHANGED HERE (xvimagesink -> autovideosink) -----
    m_videoSink = gst_element_factory_make ("autovideosink", NULL); 
    if (m_videoSink) { /// --- maybe this if is not needed anymore ---
        // Check if the xv sink is usable
        if (gst_element_set_state(m_videoSink, GST_STATE_READY) != GST_STATE_CHANGE_SUCCESS) {
            gst_object_unref(GST_OBJECT(m_videoSink));
            m_videoSink = 0;
        } else {
            gst_element_set_state(m_videoSink, GST_STATE_NULL);

            g_object_set(G_OBJECT(m_videoSink), "force-aspect-ratio", 1, (const char*)NULL);
        }
    }

    if (!m_videoSink)
        m_videoSink = gst_element_factory_make ("ximagesink", NULL);

    qt_gst_object_ref_sink(GST_OBJECT (m_videoSink)); //Take ownership
}

Or maybe its QGstreamerVideoWindow here again replace xvimagesink with autovideosink, maybe it will help.

I am not sure what exactly is being used by your code..

nayana
  • 3,787
  • 3
  • 20
  • 51
  • thanks for the help.I looked into both files and It uses xvimagesink so I think I have to change it to autovideosink but then I have to build Qt again from source.So I will check it and report back – haresh Sep 17 '15 at 13:04
  • @haresh I would first try to run gstreamer pipeline with gst-launch tool to check if it works with autovideosink.. check if you have somewhere the gst-launch-1.0 binary and run `gst-launch-1.0 videotestsrc ! autovideosink` also you can check with GST_DEBUG set to some higher value what kind of element was choosed for autovideosink (the autovideosink tries several sinks and chooses that which works). In worst case you can code some sample app in C with usage of gstreamer libraries to create mentioned pipeline. – nayana Sep 17 '15 at 13:32
  • :I tried ximagesink and autovideosink but it didn't work and then I tried glimagesink and it worked.finally its now playing the videos though I am getting some warnings related to jack.so I am selecting this as an answer to question but it is not able to handle the HD videos if you can help in this issue.Anyway thanks for your help. – haresh Sep 19 '15 at 03:41