FFmpeg – Convert to Apple ProRes 422 / 4444 Simplified

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.

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.

FFmpeg Apple ProRes
Source: Wikipedia

Apple ProRes Profiles in FFmpeg

FFmpeg contains two ProRes encoders, the prores-aw and prores-ks encoder. You can choose the encoder you want using the -vcodec option.

profile <integer> : You can use this option to choose the ProRes profile to encode.

  • proxy (0)
  • lt (1)
  • standard (2)
  • hq (3)
  • 4444 (4)
  • 4444xq (5)

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.

  • auto
  • default
  • proxy
  • lt
  • standard
  • hq

bits_per_mb <integer>
How many bits to allot for coding one macroblock. Different profiles use between 200 and 2400 bits per macroblock, the maximum is 8000.

mbs_per_slice <integer>
Number of macroblocks in each slice (1-8); the default value (8) should be good in almost all situations.

vendor <string>
Override the 4-byte vendor ID. A custom vendor ID like apl0 would claim the stream was produced by the Apple encoder.

alpha_bits <integer>
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.

  1. .mov (QuickTime)
  2. .mkv (Matroska)
  3. .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 prores (HQ).

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.

Apple ProRes 422 HQ using FFmpeg

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 10-bit bit-depth.

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,

Apple ProRes 4444 using FFmpeg

Both the outputs show that the

  1. Apple ProRes 4444 profile is being used
  2. FourCC Codec ID is ap4h (matches!)
  3. Chroma subsampling is 4:4:4
  4. Bit Depth is 10bit
  5. Writing Library is Apple

Conclusion

There you have it, a simple way of using FFmpeg to convert videos into Apple ProRes 422 or ProRes 4444 formats.

About The Author

I’m Krishna Rao Vijayanagar, Ph.D., and I am the Founder and Editor of OTTVerse.com. I've spent several years working hands-on with Video Codecs (AVC, HEVC, MultiView Plus Depth), ABR streaming, and Video Analytics (QoE, Content & Audience, and Ad). I hope to use my experience and love for video streaming to bring you information and insights into the OTT universe. Please use the Contact Page to get in touch with me.

Leave a Reply

Scroll to Top