Quantcast
Viewing latest article 15
Browse Latest Browse All 35

Video resolution when capturing a full-screen recording via ffmpeg on Mac OS X

I have a 15-inch 2017 MacBook Pro running Mac OS X 10.13 (High Sierra): Image may be NSFW.
Clik here to view.
enter image description here
The default display supports screen resolutions up to 2880x1800, despite the maximum resolution selectable via the standard UI is limited to 1920x1200 (see this question): Image may be NSFW.
Clik here to view.
enter image description here

Now, I'm trying to capture a full-screen recording via ffmpeg, using the avfoundation device, in full resolution (i. e. w/o any sub-sampling):

ffmpeg -y -v error -hide_banner -f avfoundation -i 1:none -threads 0 -f mp4 -vcodec mpeg4 -r 25/1 -qscale:v 1 output.mp4

Strangely, when the screen resolution varies between 1024x640 and 1920x1200 (i. e. is selectable via the "scaled list" in the Mac OS X preferences), the size of the resulting video raster is always a quadruple of the screen resolution:

  • 1024x6402048x1280
  • ...
  • 1920x12003840x2400

Image may be NSFW.
Clik here to view.
enter image description here

If, on the other hand, I set the screen resolution to the maximum of 2880x1800 using the screenresolution utility, the size of ffmpeg output will be identical to the screen resolution.

In both cases, the -video_size option will be ignored by ffmpeg.

The above is only true for the built-in display: for any external displays, screen resolution and captured video resolution are always the same, regardless of the scale level.

Questions:

  1. Why does ffmpeg (or, rather, the avfoundation input device) exhibit such inconsistencies?
  2. How do I force ffmpeg to always use the current display resolution when capturing the screen? I would rather not enable sub-sampling (-vf scale=...) to affect the resulting raster size.

Viewing latest article 15
Browse Latest Browse All 35

Trending Articles