showmewebcam icon indicating copy to clipboard operation
showmewebcam copied to clipboard

FPS Control

Open TheNewJavaman opened this issue 3 years ago • 9 comments

I'm using a Pi Zero (No W) with HQ Camera. Hypothetically, this device should support 720p60fps. How can I enable this setting?

TheNewJavaman avatar Dec 03 '20 19:12 TheNewJavaman

@TheNewJavaman Whenever possible can you help test the build in the PR to see if the framerate for 720p is actually 60fps? I see it listed here with this change, but I have no idea how to check if it's lying to me.

htruong avatar Dec 12 '20 09:12 htruong

@htruong I'll try to get it done after this week. I have finals for the next few days.

TheNewJavaman avatar Dec 15 '20 17:12 TheNewJavaman

Good luck with your finals!

htruong avatar Dec 16 '20 07:12 htruong

@htruong You PR looks good to me. I've tested it using VLC on windows and v4l on linux. I even added 83333 to allow 120 FPS which would be great for machine vision applications like head tracking.

fgma avatar Apr 10 '21 17:04 fgma

I just tested this (i.e. PR #72) by making the modifications myself on master. First I tried adding both 83333 and 166667 (10s of milliseconds? kind of a strange unit) at the same time for potentially 120 and 60 fps. That resulted in uvcvideo not working at all when plugging it in to my linux laptop. My pi0w + HQ only showed up as a USB device. Tried again with just 166667, uvcvideo works, and 60 fps shows up as an option in guvcview (http://guvcview.sourceforge.net/), but it never actually delivers more than 30 fps. Same goes for vlc. So I guess it's more complicated than this simple edit. Perhaps it needs to be resolution specific (#128)?

mspacek avatar Jun 04 '21 17:06 mspacek

@mspacek Just curious, how do you verify whether the video is actually 60fps or it's faux 60fps?

htruong avatar Jun 04 '21 17:06 htruong

I can instantly tell just looking at the onscreen preview. Everything is much more alive at 60 fps. Try a youtube video and compare normal to 60 fps, you should be able to see it too. Also, guvcview displays the fps in the window title of the preview window, and vlc displays fps in the Tools->Codec information dialog.

mspacek avatar Jun 04 '21 17:06 mspacek

any news on this? i tested the PR, we can select 720p60fps but it is actually 30fps, it is driver related ? im actually runing an IR OV5647 with Pi0W. as i can run 720p 60fps with this camera with the latest Pios, im sure there is something forgotten here.

Al3601 avatar Nov 10 '21 01:11 Al3601

I also tested this patch and can confirm that regardless of resolution or using MJPEG/uncompressed, the camera will only output a max of 30fps even when set to 60fps mode. Recording just the webcam in OBS at 60fps with no reported encoding/rendering lag, then manually checking individual frames, the recording duplicates the previous frame once - effectively running it at 30fps instead of the intended 60fps.

I noticed that the related PR #72 was closed but not merged, since apparently just adding 166666 to package/piwebcam/multi-gadget.sh's the list under the /dwFrameInterval definition does not work.

I couldn't find any branches / forks attempting to add this in - I figure there's a lot of work being done on the universal image build branches. I'm not skilled enough to figure out how to implement this myself - but if people need testers then I'll certainly help out

HunterAP23 avatar Feb 03 '22 18:02 HunterAP23