I am trying to record a screen region on Mac using FFmpeg. I have a solution using avfoundation device to grab the screen and using a filter to crop down to the screen region. This works fine for certain situations but does not work when either the screen is scaled to different resolution or when the screen orientation is sideways.

My command looks something like

ffmpeg -y -f avfoundation -framerate 2 -pixel_format uyvy422 -video_device_index 0
 -i ':none' -c:v libopenh264 -b:v 500k -allow_skip_frames 1 
-filter:v crop=1010:600:200:200 -vsync vfr output.mp4

I've tried using the -video_size parameter but it seems to just ignore it. The performance is also not great since it its grabbing the whole screen instead of just a region.

The sideways screen not working properly I can deal with, it's not that big of a problem but the screen scaling and performance are the issues I would really like to deal with but can't seem to find any good solutions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.