[libavg-devel] video4Linux2 on libavg: some design choices
Ben Lau
xbenlau at gmail.com
Sun Jun 24 18:20:47 CEST 2007
Hi OXullo Intersecans,
I have downloaded the libavg-v4l2 branch (rev 2136) to test with my
Logitech Quickcam Pro 4000. However, I could not get it works with the
error messages below:
[07-06-25 00:09:34.368] LOGGER: Logging started
[07-06-25 00:09:34.369] APP: CameraNode() constructor. Source=v4l
[07-06-25 00:09:34.369] APP: V4LCamera() sMode=320x240_YUV422
[07-06-25 00:09:34.369] APP: Mode tokens: 320x240 / YUV422
[07-06-25 00:09:34.369] APP: Selecting YUV4:2:2 pixel format
[07-06-25 00:09:34.369] APP: V4LCamera created
[07-06-25 00:09:34.369] ERROR: VIDIOC_QUERYCTRL
The source:
camera.avg :
<?xml version="1.0"?>
<avg width="640" height="480">
<camera id="cam" x="0" y="0" width="320" height="240"
device="/dev/video0" mode="320x240_YUV422" channel="1" source="v4l" />
</avg>
camera.py :
import avg
Player = avg.Player()
Player.loadFile("camera.avg")
camera = Player.getElementByID("cam");
camera.open();
Player.play()
The errno returned is EBADF (Bad file descriptor). In the
constructor of CameraNode , it calls setFeature() of V4LCamera object
before the device is opened. The file descriptor is not yet
initialized then cause the error. It is quite strange. What is the
expected way to open the camera?
On 6/24/07, OXullo Intersecans <x at 02l.net> wrote:
> Hi folkz,
> we just committed a working revision of the branch libavg-v4l2 (the latest
> 2134 has been merged with the trunk head).
>
>
> V4LCamera via CameraNode can be loaded using avg 'camera' node:
>
> <camera id="cam" x="0" y="0" width="640" height="480" device="/dev/video0"
> mode="640x480_YUV422" channel="1" source="v4l" />
>
> attributes are quite self-explanatory however:
>
> mode: WxH_PF where PF can be: RGB, MONO8, YUV422 (the same as firewire
> camera)
> channel: video mux selector, for example, a bt878 pci board has: 0=tuner,
> 1=composite, 2=svideo
> source: 'v4l' instead of 'firewire' is the magic switch
>
> download method from v4l card has been hardcoded as mmap(), which seems to
> sign the best performance
>
>
> Now, about the tracker.
> This is instantiated by Player, using addTracker() method, usually as python
> binding Player.addTracker()
>
> We split this method in two: addFWTracker(device, mode) and
> addV4LTracker(device, mode, channel). This seems not to be the best way, but
> was the fastest, waiting for some Uli's advices basing on his best flavours.
>
> We have some doubts about avgtrackerrc.
> The one supplied with mtc subproject (TrackerConfig.xml) does not validate
> against the trackerconfig dtd, as the latter requires a more detailed
> structure.
> Recreating it from the dtd was quite simple, using default data found on
> specific class constructors:
>
> -------------------------- /etc/avgtrackerrc
> --------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <trackerconfig>
> <camera>
> <brightness value="128"/>
> <exposure value="128"/>
> <gamma value="1"/>
> <gain value="128"/>
> <shutter value="128"/>
> </camera>
>
> <tracker>
> <historyupdateinterval value="5"/>
> <touch>
> <threshold value="128" />
> <similarity value="31" />
> <areabounds min="80" max="450" />
> <eccentricitybounds min="1" max="3" />
> </touch>
> <track>
> <threshold value="128" />
> <similarity value="31" />
> <areabounds min="80" max="450" />
> <eccentricitybounds min="1" max="3" />
> </track>
>
> </tracker>
>
> <transform>
> <cameradisplacement x="0" y="0" />
> <camerascale x="1" y="1" />
> <distortionparams p2="0" p3="0" />
> <trapezoid value="0" />
> <angle value="0" />
> <displaydisplacement x="0" y="0" />
> <displayscale x="1" y="1" />
> </transform>
> </trackerconfig>
> -------------------------- /etc/avgtrackerrc
> --------------------------
>
> Uli: can you put a working avgtrackerrc under svn control?
>
> At this time, V4LCamera does not honour tune-in attributes, therefore the
> <camera> node of the rc is simply ignored.
>
>
> Is there someone that can try to fire up a v4l device with libavg?
> byez
>
>
> --
> OXullo Intersecans
>
> 0 2 L > Outside Standing Level
> http://www.02L.net
>
>
>
>
> _______________________________________________
> libavg-devel mailing list
> libavg-devel at datenhain.de
> https://mail.datenhain.de/mailman/listinfo/libavg-devel
>
>
More information about the libavg-devel
mailing list