Original Issue
ffmpeg -i macos-sreenrecording-2560x1600-h264-FPS60.mov -movflags faststart -an -c:v libx264 -crf 18 -preset veryslow 2560x1600-CR18-FPS60.mp4
- Yields an MP4 with H.264 at High@L6 (aka High Profile Level 6)
- ❌ Does not play back on iPhones 6S, whose maximum is [email protected] (4K @ 30 FPS).
Realized root cause and solution (in principle!)
- Wikipedia lists these maximum values for video Width×Height@Framerate(Stored Frames) for Profile 5.1
1920×1080 @ 120.5 (16), 2560×1920 @ 51.2 (9), 3840×2160 @ 31.7 (5), ...
- 💡 So I thought I have these viable alternatives:
- 👉 Keep dimensions 2560x1600 and lower framerate from 60 to 50 FPS
- 👉 Keep the framerate of 60 FPS and reduce the dimensions from 2560x1600 to 1920x1200.
Remaining issue (in practice & theory)
ffmpeg -i 2560x1600-h264-FPS60.mov -movflags faststart -an -c:v libx264 -r 50 -vsync cfr -crf 18 -preset fast 2560x1600-CR18-FPS50.mp4
- With
-preset fast
according tomediainfo
this yields an MP4 with H.264 at High Profile Level 5.1 with:- Format settings: CABAC / 4 Ref Frames
- Bit rate: 185 kb/s
- If I change
-preset
toveryslow
then according tomediainfo
it becomes a High Profile Level 6 with:- Format settings: CABAC / 16 Ref Frames
- Bit rate: 179 kb/s
Learning: The H.264 Profile Level seems to be not only determined by video dimensions + framerate + average and/or peak bitrate, but also by the reference frame count.
Remaining Question
How can I encode this video with the most CPU effort (for the best possible outcome, except placebo which is explictly "too much") to remain [email protected] compatible with the maximum image dimensions and framerate?
-level:v 5.1