Skip to contentSkip to conversation

Replacement for vloopback?

DISCUSSION Neuer User 3 participants 6 messages Feb 6, 2013 Media (V4L/DVB)

lore
Share & tools
lore

Neuer User

author
#0 lore raw

Hello

I need to have access to my webcam from two applications (one is "motion", the other a video sip phone).

I have googled a lot, but only found vloopback as a method to access a video device from two applications. However, vloopback seems to rely on V4L1 which is mostly no longer compiled into the kernel by most distros. Additionally, it does not seem to compile against newer kernels.

So, my question ist: Is vloopback the right way to go for this requirement? If yes, how to get it working?

If not, what can I use to have two apps accessing the video stream from the webcam?

Thanks a lot for any help

Michael

#1 lore raw
Quoted 3 lines · Neuer User

So, my question ist: Is vloopback the right way to go for this

requirement? If yes, how to get it working?

No. Video loopback is just a way for an application to expose a virtual

camera, for another application to use. It is not a way to share a camera

within two applications.

Sharing a camera is fundamentally impossible due to the limitation of the

hardware, which cannot capture in two different formats and sets of buffers

simultaneously. Live with it.

Signature · 3 lines
Rémi Denis-Courmont

Sent from my collocated server
author
#2 lore raw
In reply to Neuer User

Thanks for answering.

The vloopback description seems to imply that it is possible to share a camera stream:

"How to use multiple webcam applications with vloopback

[...]
Do "modprobe vloopback pipes=2". Then "resize /dev/video0 /dev/video1 640x480 640x480 & resize /dev/video2 /dev/video3 640x480 320x240". (Assuming that you have only one real video device at /dev/video0. You can check with dmesg).

Now, you can watch your webcam with camstream at 640x480 (choose the device called vloopback0 output in camstream's menu, which is /dev/video2), at the sime time you can record a video of your webcam stream at 320x240 by doing "ffmpeg -vd /dev/video4 -s 320x240 picture.mpeg", you can at the same time run a webcam http server by running "camsource" (after editting camsource.conf to choose /dev/video2 or /dev/video4 as v4l_input source)."

If it is not possible to have two applications access the same video stream, that is pretty detrimentical to quite a lot of use cases, e.g.:

a.) Use motion to detect motion and record video. At the same time view the camera output on the screen.

b.) Stream a webcam output over the net and at the same time view it on the screen.

Actually, for me it would be no problem, if the stream needs to be the same format etc.

So, really no way? :-(

Thanks

Michael

Quoted 13 lines · Neuer User
Quoted 2 lines

So, my question ist: Is vloopback the right way to go for this requirement? If yes, how to get it working?

No. Video loopback is just a way for an application to expose a virtual camera, for another application to use. It is not a way to share a camera within two applications.

Sharing a camera is fundamentally impossible due to the limitation of the hardware, which cannot capture in two different formats and sets of buffers simultaneously. Live with it.

-- Rémi Denis-Courmont Sent from my collocated server

#3 lore raw
Quoted 8 lines · Neuer User

If it is not possible to have two applications access the same video stream, that is pretty detrimentical to quite a lot of use cases, e.g.:

a.) Use motion to detect motion and record video. At the same time view the camera output on the screen.

b.) Stream a webcam output over the net and at the same time view it on the screen.

FWIW: usually when people ask for this sort of functionality (performing multiple functions on the same stream), they will typically use frameworks like gstreamer, which allow for creation of pipelines to perform the sorts of use cases you have described.

Devin

Signature · 2 lines
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
author
#4 lore raw

Well, I have a (what I think) pretty simple use case here, but without any gstreamer involved:

I have a software video sip phone (based on pjsip). I would like to automatically initiate a video call when there is a certain amount of motion detected.

Both software packages access a v4l device. I have no idea how to change that to a gstreamer pipe. Ma guess is that it will probably be very difficult :-(

Michael

Am 06.02.2013 15:51, schrieb Devin Heitmueller:

Quoted 17 lines · Neuer User
Quoted 8 lines

If it is not possible to have two applications access the same video stream, that is pretty detrimentical to quite a lot of use cases, e.g.:

a.) Use motion to detect motion and record video. At the same time view the camera output on the screen.

b.) Stream a webcam output over the net and at the same time view it on the screen.

FWIW: usually when people ask for this sort of functionality (performing multiple functions on the same stream), they will typically use frameworks like gstreamer, which allow for creation of pipelines to perform the sorts of use cases you have described.

Devin

author
#5 lore raw
In reply to Neuer User

Thanks everybody so far.

I just found v4l2loopback and also some examples with gestreamer.

I will do some testing and see if I can get my use case done with that.

Kind regards

Michael

Am 06.02.2013 14:57, schrieb Neuer User:

Quoted 20 lines

Hello

I need to have access to my webcam from two applications (one is "motion", the other a video sip phone).

I have googled a lot, but only found vloopback as a method to access a video device from two applications. However, vloopback seems to rely on V4L1 which is mostly no longer compiled into the kernel by most distros. Additionally, it does not seem to compile against newer kernels.

So, my question ist: Is vloopback the right way to go for this requirement? If yes, how to get it working?

If not, what can I use to have two apps accessing the video stream from the webcam?

Thanks a lot for any help

Michael