Featured image of post ffmpeg Parameters for iOS

ffmpeg Parameters for iOS

ffmpeg Conversion Parameters Optimized for iOS

Here is an ffmpeg command to convert videos so they can be played smoothly on iOS devices (iPhone and iPad).

1
2
3
4
5
6
ffmpeg -i input.mp4 \
-c:v libx264 -profile:v high -level 4.1 \
-vf "scale=1920:-2" -r 30 \
-crf 20 -preset slow \
-c:a aac -b:a 128k -ar 48000 \
-movflags +faststart output.mp4

Meaning of Each Option (Brief Explanation)

OptionDescription
-i input.mp4Input file (source video to be converted)
-c:v libx264Encode video with H.264 (iOS compatible)
-profile:v high -level 4.1Widely compatible profile and level for iOS
-vf "scale=1920:-2"Resize width to 1920px, auto-adjust height maintaining aspect ratio
-r 30Convert to 30fps frame rate
-crf 20Video quality (lower value means higher quality, recommended 18-23)
-preset slowBalance between encode speed and compression ratio (slow means high compression/high quality)
-c:a aacEncode audio in AAC format
-b:a 128kSet audio bitrate to 128kbps
-ar 48000Set audio sampling rate to 48kHz (recommended for iOS)
-movflags +faststartPlaces the index at the beginning of the video, speeding up streaming playback on Web and iOS

Videos converted with these settings can be expected to have high compatibility and smooth playback on Apple devices such as iPhones and iPads.


You can adjust file size and image quality by changing the resolution and bitrate as needed. Try setting -crf to around 18 if you need high quality, or 22-25 if you want to reduce the file size.

comments powered by Disqus