10

I have written an application which reads from a webcam and processes the frames using OpenCV on linux.

Now I want to pipe the output of my application to a virtual webcam that has been created by the V4L2loopback module so other applications are able to read it.

I have written the application using C.

How do I approach doing this?

Russia Must Remove Putin
  • 374,368
  • 89
  • 403
  • 331
user477519
  • 341
  • 1
  • 3
  • 11
  • There's nothing about OpenCV specifically here. Any app like [this](http://www.senstic.com/iphone/aircam/aircam.aspx) (never used, googled it) can gel well with OpenCV. – UltraInstinct Jun 17 '12 at 12:30
  • Sorry what did you mean by the app you liked to can 'gel' with opencv? My question is how to use V4L2Loopback module to create a virtual webacam and write frames to it using my application so other applications can use the virtual video device to view the frames that I have written to it. Thanks – user477519 Jun 24 '12 at 13:20

1 Answers1

7

I have found an answer in the old V4L2loopback module's page on Google code.

http://code.google.com/p/v4l2loopback/source/browse/test.c

newer link: https://github.com/umlaeute/v4l2loopback/blob/master/examples/test.c

This has helped me so far just to write to the device.

Victor Sergienko
  • 13,115
  • 3
  • 57
  • 91
user477519
  • 341
  • 1
  • 3
  • 11
  • 1
    btw, v4l2loopback is now developed at [github](https://github.com/umlaeute/v4l2loopback) and no longer at googlecode. – umläute Jul 23 '12 at 17:55
  • @user447519 could you provide a little code snippet? Unfortunately I was not able to make it work with the links above. My output on VLC remains black. Please see my post for this issue: https://stackoverflow.com/questions/44508743/unable-to-route-webcam-video-to-virtual-video-device-on-linux-via-opencv – Bernd Jun 13 '17 at 12:20
  • This amounts to a link-only answer. If the author doesn't fix within a reasonable time-frame, someone else please add a new answer and flag this one for deletion. – Russia Must Remove Putin Oct 09 '22 at 09:16