Need help on video output using gstreamer

George Kiagiadakis kiagiadakis.george at gmail.com
Fri Oct 14 14:41:23 BST 2011


On Fri, Oct 14, 2011 at 4:15 PM, Trever Fischer
<tdfischer at fedoraproject.org> wrote:
>
>> Hi,
>>
>> I'm coding a media player using KDE/Qt and GStreamer (directly, no
>> Phonon). So far it is going good.
>>
>> Now I'm adding full screen video mode and was toying with an idea of
>> having QGraphicsView and adding video widget and other widgets to it.
>>
>> Idea is very similar to as implemented in Plasma::VideoWidget (No
>> special handling seems to be there, though it uses Phonon). But
>> despite my best efforts, I'm unable to have video inside
>> QGraphicsView.
>>
>> On my part, I'm just adding my video widget using QGraphicsProxyWidget
>> and here is the relevant code regarding my video widget: -
>>
>>     m_pVideoWidget = new VideoWidget(m_pVideoSink,
>> mAvailableVisualisations);
>>     m_pVideoWidget->setVisible(false);
>>     gst_x_overlay_set_window_handle( GST_X_OVERLAY(m_pVideoSink),
>> m_pVideoWidget->winId());
>>
>> Apart from above, there is no special code w.r.t. VideoWidget.
>> Everything is fine as long as I'm not using QGraphicsView.
>
> A QGraphicsItem is not a QWidget, which doesn't have its own window ID. To
> use a QGraphicsView properly, you actually need to pull the individual
> frames out of the pipeline at some point.
>
> Here's some code from Harald's GSOC project that implements QGraphicsView
> support in phonon-gstreamer:
> https://projects.kde.org/projects/kdesupport/phonon/phonon-gstreamer/repository/revisions/qml-i2/entry/gstreamer/videographicsobject.cpp
>
> Might be a bit heady and definitely not the whole picture, but it can get
> you started. My recommendation though, is that you use the GStreamer
> appsink element:
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-appsink.html
>


You could also use my qwidgetvideosink element [1] with a
QGraphicsProxyWidget, I think.... I have never tested it like that,
but it should work. I should note though that this is not the best
approach in terms of performance. The best approach would be to paint
with OpenGL like phonon and QtMultimedia do. I have plans to add
OpenGL painting support there in the future, but it's not there yet...

[1]. http://cgit.freedesktop.org/gstreamer/qt-gstreamer/tree/elements



More information about the kde-multimedia mailing list