Reply
Thread Tools
Posts: 61 | Thanked: 77 times | Joined on Dec 2009 @ Lancaster
#1
Hello,

The pipeline initialisation fails in Maemo 5 Camera Example. 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?

The code:
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;
}
...
}


Thanks, Klen
 

The Following 2 Users Say Thank You to klen For This Useful Post:
Posts: 61 | Thanked: 77 times | Joined on Dec 2009 @ Lancaster
#2
Thanks to Daniil from Forum Nokia I got a little bit farther.

With the command bellow one gets all of the supported formats for capturing the camera stream.

gst-inspect-0.10 v4l2camsrc

As one can see the "video/x-raw-rgb" is not amongst them. If I can not capture it as "video/x-raw-rgb" maybe I could convert it to this format.

The two supported formats are:
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 am now 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.

|Camera src| -> |CSP Filter| -> |Image queue| -> |Image filter| -> |Image sink |

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 appsink.

Thanks for helping.

Klen

Last edited by klen; 2010-03-18 at 20:51.
 

The Following 2 Users Say Thank You to klen For This Useful Post:
Posts: 61 | Thanked: 77 times | Joined on Dec 2009 @ Lancaster
#3
Thanks to Daniil again, I am making some progress.

The pipeline that I need is the following one:
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


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.

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'


Any suggestions?

Thanks,
Klen

Last edited by klen; 2010-03-18 at 20:50.
 

The Following 2 Users Say Thank You to klen For This Useful Post:
Posts: 61 | Thanked: 77 times | Joined on Dec 2009 @ Lancaster
#4
I tried adding this to my .pro fill but still no success.

CONFIG += link_pkgconfig
PKGCONFIG = gstreamer-plugins-base-0.10


It looks like my "pkg-config" is missing something as the output of gstreamer-plugins-base-0:

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


is the same as for gstreamer-0.10.

pkg-config --libs gstreamer-0.10
-pthread -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0


In the gstreamer documentation I also found that the appsink has been moved from gst-bad-plagins to gst-base-plagins with verison 0.10.28. 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:
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


To sum up. The bellow linking fails again.

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'


Are there any alternatives I could try? Any help is greatly appreciated.

Klen

My .pro file:
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
 

The Following 2 Users Say Thank You to klen For This Useful Post:
Posts: 61 | Thanked: 77 times | Joined on Dec 2009 @ Lancaster
#5
You don't need INCLUDEPATH for anything. pkg-config is taking care of it. You need to add gstreamer-app-0.10 to PKGCONFIG.

Cheers,
Klen
 

The Following User Says Thank You to klen For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 11:32.