Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to try using Cheese in Google+ Hangouts, and similar configurations, and I would like to know if it is possible for the webcam to be used by two processes to have access to the webcam at the same time. I have not tried it as yet, but before I do, I figured I would ask.

So, is it possible?

share|improve this question

3 Answers 3

up vote 4 down vote accepted
+100

Well I just tried. Interesting results.

I have got skype and cheese and webcam toy and hangouts (which all do work) and tried them together.

Results:

You can't use the same webcam on 2 things at once.

Cheese (Working) + Webcam Toy (Not working) + Skype (Small, top right. Not working).

enter image description here

You can use 2 webcams on 2 things though. (Cheese + Webcam Toy).

enter image description here

Hangouts (Not working) + Cheese (Working)

enter image description here

Hangouts (Working on it's own).

enter image description here

Cheese broken when I opened Hangouts first. It did the same with the others, but my internet is too slow to upload every single screenshot (and I doubt you'd appreciate 30+ screenshots)...

enter image description here

I even tried making a symbolic link to /dev/video0 and saving it in /dev as video2. That didn't work.

I also can't run 2 cheese processes at once.

A picture of my garden, to cheer you up, as the answer is no. It is very cool at the moment: I can swing (on the swing) and jump off and land in the paddling pool. Taken with cheese.

enter image description here

If you had to, I would advise making it full screen and doing 2 screen recordings. I doubt that would work for what you want though.

share|improve this answer
    
Thanks! This is concise and tells me what I need to know. Nice garden btw! The bounty will be awarded when the timeout expires (21 hrs to go). Then I will delete this comment. –  RolandiXor Aug 6 at 19:07
2  
+1 for garden picture, and +0 for stealing my symlink idea –  Whaaaaaat Aug 9 at 18:23
    
@Mew That was my last attempt at getting it to work :) –  Tim Aug 9 at 18:25
    
@Tim The next answer is exactly what you're looking for if you came here because you need a way to do that. –  impinball Aug 12 at 6:38
1  
@impinball nope, just found it an interesting question! –  Tim Aug 12 at 7:41

Happily, now, YES!

There is currently a project on GitHub that can show not only two, but an infinite (limited only by system capacity) number of video devices from a single source.

The project is called v4l2loopback. (Check the link and scroll down to view the README for instructions.)

You can install v4l2loopback by cloning its GitHub and running these commands:

$ git clone https://github.com/umlaeute/v4l2loopback.git
$ cd v4l2loopback
$ make
$ sudo make install

Examples

For samples on how to use it with GStreamer, FFmpeg, MPlayer, and Skype, check their small wiki. Hopefully you could find the right settings to fit your needs.

Enjoy tweaking around!

share|improve this answer
1  
Virtual devices is one of the areas where Linux (and *nix, for that matter) shines. It is more complicated on Windows to even write a basic tee utility that doesn't wait for stdin to finish feeding it stuff. I wouldn't be surprised if this actually uses a binary equivalent to tee with more scalable support under the hood. –  impinball Aug 12 at 6:30
    
Whilst this does answer the question, it would be preferable to include parts of the link here, and provide the link for reference, so that we have some examples - e.g. make 2 devices from 1. What are the options for that? And is it possible (as said in the OP's requirements) to use with Google hangouts? I also just tested it with Skype and it doesn't seem to work. We are now version 4.3 not 4.0... –  Tim Aug 12 at 7:46
2  
I'll have to check this out when my other system gets back. I'll probably give an additional bounty. –  RolandiXor Aug 12 at 8:20

The answer is no with a maybe... The Library, "Video 4 Linux" detects whether a device is being used, and will not initiate. However; if you wish to download libv4l-dev and edit it manually, you can edit the code to get rid of this check and then just recompile it. I imagine you could get this to work, but it would be extremely unstable. May be worth checking out though.

TLDR: Anything is possible if you are a programmer with some elbow grease handy. Don't want to go that far? Then no; its not possible.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.