[gst-devel] Problem Trying To Use v4l2src

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


>> 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.
>
>That is true, but there's only so much you can do in these kind of docs.
>Just like we don't teach people C or GLib/GObject basics, we can't
>really teach them how to compile code or how autotools work (IMHO).
>However, if you have any links that you have found particularly helpful,
>please let us know (in bugzilla, preferably) so we can mention them
>somewhere.

It would be most helpful if the gst-template/gst-plugin/tools/make_element script created the Makefile.am needed by generated element source files.
This thread found on nabble.com via Google,  http://www.nabble.com/Novice-td24209412.html   had the key piece of info for me. 
Actually, browsing the archives of this list on nabble seems to be much better than via sourceforge.  I guess source forge is a bit overloaded.

What was left out is how to modify the Makefile.am, good luck if you don't understand automake. 
Since in this case it is a script generated template, for a single plugin its not too hard. 
Every place the substring "plugin" occurs in a non-commented line in the Makefile.am 
you need to replace it with the name you gave in the ../tools/make_element command, "wally" in my case.

I'm not sure anyone can explain how the autotools work or why you often end having to have multiple versions of them installed.  No Starch Press is supposed to have a book coming out later this year about GNU Autotools, so maybe there is hope.

The goodness of any framework is basically how well it encapsulates all this arcane knowledge to provide usable recipes.
Once I got the template to build I had no trouble making a trivial video filter plug-in.

The instructions in the Application Guide to build the helloworld gstreamer audio player application were correct and complete, but Ubuntu 8.04 let me down here by missing the sym links needed to make the nested include files find everything.  I posted a thread on the Ubuntu programming talk forum
with my fix: http://ubuntuforums.org/showthread.php?t=1233105




>> While stumbling around the documentation I've run into several of these "Not Found" errors:
>
>I think/hope this is only linked to from
>http://gstreamer.freedesktop.org/documentation/plugins.html in which
>case the disclaimer at the top of the page applies. However, elements in
>core, -base and -good *should* really all be documented, so if you find
>core/base/good elements that aren't, a bug report would certainly be
>appreciated.

Just ran across this one while trying to incorporate the clue about gsttuner you've given me below.
>From Overview of available plug-ins, choose v4l2src, then  under Implemented Interfaces
choose GstTuner and I get another "Not Found":
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/gst-plugins-base-libs-0.10/gst-plugins-base-libs-gsttuner.html#GstTuner
I've just posted it to Bugzilla.



>You could start by creating a pipeline with your elements
>(gst_parse_launch() might come in handy), and setting their state to
>PLAYING.
>
>If you have a GstElement * pointer to a v4l2src element, you can cast it
>to a GstTuner using:
>
>GstTuner *tuner = GST_TUNER (v4l2src);
--- rest of code snippet deleted ---

I'm working on it, thanks for the clue.  I modified the helloworld.c program to launch my video pipeline
instead of playing an ogg audio file, and made my plug-in do a histogram equalization so the pieces are in place.
If I solve the tuner component input selection issue I'll post this as an example.



>> Unfortunately for me, like telnet, irc and all manner of chat is blocked here.
>
>I believe there are web interfaces for IRC.
If you've got a link I can try it, but the top level Freenode website was blocked :(
as are all manner of public Email sites.  I can get gmail with https:// so if you've got a direct link to the web interface
I can try getting there with https://



>>  (snip code)
>> the gst_element_like_filtered()  fails.   The v4l2src src caps claim to
>>  support  video/x-raw-gray according to gst-inspect.
>
>gst-inspect lists all the caps that the element can possibly support. It
>does not mean that all these caps are actually supported at runtime. The
>caps actually supported is a subset of the template caps listed in
>gst-inspect and mostly depends on your hardware and the driver.
>Something like this should show what's supported:
>
 >GST_DEBUG=v4l2*:5 gst-launch v4l2src num-buffers=1 ! fakesink 2>&1 | grep probed
>
This doesn't show video/x-raw-gray either, which would explain why it don't work.  
I know this card supports it my my version 1 program sets it up with Video4Linux2 calls.
Its a cheap saa7134 capture card.  Would this be considered a bug in v4l2src?  If so, I will submit to Bugzilla.

Using Ubuntu 8.04  and is gstreamer-0.18 , so it might be best if anyone else out there with an saa1734 card
and the current gstreamer version could run that probe command to verify before going to Bugzilla.

The tuner input setting issue is a showstopper, using  I420 and passing around buffers half unused I can live with.



Thanks again for your help.  I am making progress!

Interesting that "gst-launch v4l2src ! queue ! xvimagesink"  had gst-launch and Xorg using about 35% CPU (test machine is weak, 1.4G Athelon)
but my hellovideo.c and plug in only had hellovideo.c and Xorg run about 22%.   Playing with gst-launch made me think I might come up against a performance issue as my application runs two live video streams.  It seems the issue is gst-launch, not gstreamer.



More information about the gstreamer-devel mailing list