How do I priritize FPS in recording instead of the phone?
I want to record my phone screen (gameplay) but it needs to be at a constant 60fps. I'm ok with the framerate on the phone dropping to 30, since the recording will be analyzed later.
As of now, the game on the phone stays at a constant 60 but the recording is around 45. I tried different combinations of bit rates and resolutions so far, and they didn't work as expected.
The capture bit-rate is intrinsically variable: a new frame is produced when the screen content changes (you could check with scrcpy --print-fps). When recording with scrcpy --record, all the frames produced by the device are recorded.
Also see https://github.com/Genymobile/scrcpy/issues/3305
So the framerate for the video stays at 30 in the lobby which I expected. But when in-game, the framerate in the video depends on how much action is happening. If I am idle and not touching the screen (to move in-game) then the FPS is above 55. But as I start moving it dips below 50 and goes as low as 39 fps.
Here is a sample of what it looks like

It's the rendering framerate (the game may lag a bit more when there is action, and capturing the screen on the device may have some impact on the game performance).
Well for my use case I don't really mind if the gameplay is 20-30fps. The main thing needed is the footage, to analyze it for in-game statistics, so that is the main priority.
OK, then scrcpy records all the frames captured on the device (with an intrinsic variable framerate).
OK, then scrcpy records all the frames captured on the device
Yes, it is probably doing that. I have also tried lowering some other settings in the game to try and free up some processes and it seems to have somewhat worked. The average fps is slightly higher now but not consistent 59-60fps