# How can I get video capture from a virtual webcam?

**URL:** https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650
**Category:** Libraries
**Created:** [July 10, 2018, 8:46am UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650 "2018-07-10T08:46:03Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Birb](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/birb/32/3280_2.png) [@Birb](https://discourse.processing.org/u/Birb)
#### Post date: [July 10, 2018, 8:46am UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/1 "2018-07-10T08:46:03Z")

</div>

I want to use the processing video library (or another library) to receive a video stream of my OBS virtualcam. However printArray(Capture.list()); only returns the physical webcam, and not the video stream I need created by OBS (open broadcasting software). I tried looking at ipcapture, but it wants an ip address for the mpeg stream.

---

<div class="post-metadata">

### Author: ![yoga47](https://avatars.discourse-cdn.com/v4/letter/y/e47774/32.png) [@yoga47](https://discourse.processing.org/u/yoga47)
#### Post date: [August 25, 2021, 3:49pm UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/2 "2021-08-25T15:49:57Z")

</div>

DID you solved it ?  
HELP

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [August 25, 2021, 5:46pm UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/3 "2021-08-25T17:46:00Z")

</div>

im certainly no expert on this, but does this not cover the requirements?

> **[Exploring The Powerful OBS Virtual Camera Feature](https://streamershaven.blog/software/obs-tutorials/obs-virtual-camera/)**
>
> Looking for details on the OBS Virtual Camera feature? In this article, I answer several questions related to this.

it suggests using obs studio which seemingly provides video capture.

---

<div class="post-metadata">

### Author: ![tobolon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tobolon/32/15882_2.png) [@tobolon](https://discourse.processing.org/u/tobolon)
#### Post date: [March 18, 2022, 8:16am UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/4 "2022-03-18T08:16:21Z")

</div>

was this ever solved? i have the same problem, cant get the obs virtual camera as video input into processing. it is not recognized as camera (or anything else) although other programs (zoom, chrome, etc.) do recognize it as if it were a piece of connected hardware.

---

<div class="post-metadata">

### Author: ![AtrashDingDong](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@AtrashDingDong](https://discourse.processing.org/u/AtrashDingDong)
#### Post date: [May 20, 2024, 4:40pm UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/6 "2024-05-20T16:40:14Z")

</div>

Did anybody ever solve it? OBS virtual camera shows as a normal webcam in other softwares (Discord) but not Processing.

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [May 22, 2024, 1:03am UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/7 "2024-05-22T01:03:43Z")

</div>

Hello @AtrashDingDong,

It works here with:

Processing 4.3  
_[https://processing.org/](https://processing.org/)_

GStreamer 1.24.3 \< I could see the virtual cams in the **[Capture.list()](https://processing.org/reference/libraries/video/Capture.html)** once I installed this!  
_[https://gstreamer.freedesktop.org/](https://gstreamer.freedesktop.org/)_

OBS Studio 30.1.2 (64 bit) \< Comes with a virtual camera!  
_[https://obsproject.com/](https://obsproject.com/)_

OBS VirtualCam 2.0.5 \< This is NOT needed! Here for reference only.  
_[OBS Virtualcam | OBS Forums](https://obsproject.com/forum/resources/obs-virtualcam.949/)_

NOTE: There is a note on the link above that recommends another solution which also worked:  
_[Virtual Cam Filter | OBS Forums](https://obsproject.com/forum/resources/virtual-cam-filter.1142/)_

`:)`

---

<div class="post-metadata">

### Author: ![niuuin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/niuuin/32/7517_2.png) [@niuuin](https://discourse.processing.org/u/niuuin)
#### Post date: [December 24, 2024, 6:53pm UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/9 "2024-12-24T18:53:37Z")

</div>

Hello @glv , I followed your instructions to set it up, but I still cannot read the OBS virtual cam.

On both Win11 and Mac OS, I get the message `BaseSrc: [mfvideosrc0] : Internal data stream error. `

Is there anything else I need to pay attention to?

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [December 28, 2024, 11:32pm UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/10 "2024-12-28T23:32:44Z")

</div>

Hello @niuuin,

> [@niuuin](#):
>
> Is there anything else I need to pay attention to?

I did a fresh install of OBS Studio and the steps below worked for me.

I am using:

- W10
- Processing 4.3.1
- OBS Studio 31.0.0(64 bit)
- GStreamer 1.24.10

No other plugins required!

Steps using OBS Studio:

- Stop the Virtual Camera
- Open _ **Tools \> Auto-Configuration Wizard** _
- Select _ **I will only be using the virtual camera** _
- Start the Virtual Camera

It only works if you install GStreamer.

You must select the correct camera:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/8/c/8cd1fbd51d280e710d07955b2bed2c393b6ffd18.png)

`:)`

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [January 4, 2025, 7:34pm UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/11 "2025-01-04T19:34:43Z")

</div>

Hello folks!

Can someone please test this on their system(s):

> [@How can I get video capture from a virtual webcam?](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/10):
>
> Hello @niuuin, I did a fresh install of OBS Studio and the steps below worked for me. I am using: W10 Processing 4.3.1 OBS Studio 31.0.0(64 bit) GStreamer 1.24.10 No other plugins required! Steps using OBS Studio: Stop the Virtual Camera Open Tools \> Auto-Configuration Wizard Select I will only be using the virtual camera Start the Virtual Camera It only works if you install GStreamer. You must select the correct camera: slight_smile

Processing code (modified one of examples):

```auto
/**
 * CustomPipeline 
 * by Andres Colubri. 
 * 
 * Create a Capture object with a pipeline description to 
 * get video from non-standard sources.
 */

// This was modified below by GLV:

import processing.video.*;

Capture cam;

void setup() {
  size(640, 480);
  
  String[] cameras = Capture.list();
  
  if (cameras.length == 0) 
    {
    println("There are no cameras available for capture.");
    exit();
    } 
  else 
    {
    println("Available cameras:");
    printArray(cameras);
    
    // The camera can be initialized directly using an 
    // element from the array returned by list():
    cam = new Capture(this, cameras[7]);   
    cam.start(); 
    }      
  }

void draw() 
  {
  if (cam.available() == true) 
    {
    cam.read();
    }
  image(cam, 0, 0, width, height);
  }

```

Please provide a detailed list of your hardware and software.

I am using:

- W10
- Processing 4.3.1
- OBS Studio 31.0.0(64 bit)
- GStreamer 1.24.10

I also opened an issue here:

> <https://github.com/processing/processing-video/issues/227>
>
> Hello,
> 
> The current GStreamer that comes with video library was not detecting …OBS virtual cams.
> 
> I updated to the current GSTreamer and was able to detect OBS virtual cams.
> 
> Details here:
> 
> \[https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/7\](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/7)

It works here for me:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/5/8/5894a50c51f21162f6e2461a77bc98fda92b7533.png)

Thanks!

`:)`

---

<div class="post-metadata">

### Author: ![edmorais](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/edmorais/32/20780_2.png) [@edmorais](https://discourse.processing.org/u/edmorais)
#### Post date: [June 11, 2025, 5:41pm UTC](https://discourse.processing.org/t/how-can-i-get-video-capture-from-a-virtual-webcam/1650/12 "2025-06-11T17:41:44Z")

</div>

I had the same problem where Capture.list() showed the OBS virtual camera (and only after manually installing GStreamer) but nevertheless got the error `BaseSrc: [mfvideosrc0] : Internal data stream error.` whenever I tried to use it.

I ended up realizing that the virtual camera was set at too high resolution/fps in OBS Studio (1920x1080@60p). Once I tried to scale it to 1280x720p in the OBS Studio preferences it worked fine in Processing. Perhaps this is an available RAM issue, I didn’t test further.
