In this article, we will learn how to use FFmpeg to convert videos to Apple ProRes 422 and 444 formats. To try this tutorial on a Windows machine, you can download an FFmpeg static build from OTTVerse’s FFmpeg build page. Instructions for FFmpeg installation for macOS and Linux can be found in our FFmpeg installation guide.
Table of Contents
What is Apple ProRes?
Apple ProRes is a high quality, lossy video codec developed by Apple. As per Apple’s website,
Apple ProRes codecs provide an unparalleled combination of multistream, real-time editing performance, impressive image quality, and reduced storage rates. Apple ProRes codecs take full advantage of multicore processing and feature fast, reduced-resolution decoding modes.
All Apple ProRes codecs support all frame sizes (including SD, HD, 2K, 4K, and 5K) at full resolution. The data rates vary based on codec type, image content, frame size, and frame rate. Apple ProRes includes the following formats.Apple
ProRes is basically used as an intermediate compression format and is not to be used to compress videos with an intention of getting high compression efficiency. The goal of ProRes is to retain the video quality while attaining an agreeable amount of compression.
ProRes supports different resolutions and chroma sampling schemes. All ProRes422-variants use 4:2:2 10-Bit subsampling formats. Also, ProRes 4444 and 4444 XQ use the 4:4:4 chroma subsampling schema with either 10 or 12-bit depth and can optionally include an alpha channel.
A concise table from Wikipedia captures the bitrates and resolutions that the various ProRes variants can support.
Apple ProRes Profiles in FFmpeg
FFmpeg contains two ProRes encoders, the
prores-ks encoder. You can choose the encoder you want using the
profile <integer> : You can use this option to choose the ProRes profile to encode.
The FourCC codec IDs for the different Apple ProRes variants are –
- Apple ProRes 422 High Quality: ‘apch‘ (‘hcpa’ in little-endian)
- Apple ProRes 422 Standard Definition: ‘apcn‘ (‘ncpa’ in little-endian)
- Apple ProRes 422 LT: ‘apcs‘ (‘scpa’ in little-endian)
- Apple ProRes 422 Proxy: ‘apco‘ (‘ocpa’ in little-endian)
- Apple ProRes 4444: ‘ap4h’ (‘h4pa‘ in little-endian)
ProRes Encoding Options in FFmpeg
quant_mat <integer>: Select quantization matrix. If this option is set to
auto, the matrix matching the profile will be picked. If not set, the matrix providing the highest quality, default, will be picked.
How many bits to allot for coding one macroblock. Different profiles use between 200 and 2400 bits per macroblock, the maximum is 8000.
Number of macroblocks in each slice (1-8); the default value (8) should be good in almost all situations.
Override the 4-byte vendor ID. A custom vendor ID like
apl0 would claim the stream was produced by the Apple encoder.
Specify number of bits for alpha component. Possible values are 0, 8 and 16. Use 0 to disable alpha plane coding.
Encoding Apple ProRes 422 HQ using FFmpeg
The commandline for Apple ProRes 422 (HQ) encoding is pretty straightforward using the options above –
ffmpeg -i inputVideo.mp4 \ -c:v prores_ks \ -profile:v 3 \ -vendor apl0 \ -bits_per_mb 8000 \ -pix_fmt yuv422p10le \ proRes422_output.mov
If you see the commandline, we’ve used
-profile:v 3 to choose Apple ProRes 422 HQ variant using FFmpeg. If we were to change that to
2, it would be the standard ProRess 422 , and so on. You can match the profile with the table shown above to get a hang of it.
We also tell FFmpeg to use
4:2:2 10bit chroma subsampling and bit-depth.
Do remember to store the output in either of these three formats that are allowed as containers for the ProRes format.
.mxf(Material eXchange Format)
When I run this command on an
.mp4 file and then inspect the file using
ffprobe, here is what I get.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'proRes422_output.mov': Metadata: major_brand : qt minor_version : 512 compatible_brands: qt encoder : Lavf58.65.101 Duration: 00:00:10.00, start: 0.000000, bitrate: 1032846 kb/s Stream #0:0: Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, progressive), 1920x1080, 1032843 kb/s, SAR 1:1 DAR 16:9, 50 fps, 50 tbr, 12800 tbn, 12800 tbc (default) Metadata: handler_name : VideoHandler vendor_id : FFMP encoder : Lavc58.116.100 prores_ks
It shows that the chroma sampling and bit-depth is
4:2:2 10-bit. Also, FFmpeg reports that the variant is
And, here is the output of MediaInfo. It clearly shows that the “writing library” is recognized as “Apple”. And, the profile is
422 HQ and the FourCC codec ID is
apch as expected.
FFmpeg to Convert to Apple ProRes 4444 Format
ffmpeg -i inputVideo.mp4 \ -c:v prores_ks \ -profile:v 4 \ -vendor apl0 \ -bits_per_mb 8000 \ -pix_fmt yuva444p10le \ proRes444_output.mov
The commandline is same as above, but, you would change the pixel format as follows –
yuva444p10le to indicate to FFmpeg to use
4:4:4 chroma subsampling with
The output from
ffprobe is as follows –
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'proRes444_output.mov': Metadata: major_brand : qt minor_version : 512 compatible_brands: qt encoder : Lavf58.65.101 Duration: 00:00:10.00, start: 0.000000, bitrate: 1161518 kb/s Stream #0:0: Video: prores (4444) (ap4h / 0x68347061), yuv444p12le(tv, progressive), 1920x1080, 1161515 kb/s, SAR 1:1 DAR 16:9, 50 fps, 50 tbr, 12800 tbn, 12800 tbc (default) Metadata: handler_name : VideoHandler vendor_id : FFMP encoder : Lavc58.116.100 prores_ks
And from MediaInfo,
Both the outputs show that the
- Apple ProRes 4444 profile is being used
- FourCC Codec ID is
- Chroma subsampling is
- Bit Depth is
- Writing Library is
There you have it, a simple way of using FFmpeg to convert videos into Apple ProRes 422 or ProRes 4444 formats.
Krishna Rao Vijayanagar
Krishna Rao Vijayanagar, Ph.D., is the Editor-in-Chief of OTTVerse, a news portal covering tech and business news in the OTT industry.
With extensive experience in video encoding, streaming, analytics, monetization, end-to-end streaming, and more, Krishna has held multiple leadership roles in R&D, Engineering, and Product at companies such as Harmonic Inc., MediaMelon, and Airtel Digital. Krishna has published numerous articles and research papers and speaks at industry events to share his insights and perspectives on the fundamentals and the future of OTT streaming.