Encode H.264 for Legacy iPads with FFmpeg

This article provides a practical guide on how to configure H.264 video profiles and levels using FFmpeg to ensure seamless playback on legacy iPads. You will learn the exact hardware limitations of older iOS devices, the corresponding FFmpeg commands needed to target them, and critical video encoding settings required for Apple ecosystem compatibility.

Understanding Legacy iPad H.264 Limitations

Older iPads have strict hardware decoding limitations. If a video exceeds the maximum supported H.264 profile or level, the iPad will either fail to play the file or exhibit severe stuttering.

To guarantee playback across all legacy iPads, encoding to Baseline Profile, Level 3.0 at a maximum resolution of 1280x720 is recommended. For slightly newer legacy devices (iPad 2 and newer), you can use Main or High Profile, Level 3.1 or 4.1.

FFmpeg Command for Maximum Compatibility (iPad 1 and Newer)

To target the absolute widest range of older iPads (including the 1st Gen iPad), use the H.264 Baseline Profile at Level 3.0.

Run the following FFmpeg command:

ffmpeg -i input.mp4 -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p -vf "scale=1280:720" -c:a aac -ac 2 -b:a 128k output.mp4

Command Breakdown:

FFmpeg Command for Standard Legacy Compatibility (iPad 2 and Newer)

If you only need to support the iPad 2, iPad 3, or iPad mini (1st Gen), you can utilize the Main Profile at Level 3.1 to achieve better compression efficiency and video quality at 720p.

Run the following command:

ffmpeg -i input.mp4 -c:v libx264 -profile:v main -level 3.1 -pix_fmt yuv420p -vf "scale=1280:720" -c:a aac -ac 2 -b:a 160k output.mp4

For 1080p video targeting iPad 3rd/4th Gen and newer legacy devices, increase the level to 4.1 and scale to 1080p:

ffmpeg -i input.mp4 -c:v libx264 -profile:v high -level 4.1 -pix_fmt yuv420p -vf "scale=1920:1080" -c:a aac -ac 2 -b:a 160k output.mp4

Important Encoding Tips for iOS Compatibility