Jump to content

Linux command line capture program


JamesF

Recommended Posts

Over the last week or so I've been learning my way around the Linux video driver interface (V4L2) with a view to writing a capture program that will run on a headless Linux device for the purpose of running an all-sky camera and an analemma camera.

I now have something that pretty much works for me using an Xbox camera, although I've had to patch the kernel UVC video driver to make it work. I cannot at the moment get it to work with the SPC900 cameras because the PWC driver interface in the v3.0 and earlier kernels is something of a mess as regards its implementation of the current V4L2 interface. It looks like someone has been working on this for the v3.2/v3.3 kernels so there may be hope there. I've not tried those yet. I have had it working with a couple of other cameras that I happened to have lying about (as you do, you know :)

Hopefully before the weekend I should have a Lifecam Cinema arriving and I'll give it a try with that and if I can find a Lifecam Studio at a reasonable price I'll give it a whirl as well.

At the moment the program only captures data as one ppm file per frame, but those are easily converted to, say, jpeg files.

Where the camera driver supports it, the program allows me to specify the gain, exposure, gamma, saturation, while balance, frame interval (ie. 1/10, 1/20 etc.) and frame resolution. It also allows for a specified number of frames to be captured with a given interval between each and allows a number of frames to be discarded at the start because some cameras can be a bit slow getting their act together. It's also possible to specify the directory the captured frames are stored in and the root of the filename used.

Anyhow, whilst the code is somewhat monolithic and straggly, I should be able to put together something that other people can play with on an alpha test basis. You'd need to be able to compile it yourself, and make the UVC kernel patches if you want to use it for an Xbox camera and I have some information on how to do that on Ubuntu and Ubuntu-like systems. It's possible that it may not work for you at all, in which case it would be useful to know what goes wrong so I can look into fixing it.

If you're interested, please post here and I'll sort something out as soon as I've tidied a few bits up. If others find it useful then in the longer run I'll look into making life a bit easier and package up a binary, but I'm nowhere near that yet.

James

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.