cmauri / eviacam

webcam based mouse emulator
GNU General Public License v3.0
143 stars 37 forks source link

Please add support for 60FPS cameras #18

Open RustyMoyher opened 5 years ago

RustyMoyher commented 5 years ago

Support for higher frame rates than 30 FPS would make the tracking more responsive. This would make cursor adjustments easier, faster and using Enable Viacam a more pleasant experience.

I'm currently trying to use a Logitech C922x Pro, which supports 60 FPS at 720p. (Only 30 FPS at 1080p). I'd be happy to purchase any camera if eviacam would support a higher frame rate with it. Some specialized webcams cameras support 120 FPS and higher. But I think eviacam is capped at 30 FPS?

The Logitech C922x Pro works at 60 FPS on OBS Studio, but the frame rate and resolution has to be specifically set in OBS Studio to work. So I think eviacam would need to do something similar: setting the resolution and the frame rate. If it's easier to add, reading an ini file at launch would work too.

I tried to make this change myself when I found void setIdealFramerate(int deviceID, int idealFramerate); and bool setupDevice(int deviceID, int w, int h); inside of videoInput.h. I suspect I just needed to change the defaults when setupDevice is first used, but I was unable to get the source building. This is mostly because the required tools and dependences (opencv, MinGW, etc.) are foreign to me. Or maybe I was just using too new of a version of Windows or Visual Studio or whatever.

Cheers, Rusty

cmauri commented 5 years ago

Hi Rusty, The easiest way to buy eViacam is under linux. However, under Windows it is possible to build eViacam. Please, check INSTALL file.

To set frame rate, perhaps is easier to change

viacamcontroller.cpp:260 CCamera* cam = CCameraEnum::getCamera(1, camId);

and add additional parameters to specify the FPS. Hope it helps.

leeorhelps commented 3 years ago

Hi, cmauri,

Firstly, thank you for this superb app! With RSI, I have switched to hands-free as much as possible, using voice recognition -- and your application for controlling the mouse. I have this same question, about 60FPS. I experienced 60FPS when I experimented within application on my smartphone which allows it to behave as a virtual webcam for my PC. Viacam automatically went to 60FPS with that virtual webcam, and control was smoother. Now, I am considering purchasing an actual webcam in order to use it with your application. Would Viacam automatically go to the highest possible FPS? Would I need to do something special for it to happen? I am quite weak with coding, but have some very basic experience.

Thank you so much for making this software. Leeor

Enteleform commented 3 years ago

+1

@cmauri Editing the source code & rebuilding eViacam seems like a fairly complex workaround to this issue that is not feasible for all users (seems to require familiarity with a substantial amount of tooling, as well as programming experience specifically with C). Would you consider adding some input fields / dropdown menus within the Configuration dialog so that non-developers can change FPS & resolution?

leeorhelps commented 3 years ago

Just to chime back in with what I've learned so far:

So far, only thing that I’m sure gives 60FPS "out of the box" is using an iPhone + iVcam app ($10 a year), connected over USB, lowest video quality for better speed. I suspect with Android and a 60FPS capable phone, this can be done with the paid version of DroidCam with their "FPS Boost" option -- but haven't tested, and Dev47 didn't respond to my questions about it. On iPhone, Paid DroidCam was capped at 30FPS. Other apps gave me 30 FPS, and/or trouble. The good news: I found something that works. That said, My phone is now constantly on “webcam duty”, i.e. need to detach and reattach a few times a day, it heats up some (on "battery saver" a bit better?).

Regular Webcams: I think part of the issue is that Viacam will go for a 640x480 stream if the camera can provide it; most 60FPS cams only give 60 at very specific resolutions, and will let the Viacam choose resolution, hence no 60FPS in most cases. Note, iVcam works bc it's virtual cam driver/decoder on the PC lets you choose any ONE setting that it would offer to the Windows apps, in my case I chose 640x480@60FPS — and after you choose, it just forces whatever you choose onto viacam (or wherever you send the video; and you can send to a few apps at once, so that's nice). I think that’s why it works. If I could find a normal webcam that can force a setting this way, I think it would work too, but haven’t found anyone who could verify. One guy helped me check, and his 60FPS cam gave 15 for viacam... but he didn't play around with settings much.

Also note, higher FPS increases cpu use (also higher res: I accidentally forced 720p into viacam once). 640x480@30FPS I was around 3-4% CPU, 60FPS 5-7% on an i7 + another 2-5% or so for iVcam. 720p made it closer to 20%...! Just to say, even if Logitech driver could “lock” the cam to 720p @60 FPS, that won’t help much with viacam, unless you don't mind the extra CPU usage... I'm looking for a webcam that can be locked to 640x480@60Hz to be practical, even at night/indoor lighting.

If anyone discovers one that works well, please let me know. I’m continuing with iVcam for now. The 60 FPS and ability to zoom into my face area have made Viacam significantly more responsive/accurate in terms of time and movement.

Hope this helps someone out there !

ligantx commented 1 year ago

@leeorhelps do you have any updates for support of 60fps cameras? We bought Razer Kiyo X to find that unfortunately it cannot work at 720p@60fps.. It would be great if you can change that through settings as you can do through the win 10 camera application..

leeorhelps commented 1 year ago

@leeorhelps do you have any updates for support of 60fps cameras? We bought Razer Kiyo X to find that unfortunately it cannot work at 720p@60fps.. It would be great if you can change that through settings as you can do through the win 10 camera application..

Sorry, no news beyond what I already wrote. I can reconfirm e2esoft iVCam + an iPhone is giving me smooth 60 FPS, has been working well, stable.