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.
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.
You can use Emgu CV for this, it specifically advertises that it can be compiled using Mono.
Main Site: http://www.emgu.com/wiki/index.php/Main_Page
Compiling in Mono: http://www.emgu.com/wiki/index.php/Compiling_with_Monodevelop
Sample Code for Capturing Webcam Video: http://www.emgu.com/wiki/index.php/Camera_Capture_in_7_lines_of_code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With