russelltg / wl-screenrec

High performance wlroots screen recording, featuring hardware encoding
Apache License 2.0
305 stars 9 forks source link

Request for encoding framerate option #54

Open lsr1006 opened 8 months ago

lsr1006 commented 8 months ago

It would be nice to be able to choose a framerate to record at, similar to the "--encode-resolution" option for resolution. I have a 170 Hz 1440p monitor but I really only want my recordings to be at 60 FPS. I have the bit-rate cranked up quite high to maintain the quality at this framerate which ends up making the file sizes too large for my liking. I don't want to downscale the resolution or sacrifice visual quality, reducing the FPS is really what I would prefer. I usually transcode clips down to 60FPS afterwards anyway, but it would be nice to not have to do that and not have to worry about available space while recording.

If this is already possible, my apologies. I didn't see any way with the current options.

russelltg commented 8 months ago

This is not currently possible, thank you for opening an issue.

There's no one ideal way to implement this, due the the VFR nature of screenrecording (unless you pass --no-damage, which is not suggested). Likely this could be implemented as a "minimum delta between frames"

Unfortunately, I'm not seeing any way in the wlr-screencopy API to avoid the buffer copies for the non-encoded frames, which would be nice (you don't get the frame timestamp until after it's been copied), but not required

lsr1006 commented 8 months ago

Understood, thanks for the response.

LtdJorge commented 8 months ago

Hi, can't this be done in the ffmpeg part by the fps filter?

Basic usage for the ffmpeg command line is explained here: https://trac.ffmpeg.org/wiki/ChangingFrameRate

With further explanation here: https://ffmpeg.org//ffmpeg-filters.html#fps

I don't know if this is feasible with ffmpeg_next, although I see that it provides filters.