[gst-devel] Problem Trying To Use v4l2src

Kulecz, Walter (JSC-SK)[WYLE LABORATORIES] walter.kulecz-1 at nasa.gov
Fri Aug 21 00:25:37 CEST 2009


>Keep in mind that you can have 'static' plugins local to the application
>and part of the application binary. You don't need to create and install
>a plugin .so.

I've no idea how I'd do such a thing.  

I can make a plugin, export the plugin path, and then use in a pipeline; this procedure was reasonably well documented.  I don't see how making a local plugin does anything worthwhile.  Let's punt on this as it gets too specific as to a design for my application, unless understanding this distinction is important to effectively using gstreamer.


>> But if the documentation or sample programs were better I can clearly
>> see the advantage of using a plugin.
>
>That didn't quite parse. In any case, what sample programs and which
>parts of the documentation did you find lacking in particular? If
>there's something specific you would like us to add or fix, please file
>a bug in bugzilla.

My current design has the image capture, processing, and user feedback display in one application, and the user interface to control the image processing parameters in another.  They communicate via a shared mmapped file.  This would make the transition pretty easy as I could open the mmapped file
in my plugin to control the real-time image processing without having to change my user interface at all initially.  Obviously I could also do this in a gstreamer application that didn't use a plug in, but initially I might be able to start things with a simple gst-launch command in a startup script.  I believe more in software evolution than development and like to make changes in terms of  the smallest thing I can debug at a time.

As too Bugzilla, I did file a report before I got to first base as the instructions in the Plugin Writers Guide to use anonymous git didn't work for me because of telnet being blocked by our firewall.  It was immediately marked as "won't fix", although the responder did give me a link to download a *.tar.gz file of the template tree.  Later I got a second response about an http anonymous git command that I verified worked on another system (for testing 16-bit Xserver vs. 32-bit Xserver, having gstreamer automatically solve this issue is one of my prime motavations).  Clearly the http link to get the template should be documentated in the Plugin Writer's Guide, or am I the first one to ever have telnet blocked :)

Another gap in the Plugin Writer's Guide is there is no mention as to how to actually modify the Makefile.am file, it wasn't too hard to figure out after a bit of Googling, but its a time waster caused by incomplete instructions which are particularly frustrating at the "Hello World" stage.

While stumbling around the documention I've run into several of these "Not Found" errors:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-queue2.html

This is the most recent one I've run across, mostly I just cuss a bit and hit the back button and stumble around some more.  If you want Bugzilla reports for these, I'll start keeping track assuming I continue down the gstreamer path.


>>  I don't see any gstTuner or tuner anywhere in the list of base
>>  Elements or  base Plugins.
>
>It's an interface, not an element or plugin. I did say '-base libraries docs' for a reason.
>
>> I did find this:
>>  http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gsttunernorm.html
>>  but the "Details" leaves out the actual strings that sets the norm and
>>  what "property" I'd be setting or method to invoke to change it, since
>>  gst-inspect tuner or gsttuner returns "No such element".  I'm not
>>  clairvoyant.  I'm left without a clue as to how I'd have "gst-launch
>>  v4l2src" set the norm to NTSC, short of perhaps grepping the gstreamer
>>  tree in hopes of finding NTSC or ntsc somewhere.
>  
>I don't think there is a way to do this via gst-launch, you'll have to write code.

Which begs the question of how do I figure out exactly what to write?  The GStreamer Application Development Manual
isn't too helpful here, referring me to the API references.  The API Indices are a bad joke since just about everything starts with Gst or gst_
and the link above is about the only thing I see talking about gsttuner.

I really need to solve the composite input selection and NTSC setting issue before I can justify putting more effort into gstreamer.  I just don't understand how to invoke these interface functions and what there parameters should be.


>GStreamer does have a bit of a learning curve. However, I think there's
>plenty of documentation and good source code around to get you started,
>and people in the #gstreamer IRC channel on Freenode will be happy to
>fill in the blanks where our docs are not as good as one would hope for,
>or at least point you in the right direction.

Unfortunately for me, like telnet, irc and all manner of chat is blocked here.

I have modified the  Application Development Manual's "Hello World" program to open a pipeline with the gst-launch equivalent:
   v4l2src ! video/x-raw-yuv, framerate=\(fraction\)30000/1001 ! queue ! wally ! ffmpegcolorspace ! xvimagesink
And it works, (as long as the NTSC and composite input has been set by another program) if I use: 

    caps = gst_caps_new_simple ("video/x-raw-yuv",
         "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'),
         "width", G_TYPE_INT, 640,
         "height", G_TYPE_INT, 480,
         "framerate", GST_TYPE_FRACTION, 30, 1,
         NULL);
    link_ok = gst_element_link_filtered (source, queue, caps);

But changing it to:
    caps = gst_caps_new_simple ("video/x-raw-gray",
        "width", G_TYPE_INT, 640,
        "height", G_TYPE_INT, 480,
        "framerate", GST_TYPE_FRACTION, 30, 1,
        NULL);
   link_ok = gst_element_link_filtered (source, queue, caps);

the gst_element_like_filtered()  fails.   The v4l2src src caps claim to support  video/x-raw-gray according to gst-inspect.
and queue is CAP_ANY so the idea was to queue 8-bit video, do my processing, and then use ffmpegcolorspace to transform to something xvimage sink supports (video/x-raw-gray is not listed).  I can use I420, and ignore the color info in my processing and then leave out the ffmpegcolorspace which might arguably be more efficient overall.  Playing like this is part of the learning curve, but I can't get video/x-raw-gray to work.  I know the card captures 8-bit gray scale as this is what I use in my application and I then do a table lookup to convert it to 16-bit gray format for the Xserver shared memory window after overlaying a few things (making use of color) for user feedback.

Thanks again for your help.



More information about the gstreamer-devel mailing list