Gstreamer Pipeline Problem in Maemo 5 Camera Example
Hello,
The pipeline initialisation fails in [URL="http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Using_Multimedia_Components/Camera_API_Usage"]Maemo 5 Camera Example[/URL]. It fails at the point where caps is linked with the camera source. If I change the caps to "video/x-raw-yuv" instead of "video/x-raw-rgb" it works, however I am using the same source as an image sink to take pictures and need it in rgb format.
Any suggestions how why?
[I][B]The code:[/B][SIZE="2"]
static gboolean initialize_pipeline(AppData *appdata,
int *argc, char ***argv)
{
...
/* Specify what kind of video is wanted from the camera */
caps = gst_caps_new_simple("video/x-raw-rgb",
"width", G_TYPE_INT, 640,
"height", G_TYPE_INT, 480,
NULL);
/* Link the camera source and colorspace filter using capabilities
* specified */
if(!gst_element_link_filtered(camera_src, csp_filter, caps))
{
return FALSE;
}
...
}[/SIZE][/I]
Thanks, Klen
Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example
If you check what kind of video formats video 4 linux camera source supports
[CODE]gst-inspect v4l2camsrc[/CODE]
you will see that there are only two and none of them is actually video/x-raw-rgb.
Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example
Thanks Daniil,
Had to slightly change the command.
[I]gst-inspect-0.10 v4l2camsrc[/I]
The two supported formats are:
[I] video/x-raw-yuv
format: UYVY
framerate: [ 0/1, 100/1 ]
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ]
video/x-raw-yuv
format: YUY2
framerate: [ 0/1, 100/1 ]
width: [ 1, 2147483647 ]
height: [ 1, 2147483647 ][/I]
I am trying to create pipeline I scatched bellow. I want to capture the video from the camera source in "video/x-raw-yuv" format and then convert it to "video/x-raw-rgb" and link it to an fakesink "image_sink" in order to get raw data from the pipeline.
[I][B] |Camera src| -> |CSP Filter| -> |Image queue| -> |Image filter| -> |Image sink |[/B][/I]
Will the filter know how to convert yuv to rgb?
Can one use fakesink without the valid or do I need to use some other gstreamer plugin to get access to raw image data such as [URL="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-appsink.html"]appsink[/URL].
Thanks for helping.
Klen
Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example
You probably want a pipeline similar to this one:
[CODE]gst-launch -v -t v4l2camsrc num-buffers=1 driver-name=omap3cam ! "video/x-raw-yuv,framerate=499/100" ! \
ffmpegcolorspace ! "video/x-raw-rgb,framerate=499/100" ! appsink[/CODE]
Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example
Thanks Daniil.
Finally I am making some progress. I managed to get the pipline implemented and linked with AppSink API, however, I have problems with linking in the gstreamer-plugins-base-0.10 library. I tied to link in the library using "pkg-config" tool, but still get an error when the object files are linked.
[I]g++ `pkg-config --libs gstreamer-interfaces-0.10 --libs gstreamer-0.10 --libs gstreamer-plugins-base-0.10 --libs glib-2.0` -Wl,-O1 -o DistanceQT appdata.o camerafield.o main.o cameraN900.o guiwidget.o moc_camerafield.o moc_guiwidget.o -L/usr/lib -Wl,-rpath-link=/usr/lib -L/usr/lib/gstreamer-0.10/ -lgstreamer-0.10 -lQtGui -lQtCore -lpth
cameraN900.o: In function `CameraN900::new_buffer_added(_GstAppSink*, void*)':
/home/klen/workplace/maemo/DistanceQT/src/cameraN900.cpp:440: undefined reference to `gst_app_sink_pull_buffer'[/I]
Any suggestions?
Thanks,
Klen
Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example
Add these lines to your .pro file:
[CODE]
unix{
CONFIG += link_pkgconfig
PKGCONFIG = gstreamer-plugins-base-0.10
}
[/CODE]
Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example
I already had something similar to that. I changed it and tried the proposed solution. It is still not working. It looks like my "pkg-config" is missing something as the output of gstreamer-plugins-base-0:
[I]pkg-config --libs gstreamer-plugins-base-0.10
-pthread -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0[/I]
is the same as for gstreamer-0.10.
[I] pkg-config --libs gstreamer-0.10
-pthread -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0[/I]
In the gstreamer documentation I also found that the appsink has been [URL="http://gstreamer.freedesktop.org/documentation/plugins.html"]moved from gst-bad-plagins to gst-base-plagins with verison 0.10.28[/URL]. As on my N900 the version of gstreamer0.10-plugins-base is 0.10.25-0maemo7+0m5 I guess i need to include gstreamer0.10-plugins-bad instead. However, including this does not help as well.
The output of gstreamer-plugins-bad-0.10 is:
[I]pkg-config --libs gstreamer-plugins-bad-0.10
-pthread -lgstphotography-0.10 -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0
[/I]
To sum up. The bellow linking fails again.
[I]
g++ -Wl,-O1 -o DistanceQT appdata.o camerafield.o main.o cameraN900.o guiwidget.o moc_camerafield.o moc_guiwidget.o -L/usr/lib -Wl,-rpath-link=/usr/lib -pthread -pthread -lgstinterfaces-0.10 -pthread -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0 -ldbus-1 -lQtGui -lQtCore -lpthread
cameraN900.o: In function `CameraN900::new_buffer_added(_GstAppSink*, void*)':
/home/klen/workplace/maemo/DistanceQT/src/cameraN900.cpp:446: undefined reference to `gst_app_sink_pull_buffe'[/I]
Are there any alternatives I could try? Any help is greatly appreciated.
Klen
My .pro file:
[I][SIZE="2"]HEADERS +=
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QMAKE_CLEAN += distanceqt
CONFIG += link_pkgconfig
PKGCONFIG += gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10 gstreamer-0.10 dbus-1
QT += gui
#Includes
INCLUDEPATH +=. /usr/include/ \
/usr/include/gtk-2.0/ \
/usr/include/gtk-2.0/gtk/ \
/usr/include/gstreamer-0.10/ \
/usr/lib/gstreamer-0.10 \
/usr/include/glib-2.0/ \
/usr/include/glib-2.0/glib/ \
/usr/include/glib-2.0/gio/ \
/usr/include/glib-2.0/gobject/ \
/usr/include/cairo/ \
/usr/include/pango-1.0/ \
/usr/include/atk-1.0/ \
/usr/include/libxml2/ \
/usr/include/dbus-1.0/ \
/usr/lib/gtk-2.0/include \
/usr/lib \
/usr/lib/glib-2.0/include \
/usr/lib/dbus-1.0/include
# Input
HEADERS += src/appdata.h src/camerafield.h src/cameraN900.h src/guiwidget.h
SOURCES += src/appdata.cpp src/camerafield.cpp src/main.cpp src/cameraN900.cpp src/guiwidget.cpp[/SIZE][/I]
Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example
[QUOTE=Klen;716282]In the gstreamer documentation I also found that the appsink has been [URL="http://gstreamer.freedesktop.org/documentation/plugins.html"]moved from gst-bad-plagins to gst-base-plagins with verison 0.10.28[/URL]. As on my N900 the version of gstreamer0.10-plugins-base is 0.10.25-0maemo7+0m5 I guess i need to include gstreamer0.10-plugins-bad instead. However, including this does not help as well.
[/QUOTE]
It's extremely simple to verify:
[CODE]
dpkg -L libgstreamer-plugins-base0.10-dev | grep appsink
/usr/include/gstreamer-0.10/gst/app/gstappsink.h
[/CODE]
[QUOTE=Klen;716282]
My .pro file:
[I][SIZE="2"]HEADERS +=
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QMAKE_CLEAN += distanceqt
CONFIG += link_pkgconfig
PKGCONFIG += gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10 gstreamer-0.10 dbus-1
QT += gui
#Includes
INCLUDEPATH +=. /usr/include/ \
/usr/include/gtk-2.0/ \
/usr/include/gtk-2.0/gtk/ \
/usr/include/gstreamer-0.10/ \
/usr/lib/gstreamer-0.10 \
/usr/include/glib-2.0/ \
/usr/include/glib-2.0/glib/ \
/usr/include/glib-2.0/gio/ \
/usr/include/glib-2.0/gobject/ \
/usr/include/cairo/ \
/usr/include/pango-1.0/ \
/usr/include/atk-1.0/ \
/usr/include/libxml2/ \
/usr/include/dbus-1.0/ \
/usr/lib/gtk-2.0/include \
/usr/lib \
/usr/lib/glib-2.0/include \
/usr/lib/dbus-1.0/include
# Input
HEADERS += src/appdata.h src/camerafield.h src/cameraN900.h src/guiwidget.h
SOURCES += src/appdata.cpp src/camerafield.cpp src/main.cpp src/cameraN900.cpp src/guiwidget.cpp[/SIZE][/I]
[/QUOTE]
You don't need INCLUDEPATH for anything. pkg-config is taking care of it. Add [I]gstreamer-app-0.10[/I] to PKGCONFIG.
Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example
Did as you said. Now it compiles like a charm. I hope I will now get stuck to soon :).
Thanks for you hlep again.
Cheers,
Klen