Is it possible for two processes to access the webcam at the same time?
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?
video webcam
add a comment |
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?
video webcam
add a comment |
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?
video webcam
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?
video webcam
video webcam
edited Aug 6 '14 at 16:38
RolandiXor
asked Jul 19 '12 at 21:46
RolandiXor♦RolandiXor
44.8k26140231
44.8k26140231
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
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).
You can use 2 webcams on 2 things though. (Cheese + Webcam Toy).
Hangouts (Not working) + Cheese (Working)
Hangouts (Working on it's own).
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)...
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.
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.
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 '14 at 19:07
@Mew That was my last attempt at getting it to work :)
– Tim
Aug 9 '14 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.
– Isiah Meadows
Aug 12 '14 at 6:38
1
@impinball nope, just found it an interesting question!
– Tim
Aug 12 '14 at 7:41
add a comment |
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!
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 basictee
utility that doesn't wait forstdin
to finish feeding it stuff. I wouldn't be surprised if this actually uses a binary equivalent totee
with more scalable support under the hood.
– Isiah Meadows
Aug 12 '14 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 '14 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 '14 at 8:20
1
This is now actually part of ubuntu - no need for git.
– nbubis
Nov 12 '18 at 14:06
add a comment |
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.
add a comment |
Based on @The Eye answer
I first installed gstreamer packages on Ubuntu 18.04
https://gstreamer.freedesktop.org/documentation/installing/on-linux.html
$ git clone https://github.com/umlaeute/v4l2loopback.git
$ cd v4l2loopback
$ make
$ sudo make install
I got warning message as here on Ubuntu 18.04 LTS https://github.com/umlaeute/v4l2loopback/issues/139 (but it didn't prevent me from loading v4l2loopback driver)
$ sudo depmod -a
I just have 1 webcam on my laptop /dev/video0 and I wanted to get 2 streams from the same hardware. Based on https://github.com/umlaeute/v4l2loopback/blob/master/README.md
$ modprobe v4l2loopback devices=2
There should now be /dev/video1
and /dev/video2
created assuming /dev/video0
was the only video device.
Now I run the following in one terminal window
gst-launch-1.0 v4l2src device=/dev/video0 ! tee name=t ! queue ! v4l2sink device=/dev/video1 t. ! queue ! v4l2sink device=/dev/video2
I open 2 more tabs
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video2 ! videoconvert ! ximagesink
Now one should see 2 video streams
UPDATE
Even if I use the same /dev/video1
device multiple times it all gives me that many stream. example.
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the third tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
gives me three streams.
BTW if one's webcam has audio then filter audio devices using the commandpactl list | grep -A2 'Source #'
then use that device in the following pipeline (can run multiple instances of pipeline too)gst-launch-1.0 pulsesrc device=alsa_input.<name of device> ! autoaudiosink
– enthusiasticgeek
Feb 7 at 22:09
add a comment |
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f165727%2fis-it-possible-for-two-processes-to-access-the-webcam-at-the-same-time%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
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).
You can use 2 webcams on 2 things though. (Cheese + Webcam Toy).
Hangouts (Not working) + Cheese (Working)
Hangouts (Working on it's own).
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)...
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.
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.
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 '14 at 19:07
@Mew That was my last attempt at getting it to work :)
– Tim
Aug 9 '14 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.
– Isiah Meadows
Aug 12 '14 at 6:38
1
@impinball nope, just found it an interesting question!
– Tim
Aug 12 '14 at 7:41
add a comment |
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).
You can use 2 webcams on 2 things though. (Cheese + Webcam Toy).
Hangouts (Not working) + Cheese (Working)
Hangouts (Working on it's own).
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)...
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.
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.
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 '14 at 19:07
@Mew That was my last attempt at getting it to work :)
– Tim
Aug 9 '14 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.
– Isiah Meadows
Aug 12 '14 at 6:38
1
@impinball nope, just found it an interesting question!
– Tim
Aug 12 '14 at 7:41
add a comment |
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).
You can use 2 webcams on 2 things though. (Cheese + Webcam Toy).
Hangouts (Not working) + Cheese (Working)
Hangouts (Working on it's own).
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)...
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.
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.
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).
You can use 2 webcams on 2 things though. (Cheese + Webcam Toy).
Hangouts (Not working) + Cheese (Working)
Hangouts (Working on it's own).
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)...
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.
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.
edited Aug 6 '14 at 18:46
answered Aug 6 '14 at 18:35
TimTim
20.1k1586141
20.1k1586141
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 '14 at 19:07
@Mew That was my last attempt at getting it to work :)
– Tim
Aug 9 '14 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.
– Isiah Meadows
Aug 12 '14 at 6:38
1
@impinball nope, just found it an interesting question!
– Tim
Aug 12 '14 at 7:41
add a comment |
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 '14 at 19:07
@Mew That was my last attempt at getting it to work :)
– Tim
Aug 9 '14 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.
– Isiah Meadows
Aug 12 '14 at 6:38
1
@impinball nope, just found it an interesting question!
– Tim
Aug 12 '14 at 7:41
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 '14 at 19:07
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 '14 at 19:07
@Mew That was my last attempt at getting it to work :)
– Tim
Aug 9 '14 at 18:25
@Mew That was my last attempt at getting it to work :)
– Tim
Aug 9 '14 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.
– Isiah Meadows
Aug 12 '14 at 6:38
@Tim The next answer is exactly what you're looking for if you came here because you need a way to do that.
– Isiah Meadows
Aug 12 '14 at 6:38
1
1
@impinball nope, just found it an interesting question!
– Tim
Aug 12 '14 at 7:41
@impinball nope, just found it an interesting question!
– Tim
Aug 12 '14 at 7:41
add a comment |
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!
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 basictee
utility that doesn't wait forstdin
to finish feeding it stuff. I wouldn't be surprised if this actually uses a binary equivalent totee
with more scalable support under the hood.
– Isiah Meadows
Aug 12 '14 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 '14 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 '14 at 8:20
1
This is now actually part of ubuntu - no need for git.
– nbubis
Nov 12 '18 at 14:06
add a comment |
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!
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 basictee
utility that doesn't wait forstdin
to finish feeding it stuff. I wouldn't be surprised if this actually uses a binary equivalent totee
with more scalable support under the hood.
– Isiah Meadows
Aug 12 '14 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 '14 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 '14 at 8:20
1
This is now actually part of ubuntu - no need for git.
– nbubis
Nov 12 '18 at 14:06
add a comment |
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!
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!
edited Aug 12 '14 at 4:55
answered Aug 11 '14 at 8:29
The EyeThe Eye
33127
33127
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 basictee
utility that doesn't wait forstdin
to finish feeding it stuff. I wouldn't be surprised if this actually uses a binary equivalent totee
with more scalable support under the hood.
– Isiah Meadows
Aug 12 '14 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 '14 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 '14 at 8:20
1
This is now actually part of ubuntu - no need for git.
– nbubis
Nov 12 '18 at 14:06
add a comment |
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 basictee
utility that doesn't wait forstdin
to finish feeding it stuff. I wouldn't be surprised if this actually uses a binary equivalent totee
with more scalable support under the hood.
– Isiah Meadows
Aug 12 '14 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 '14 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 '14 at 8:20
1
This is now actually part of ubuntu - no need for git.
– nbubis
Nov 12 '18 at 14:06
1
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.– Isiah Meadows
Aug 12 '14 at 6:30
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.– Isiah Meadows
Aug 12 '14 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 '14 at 7:46
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 '14 at 7:46
2
2
I'll have to check this out when my other system gets back. I'll probably give an additional bounty.
– RolandiXor♦
Aug 12 '14 at 8:20
I'll have to check this out when my other system gets back. I'll probably give an additional bounty.
– RolandiXor♦
Aug 12 '14 at 8:20
1
1
This is now actually part of ubuntu - no need for git.
– nbubis
Nov 12 '18 at 14:06
This is now actually part of ubuntu - no need for git.
– nbubis
Nov 12 '18 at 14:06
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited Aug 6 '14 at 18:59
Tim
20.1k1586141
20.1k1586141
answered Aug 6 '14 at 18:58
AkivaAkiva
4,7721446100
4,7721446100
add a comment |
add a comment |
Based on @The Eye answer
I first installed gstreamer packages on Ubuntu 18.04
https://gstreamer.freedesktop.org/documentation/installing/on-linux.html
$ git clone https://github.com/umlaeute/v4l2loopback.git
$ cd v4l2loopback
$ make
$ sudo make install
I got warning message as here on Ubuntu 18.04 LTS https://github.com/umlaeute/v4l2loopback/issues/139 (but it didn't prevent me from loading v4l2loopback driver)
$ sudo depmod -a
I just have 1 webcam on my laptop /dev/video0 and I wanted to get 2 streams from the same hardware. Based on https://github.com/umlaeute/v4l2loopback/blob/master/README.md
$ modprobe v4l2loopback devices=2
There should now be /dev/video1
and /dev/video2
created assuming /dev/video0
was the only video device.
Now I run the following in one terminal window
gst-launch-1.0 v4l2src device=/dev/video0 ! tee name=t ! queue ! v4l2sink device=/dev/video1 t. ! queue ! v4l2sink device=/dev/video2
I open 2 more tabs
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video2 ! videoconvert ! ximagesink
Now one should see 2 video streams
UPDATE
Even if I use the same /dev/video1
device multiple times it all gives me that many stream. example.
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the third tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
gives me three streams.
BTW if one's webcam has audio then filter audio devices using the commandpactl list | grep -A2 'Source #'
then use that device in the following pipeline (can run multiple instances of pipeline too)gst-launch-1.0 pulsesrc device=alsa_input.<name of device> ! autoaudiosink
– enthusiasticgeek
Feb 7 at 22:09
add a comment |
Based on @The Eye answer
I first installed gstreamer packages on Ubuntu 18.04
https://gstreamer.freedesktop.org/documentation/installing/on-linux.html
$ git clone https://github.com/umlaeute/v4l2loopback.git
$ cd v4l2loopback
$ make
$ sudo make install
I got warning message as here on Ubuntu 18.04 LTS https://github.com/umlaeute/v4l2loopback/issues/139 (but it didn't prevent me from loading v4l2loopback driver)
$ sudo depmod -a
I just have 1 webcam on my laptop /dev/video0 and I wanted to get 2 streams from the same hardware. Based on https://github.com/umlaeute/v4l2loopback/blob/master/README.md
$ modprobe v4l2loopback devices=2
There should now be /dev/video1
and /dev/video2
created assuming /dev/video0
was the only video device.
Now I run the following in one terminal window
gst-launch-1.0 v4l2src device=/dev/video0 ! tee name=t ! queue ! v4l2sink device=/dev/video1 t. ! queue ! v4l2sink device=/dev/video2
I open 2 more tabs
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video2 ! videoconvert ! ximagesink
Now one should see 2 video streams
UPDATE
Even if I use the same /dev/video1
device multiple times it all gives me that many stream. example.
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the third tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
gives me three streams.
BTW if one's webcam has audio then filter audio devices using the commandpactl list | grep -A2 'Source #'
then use that device in the following pipeline (can run multiple instances of pipeline too)gst-launch-1.0 pulsesrc device=alsa_input.<name of device> ! autoaudiosink
– enthusiasticgeek
Feb 7 at 22:09
add a comment |
Based on @The Eye answer
I first installed gstreamer packages on Ubuntu 18.04
https://gstreamer.freedesktop.org/documentation/installing/on-linux.html
$ git clone https://github.com/umlaeute/v4l2loopback.git
$ cd v4l2loopback
$ make
$ sudo make install
I got warning message as here on Ubuntu 18.04 LTS https://github.com/umlaeute/v4l2loopback/issues/139 (but it didn't prevent me from loading v4l2loopback driver)
$ sudo depmod -a
I just have 1 webcam on my laptop /dev/video0 and I wanted to get 2 streams from the same hardware. Based on https://github.com/umlaeute/v4l2loopback/blob/master/README.md
$ modprobe v4l2loopback devices=2
There should now be /dev/video1
and /dev/video2
created assuming /dev/video0
was the only video device.
Now I run the following in one terminal window
gst-launch-1.0 v4l2src device=/dev/video0 ! tee name=t ! queue ! v4l2sink device=/dev/video1 t. ! queue ! v4l2sink device=/dev/video2
I open 2 more tabs
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video2 ! videoconvert ! ximagesink
Now one should see 2 video streams
UPDATE
Even if I use the same /dev/video1
device multiple times it all gives me that many stream. example.
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the third tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
gives me three streams.
Based on @The Eye answer
I first installed gstreamer packages on Ubuntu 18.04
https://gstreamer.freedesktop.org/documentation/installing/on-linux.html
$ git clone https://github.com/umlaeute/v4l2loopback.git
$ cd v4l2loopback
$ make
$ sudo make install
I got warning message as here on Ubuntu 18.04 LTS https://github.com/umlaeute/v4l2loopback/issues/139 (but it didn't prevent me from loading v4l2loopback driver)
$ sudo depmod -a
I just have 1 webcam on my laptop /dev/video0 and I wanted to get 2 streams from the same hardware. Based on https://github.com/umlaeute/v4l2loopback/blob/master/README.md
$ modprobe v4l2loopback devices=2
There should now be /dev/video1
and /dev/video2
created assuming /dev/video0
was the only video device.
Now I run the following in one terminal window
gst-launch-1.0 v4l2src device=/dev/video0 ! tee name=t ! queue ! v4l2sink device=/dev/video1 t. ! queue ! v4l2sink device=/dev/video2
I open 2 more tabs
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video2 ! videoconvert ! ximagesink
Now one should see 2 video streams
UPDATE
Even if I use the same /dev/video1
device multiple times it all gives me that many stream. example.
In the first tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the second tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
In the third tab
gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! ximagesink
gives me three streams.
edited Feb 7 at 22:25
answered Feb 7 at 17:42
enthusiasticgeekenthusiasticgeek
1116
1116
BTW if one's webcam has audio then filter audio devices using the commandpactl list | grep -A2 'Source #'
then use that device in the following pipeline (can run multiple instances of pipeline too)gst-launch-1.0 pulsesrc device=alsa_input.<name of device> ! autoaudiosink
– enthusiasticgeek
Feb 7 at 22:09
add a comment |
BTW if one's webcam has audio then filter audio devices using the commandpactl list | grep -A2 'Source #'
then use that device in the following pipeline (can run multiple instances of pipeline too)gst-launch-1.0 pulsesrc device=alsa_input.<name of device> ! autoaudiosink
– enthusiasticgeek
Feb 7 at 22:09
BTW if one's webcam has audio then filter audio devices using the command
pactl list | grep -A2 'Source #'
then use that device in the following pipeline (can run multiple instances of pipeline too) gst-launch-1.0 pulsesrc device=alsa_input.<name of device> ! autoaudiosink
– enthusiasticgeek
Feb 7 at 22:09
BTW if one's webcam has audio then filter audio devices using the command
pactl list | grep -A2 'Source #'
then use that device in the following pipeline (can run multiple instances of pipeline too) gst-launch-1.0 pulsesrc device=alsa_input.<name of device> ! autoaudiosink
– enthusiasticgeek
Feb 7 at 22:09
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f165727%2fis-it-possible-for-two-processes-to-access-the-webcam-at-the-same-time%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown