views:

53

answers:

2

How can I capture a frame from a video-4-linux device (e.g.: /dev/video0) using Mono and C#? OS is Angstrom Linux running on BeagleBoard.

A: 

I am not familiar with Mono or C# on linux, but you may have to write an interface module that exposes the diver API, or a reasonable abstraction. I think you then might be able to import the module in the C# code. It looks like Mono does support the DLLImport.

(http://www.mono-project.com/Interop_with_Native_Libraries)

simon
+2  A: 

I have done v4l2 capture using C. This is probably the only language I would chose to do it in as well. There are a lot of low level calls you need to make into the driver. You need to map kernel memory into your app and copy buffers. You also have to set a ton of configuration for the device. If you need to I would consider writing a C library and using Platform Invoke. Another alternative is to write two programs and send the data over to your C# app via some sort of IPC.

Nate
+1 write a low-level library on C and high-level app on C#
abatishchev