×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    59

    Gstreamer Pipeline Problem in Maemo 5 Camera Example

    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

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    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
    you will see that there are only two and none of them is actually video/x-raw-rgb.

  3. #3
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    59

    Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example

    Thanks Daniil,

    Had to slightly change the command.

    gst-inspect-0.10 v4l2camsrc

    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 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:49.

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    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

  5. #5
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    59

    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.

    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:49.

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    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
    }

  7. #7
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    59

    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:

    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
    Last edited by Klen; 2010-03-19 at 11:42.

  8. #8
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Gstreamer Pipeline Problem in Maemo 5 Camera Example

    Quote Originally Posted by Klen View Post
    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.
    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
    Quote Originally Posted by Klen View Post
    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
    You don't need INCLUDEPATH for anything. pkg-config is taking care of it. Add gstreamer-app-0.10 to PKGCONFIG.

  9. #9
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    59

    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

Similar Threads

  1. Camera field of view problem
    By torsak1 in forum Symbian
    Replies: 2
    Last Post: 2009-10-18, 06:03
  2. Using camera frame as OpenGL texture, problem!!
    By abolfoooud in forum Symbian Media (Closed)
    Replies: 29
    Last Post: 2009-06-18, 02:58
  3. on the N73 capturing a picture from a camera meet a problem.
    By daibou007 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2008-07-17, 10:19
  4. Problem with Nokia Navigator Camera functions
    By cammywammy in forum General Development Questions
    Replies: 1
    Last Post: 2008-04-12, 09:36
  5. Replies: 2
    Last Post: 2006-05-02, 07:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×