# Capture.list() showing duplicate cameras

**URL:** <https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153>\
**Category:** Libraries\
**Created:** [September 16, 2025, 3:05pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153 "2025-09-16T15:05:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielcorbani](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@danielcorbani](https://discourse.processing.org/u/danielcorbani)\
**Post date:** [September 16, 2025, 3:05pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/1 "2025-09-16T15:05:16Z")

</div>

Hi everyone!

I wonder if anyone could help me understand this issue with hte Video Library in Processing. When I want to select a camera to be used, I call Capture.list() to see all connected cameras, but sometimes it gives duplicate results. For example, I have only two cameras connected, one is the laptop built-in HD User Facing, and the other is a regular USB CAMERA. But printing the content of Capture.list() gives:

0: USB CAMERA #1  
1: HD User Facing #1  
2: USB CAMERA #2  
3: HD User Facing #2

Is it supposed to happen? How should I deal with that? Just consider the last two?

---

<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:** [September 16, 2025, 4:36pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/2 "2025-09-16T16:36:21Z")

</div>

Hello @danielcorbani,

> [@danielcorbani](#):
>
> Is it supposed to happen? How should I deal with that? Just consider the last two?

I have always seen this.  
Consider the first one or the duplicate… it makes no difference here for me.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/a/d/adcb8533ff4ea7cf97cb028879cce949f0489f4f.png)

`:)`

---

<div class="post-metadata">

**Author:** ![moon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/moon/32/21773_2.png) [@moon](https://discourse.processing.org/u/moon)\
**Post date:** [September 16, 2025, 5:24pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/3 "2025-09-16T17:24:56Z")

</div>

Hi @danielcorbani,

Thanks for pointing this out. I think this might have something to do with this issue here:

> <https://github.com/processing/processing-video/issues/179>
>
> Capture.list() with video library 2.0 does not enumerate all camera configuratio…ns of each camera, just the unique camera names. That means that it is not possible to search for a specific configuration and then initialize the camera using the constructor Capture(parent, requestConfig). That was possible with the Video 1.0.1 library list() method and is still described in the video tutorial (https://www.processing.org/tutorials/video/)). I have reverted to the previous version for now, but is this going to be the behavior from now on?

I’m not 100% certain and need to dig into it. But the duplicate entries are likely a result of the `processing-video` implementation not showing all of the configuration options for a particular device. It’s reducing it down to just the device name.

I’m learning the ins and outs of the processing code base, including the libraries. Hope I can make time to address this soon, but certainly could use help if someone is interested in exploring a solution. And if that someone is nervous, I would be more than happy to talk them through it 🙂

Thank you!

Moon

---

<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:** [September 16, 2025, 6:05pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/4 "2025-09-16T18:05:00Z")

</div>

> [@moon](#):
>
> But the duplicate entries are likely a result of the `processing-video` implementation not showing all of the configuration options for a particular device. It’s reducing it down to just the device name.

I sometimes pop into Processing 2.2.1 for details about my cam (185 choices):

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

> **Camera List \< Click to expand!**
>
> ```auto
> [0] "name=Logitech QuickCam Pro 9000,size=640x480,fps=5"
> [1] "name=Logitech QuickCam Pro 9000,size=640x480,fps=30"
> [2] "name=Logitech QuickCam Pro 9000,size=160x90,fps=5"
> [3] "name=Logitech QuickCam Pro 9000,size=160x90,fps=30"
> [4] "name=Logitech QuickCam Pro 9000,size=160x100,fps=5"
> [5] "name=Logitech QuickCam Pro 9000,size=160x100,fps=30"
> [6] "name=Logitech QuickCam Pro 9000,size=160x120,fps=5"
> [7] "name=Logitech QuickCam Pro 9000,size=160x120,fps=30"
> [8] "name=Logitech QuickCam Pro 9000,size=176x144,fps=5"
> [9] "name=Logitech QuickCam Pro 9000,size=176x144,fps=30"
> [10] "name=Logitech QuickCam Pro 9000,size=320x180,fps=5"
> [11] "name=Logitech QuickCam Pro 9000,size=320x180,fps=30"
> [12] "name=Logitech QuickCam Pro 9000,size=320x200,fps=5"
> [13] "name=Logitech QuickCam Pro 9000,size=320x200,fps=30"
> [14] "name=Logitech QuickCam Pro 9000,size=320x240,fps=5"
> [15] "name=Logitech QuickCam Pro 9000,size=320x240,fps=30"
> [16] "name=Logitech QuickCam Pro 9000,size=352x288,fps=5"
> [17] "name=Logitech QuickCam Pro 9000,size=352x288,fps=30"
> [18] "name=Logitech QuickCam Pro 9000,size=640x360,fps=5"
> [19] "name=Logitech QuickCam Pro 9000,size=640x360,fps=30"
> [20] "name=Logitech QuickCam Pro 9000,size=640x400,fps=5"
> [21] "name=Logitech QuickCam Pro 9000,size=640x400,fps=30"
> [22] "name=Logitech QuickCam Pro 9000,size=864x480,fps=5"
> [23] "name=Logitech QuickCam Pro 9000,size=864x480,fps=15"
> [24] "name=Logitech QuickCam Pro 9000,size=768x480,fps=5"
> [25] "name=Logitech QuickCam Pro 9000,size=768x480,fps=15"
> [26] "name=Logitech QuickCam Pro 9000,size=800x450,fps=5"
> [27] "name=Logitech QuickCam Pro 9000,size=800x450,fps=15"
> [28] "name=Logitech QuickCam Pro 9000,size=800x500,fps=5"
> [29] "name=Logitech QuickCam Pro 9000,size=800x500,fps=15"
> [30] "name=Logitech QuickCam Pro 9000,size=800x600,fps=5"
> [31] "name=Logitech QuickCam Pro 9000,size=800x600,fps=15"
> [32] "name=Logitech QuickCam Pro 9000,size=960x720,fps=5"
> [33] "name=Logitech QuickCam Pro 9000,size=960x720,fps=15"
> [34] "name=Logitech QuickCam Pro 9000,size=1280x720,fps=5"
> [35] "name=Logitech QuickCam Pro 9000,size=1280x800,fps=5"
> [36] "name=Logitech QuickCam Pro 9000,size=1280x1024,fps=5"
> [37] "name=Logitech QuickCam Pro 9000,size=1600x900,fps=5"
> [38] "name=Logitech QuickCam Pro 9000,size=1600x1000,fps=5"
> [39] "name=Logitech QuickCam Pro 9000,size=1600x1200,fps=5"
> [40] "name=Logitech QuickCam Pro 9000,size=640x480,fps=5"
> [41] "name=Logitech QuickCam Pro 9000,size=640x480,fps=30"
> [42] "name=Logitech QuickCam Pro 9000,size=160x90,fps=5"
> [43] "name=Logitech QuickCam Pro 9000,size=160x90,fps=30"
> [44] "name=Logitech QuickCam Pro 9000,size=160x100,fps=5"
> [45] "name=Logitech QuickCam Pro 9000,size=160x100,fps=30"
> [46] "name=Logitech QuickCam Pro 9000,size=160x120,fps=5"
> [47] "name=Logitech QuickCam Pro 9000,size=160x120,fps=30"
> [48] "name=Logitech QuickCam Pro 9000,size=176x144,fps=5"
> [49] "name=Logitech QuickCam Pro 9000,size=176x144,fps=30"
> [50] "name=Logitech QuickCam Pro 9000,size=320x180,fps=5"
> [51] "name=Logitech QuickCam Pro 9000,size=320x180,fps=30"
> [52] "name=Logitech QuickCam Pro 9000,size=320x200,fps=5"
> [53] "name=Logitech QuickCam Pro 9000,size=320x200,fps=30"
> [54] "name=Logitech QuickCam Pro 9000,size=320x240,fps=5"
> [55] "name=Logitech QuickCam Pro 9000,size=320x240,fps=30"
> [56] "name=Logitech QuickCam Pro 9000,size=352x288,fps=5"
> [57] "name=Logitech QuickCam Pro 9000,size=352x288,fps=30"
> [58] "name=Logitech QuickCam Pro 9000,size=640x360,fps=5"
> [59] "name=Logitech QuickCam Pro 9000,size=640x360,fps=30"
> [60] "name=Logitech QuickCam Pro 9000,size=640x400,fps=5"
> [61] "name=Logitech QuickCam Pro 9000,size=640x400,fps=30"
> [62] "name=Logitech QuickCam Pro 9000,size=864x480,fps=5"
> [63] "name=Logitech QuickCam Pro 9000,size=864x480,fps=15"
> [64] "name=Logitech QuickCam Pro 9000,size=768x480,fps=5"
> [65] "name=Logitech QuickCam Pro 9000,size=768x480,fps=15"
> [66] "name=Logitech QuickCam Pro 9000,size=800x450,fps=5"
> [67] "name=Logitech QuickCam Pro 9000,size=800x450,fps=15"
> [68] "name=Logitech QuickCam Pro 9000,size=800x500,fps=5"
> [69] "name=Logitech QuickCam Pro 9000,size=800x500,fps=15"
> [70] "name=Logitech QuickCam Pro 9000,size=800x600,fps=5"
> [71] "name=Logitech QuickCam Pro 9000,size=800x600,fps=15"
> [72] "name=Logitech QuickCam Pro 9000,size=960x720,fps=5"
> [73] "name=Logitech QuickCam Pro 9000,size=960x720,fps=15"
> [74] "name=Logitech QuickCam Pro 9000,size=1280x720,fps=5"
> [75] "name=Logitech QuickCam Pro 9000,size=1280x800,fps=5"
> [76] "name=Logitech QuickCam Pro 9000,size=1280x1024,fps=5"
> [77] "name=Logitech QuickCam Pro 9000,size=1600x900,fps=5"
> [78] "name=Logitech QuickCam Pro 9000,size=1600x1000,fps=5"
> [79] "name=Logitech QuickCam Pro 9000,size=1600x1200,fps=5"
> [80] "name=HD Pro Webcam C920,size=640x480,fps=5"
> [81] "name=HD Pro Webcam C920,size=640x480,fps=30"
> [82] "name=HD Pro Webcam C920,size=160x90,fps=5"
> [83] "name=HD Pro Webcam C920,size=160x90,fps=30"
> [84] "name=HD Pro Webcam C920,size=160x120,fps=5"
> [85] "name=HD Pro Webcam C920,size=160x120,fps=30"
> [86] "name=HD Pro Webcam C920,size=176x144,fps=5"
> [87] "name=HD Pro Webcam C920,size=176x144,fps=30"
> [88] "name=HD Pro Webcam C920,size=320x180,fps=5"
> [89] "name=HD Pro Webcam C920,size=320x180,fps=30"
> [90] "name=HD Pro Webcam C920,size=320x240,fps=5"
> [91] "name=HD Pro Webcam C920,size=320x240,fps=30"
> [92] "name=HD Pro Webcam C920,size=352x288,fps=5"
> [93] "name=HD Pro Webcam C920,size=352x288,fps=30"
> [94] "name=HD Pro Webcam C920,size=432x240,fps=5"
> [95] "name=HD Pro Webcam C920,size=432x240,fps=30"
> [96] "name=HD Pro Webcam C920,size=640x360,fps=5"
> [97] "name=HD Pro Webcam C920,size=640x360,fps=30"
> [98] "name=HD Pro Webcam C920,size=800x448,fps=5"
> [99] "name=HD Pro Webcam C920,size=800x448,fps=30"
> [100] "name=HD Pro Webcam C920,size=800x600,fps=5"
> [101] "name=HD Pro Webcam C920,size=800x600,fps=24"
> [102] "name=HD Pro Webcam C920,size=864x480,fps=5"
> [103] "name=HD Pro Webcam C920,size=864x480,fps=24"
> [104] "name=HD Pro Webcam C920,size=960x720,fps=5"
> [105] "name=HD Pro Webcam C920,size=960x720,fps=15"
> [106] "name=HD Pro Webcam C920,size=1024x576,fps=5"
> [107] "name=HD Pro Webcam C920,size=1024x576,fps=15"
> [108] "name=HD Pro Webcam C920,size=1280x720,fps=5"
> [109] "name=HD Pro Webcam C920,size=1280x720,fps=10"
> [110] "name=HD Pro Webcam C920,size=1600x896,fps=5"
> [111] "name=HD Pro Webcam C920,size=1600x896,fps=15/2"
> [112] "name=HD Pro Webcam C920,size=1920x1080,fps=5"
> [113] "name=HD Pro Webcam C920,size=2304x1296,fps=2"
> [114] "name=HD Pro Webcam C920,size=2304x1536,fps=2"
> [115] "name=HD Pro Webcam C920,size=640x480,fps=5"
> [116] "name=HD Pro Webcam C920,size=640x480,fps=30"
> [117] "name=HD Pro Webcam C920,size=160x90,fps=5"
> [118] "name=HD Pro Webcam C920,size=160x90,fps=30"
> [119] "name=HD Pro Webcam C920,size=160x120,fps=5"
> [120] "name=HD Pro Webcam C920,size=160x120,fps=30"
> [121] "name=HD Pro Webcam C920,size=176x144,fps=5"
> [122] "name=HD Pro Webcam C920,size=176x144,fps=30"
> [123] "name=HD Pro Webcam C920,size=320x180,fps=5"
> [124] "name=HD Pro Webcam C920,size=320x180,fps=30"
> [125] "name=HD Pro Webcam C920,size=320x240,fps=5"
> [126] "name=HD Pro Webcam C920,size=320x240,fps=30"
> [127] "name=HD Pro Webcam C920,size=352x288,fps=5"
> [128] "name=HD Pro Webcam C920,size=352x288,fps=30"
> [129] "name=HD Pro Webcam C920,size=432x240,fps=5"
> [130] "name=HD Pro Webcam C920,size=432x240,fps=30"
> [131] "name=HD Pro Webcam C920,size=640x360,fps=5"
> [132] "name=HD Pro Webcam C920,size=640x360,fps=30"
> [133] "name=HD Pro Webcam C920,size=800x448,fps=5"
> [134] "name=HD Pro Webcam C920,size=800x448,fps=30"
> [135] "name=HD Pro Webcam C920,size=800x600,fps=5"
> [136] "name=HD Pro Webcam C920,size=800x600,fps=30"
> [137] "name=HD Pro Webcam C920,size=864x480,fps=5"
> [138] "name=HD Pro Webcam C920,size=864x480,fps=30"
> [139] "name=HD Pro Webcam C920,size=960x720,fps=5"
> [140] "name=HD Pro Webcam C920,size=960x720,fps=30"
> [141] "name=HD Pro Webcam C920,size=1024x576,fps=5"
> [142] "name=HD Pro Webcam C920,size=1024x576,fps=30"
> [143] "name=HD Pro Webcam C920,size=1280x720,fps=5"
> [144] "name=HD Pro Webcam C920,size=1280x720,fps=30"
> [145] "name=HD Pro Webcam C920,size=1600x896,fps=5"
> [146] "name=HD Pro Webcam C920,size=1600x896,fps=30"
> [147] "name=HD Pro Webcam C920,size=1920x1080,fps=5"
> [148] "name=HD Pro Webcam C920,size=1920x1080,fps=30"
> [149] "name=HD Pro Webcam C920,size=640x480,fps=5"
> [150] "name=HD Pro Webcam C920,size=640x480,fps=30"
> [151] "name=HD Pro Webcam C920,size=160x90,fps=5"
> [152] "name=HD Pro Webcam C920,size=160x90,fps=30"
> [153] "name=HD Pro Webcam C920,size=160x120,fps=5"
> [154] "name=HD Pro Webcam C920,size=160x120,fps=30"
> [155] "name=HD Pro Webcam C920,size=176x144,fps=5"
> [156] "name=HD Pro Webcam C920,size=176x144,fps=30"
> [157] "name=HD Pro Webcam C920,size=320x180,fps=5"
> [158] "name=HD Pro Webcam C920,size=320x180,fps=30"
> [159] "name=HD Pro Webcam C920,size=320x240,fps=5"
> [160] "name=HD Pro Webcam C920,size=320x240,fps=30"
> [161] "name=HD Pro Webcam C920,size=352x288,fps=5"
> [162] "name=HD Pro Webcam C920,size=352x288,fps=30"
> [163] "name=HD Pro Webcam C920,size=432x240,fps=5"
> [164] "name=HD Pro Webcam C920,size=432x240,fps=30"
> [165] "name=HD Pro Webcam C920,size=640x360,fps=5"
> [166] "name=HD Pro Webcam C920,size=640x360,fps=30"
> [167] "name=HD Pro Webcam C920,size=800x448,fps=5"
> [168] "name=HD Pro Webcam C920,size=800x448,fps=30"
> [169] "name=HD Pro Webcam C920,size=800x600,fps=5"
> [170] "name=HD Pro Webcam C920,size=800x600,fps=30"
> [171] "name=HD Pro Webcam C920,size=864x480,fps=5"
> [172] "name=HD Pro Webcam C920,size=864x480,fps=30"
> [173] "name=HD Pro Webcam C920,size=960x720,fps=5"
> [174] "name=HD Pro Webcam C920,size=960x720,fps=30"
> [175] "name=HD Pro Webcam C920,size=1024x576,fps=5"
> [176] "name=HD Pro Webcam C920,size=1024x576,fps=30"
> [177] "name=HD Pro Webcam C920,size=1280x720,fps=5"
> [178] "name=HD Pro Webcam C920,size=1280x720,fps=30"
> [179] "name=HD Pro Webcam C920,size=1600x896,fps=5"
> [180] "name=HD Pro Webcam C920,size=1600x896,fps=30"
> [181] "name=HD Pro Webcam C920,size=1920x1080,fps=5"
> [182] "name=HD Pro Webcam C920,size=1920x1080,fps=30"
> [183] "name=Camo,size=1280x720,fps=0"
> [184] "name=Camo,size=1280x720,fps=30"
> 
> ```

This will NOT apply to recent versions but does support your statement.

`:)`

---

<div class="post-metadata">

**Author:** ![moon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/moon/32/21773_2.png) [@moon](https://discourse.processing.org/u/moon)\
**Post date:** [September 16, 2025, 6:08pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/5 "2025-09-16T18:08:38Z")

</div>

Wow! My hunch was from working with camera inputs in the web browser. Very helpful, thank you, @glv

@danielcorbani I suppose for now, you can pop back into Processing 2.2.1 … sigh.

---

<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:** [September 16, 2025, 6:35pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/6 "2025-09-16T18:35:56Z")

</div>

> [@moon](#):
>
> I suppose for now, you can pop back into Processing 2.2.1

It has been a while but I recall doing things like this:

```auto
import processing.video.*;

Capture video;

void setup() {
  size(640, 480);

  // List all available cameras
  String[] cameras = Capture.list();
  printArray(cameras);
  
  // From list and used later!
  String myCameraString = "Logitech QuickCam Pro 9000 #1";
  
  // From Processing 2.2.1 (for reference only): 
  // [14] "name=Logitech QuickCam Pro 9000,size=320x240,fps=5"
  
  // Latest Processing:
  // https://processing.org/reference/libraries/video/Capture.html  
  // Capture(parent, width, height, device, fps) See reference.
  // Modified for Processing 4.4.7:
  
  video = new Capture(this, 300, 240, myCameraString, 5);
  
  video.start();
}

void draw() {
  if (video.available()) {
    video.read();
    image(video, 0, 0);
  }
}

```

Reference:

- [Capture / Libraries / Processing.org](https://processing.org/reference/libraries/video/Capture.html)
- Constructor (used in example):  
`Capture(parent, width, height, device, fps)`

`:)`

> [@moon](#):
>
> Very helpful, thank you, @glv

You are welcome!  
I manage to navigate my way around from experience and persistence.  
Enjoy the ride!

`:)`

---

<div class="post-metadata">

**Author:** ![danielcorbani](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@danielcorbani](https://discourse.processing.org/u/danielcorbani)\
**Post date:** [September 22, 2025, 5:14pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/7 "2025-09-22T17:14:48Z")

</div>

That’s cool! Great points, people!  
I guess I can use Processing 2.2.1 for precision.  
I guess I will do some tests to see if I find a way to know what is behind those options. I will let you know if I find something.

Thank you all

---

<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:** [September 23, 2025, 12:38am UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/8 "2025-09-23T00:38:07Z")

</div>

> [@danielcorbani](#):
>
> I guess I can use Processing 2.2.1 for precision.

Also take a look at the GitHub issue @Moon posted.

One of the posts states:

> For now I open OBS to see all the available options there.

`:)`

---

<div class="post-metadata">

**Author:** ![danielcorbani](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@danielcorbani](https://discourse.processing.org/u/danielcorbani)\
**Post date:** [September 23, 2025, 3:27pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/9 "2025-09-23T15:27:06Z")

</div>

Oh, of course! Thanks.

---

<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:** [April 30, 2026, 8:36pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/10 "2026-04-30T20:36:00Z")

</div>

Hello @moon,

Should the issue you shared be moved over to the Processing 4 repository?

`:)`

---

<div class="post-metadata">

**Author:** ![moon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/moon/32/21773_2.png) [@moon](https://discourse.processing.org/u/moon)\
**Post date:** [April 30, 2026, 8:59pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/11 "2026-04-30T20:59:34Z")

</div>

hi @glv! good question. it seems like it would be helpful for it to reference the issue. i should think about where it would fit. very open to your thoughts on this!

---

<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 2, 2026, 2:11pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/13 "2026-05-02T14:11:28Z")

</div>

Hi @moon, I believe it is in the right place.  
A rushed post on my part… was going to delete but you very promptly responded!

---

<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 4, 2026, 2:44pm UTC](https://discourse.processing.org/t/capture-list-showing-duplicate-cameras/47153/14 "2026-05-04T14:44:30Z")

</div>

Another related issue:

> <https://github.com/processing/processing-video/issues/224>
>
> I need to get the resolution of the webcam. In the source we have the following:…
> 
> \`\`\`java
> // This is a temporary addition until it's decided how to bring back resolution/framerate caps to the official API.
> // The old way of doing things is still listed in the video tutorial:
> // https://processing.org/tutorials/video
> static public String\[\] getCapabilities(String device) {
> for (int i=0; i \< devices.size(); i++) {
> String deviceName = assignDisplayName(devices.get(i), i);
> if (devices.get(i).getDisplayName().equals(device) || devices.get(i).getName().equals(device) || deviceName.equals(device)) {
> return parseCaps(devices.get(i));
> }
> }
> return new String\[\]{};
> }
> \`\`\`
> 
> The above calls \`parseCaps\` which has the following part (this is a piece of it):
> 
> \`\`\`java
> if (0 \< indexWidth && 0 \< indexHeight && 0 \< indexFramerate) {
> stringWidth = cap.substring(indexWidth, cap.indexOf(',', indexWidth));
> stringHeight = cap.substring(indexHeight, cap.indexOf(", format", indexHeight));
> stringFramerate = cap.substring(indexFramerate, cap.indexOf('\]', indexFramerate));
> }
> \`\`\`
> 
> An example of the String cap is \`" video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)10/1, pixel-aspect-ratio=(fraction)1/1"\`.
> 
> The problem with the above code is that \`stringHeight = cap.substring(indexHeight, cap.indexOf(", format", indexHeight));\` assumes a certain order of the elements being listed. The assumption being made is wrong resulting in the following error:
> 
> \`\`\`
> java.lang.StringIndexOutOfBoundsException: begin 52, end -1, length 127
> at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4606)
> at java.base/java.lang.String.substring(String.java:2709)
> at processing.video.Capture.parseCaps(Capture.java:791)
> at processing.video.Capture.getCapabilities(Capture.java:768)
> at room\_activity.Room\_Activity.setup(Room\_Activity.java:95)
> at processing.core.PApplet.handleDraw(PApplet.java:2051)
> at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:840)
> at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:692)
> at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:674)
> at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:443)
> at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1293)
> at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
> at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:797)
> at com.jogamp.opengl.util.AWTAnimatorImpl.display(AWTAnimatorImpl.java:81)
> at com.jogamp.opengl.util.AnimatorBase.display(AnimatorBase.java:471)
> at com.jogamp.opengl.util.FPSAnimator$MainTask.run(FPSAnimator.java:245)
> at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
> at java.base/java.util.TimerThread.run(Timer.java:516)
> \`\`\`

I shared some minimal code that is a workaround.

`:)`
