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.

krishna rao vijayanagar
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.

Pallycon April NAB 2024

6 thoughts on “FFmpeg – Convert to Apple ProRes 422 / 4444 Simplified”

  1. Hi, nice explanation. But I couldn´t do a mov with alpha (4444) in a lower bitrate. Which is the string that I need to add? Im using: \ffmpeg -r 30 -i 360CHEIO%04d.png -c:v prores_ks TESTE.MOV

    Thanks

  2. thanks,
    but wouldn’t it be also appropiate to output in full range instead of limited?
    if we care to encode to 10-bit, it makes sense to use all 1024 possible values, specially when transcoding from RGB or even XYZ
    -color_range 2

  3. Thank you so much for this solution, it worked for me in producing a video from transparent backgroung png’s to a prores4444 video maintaining the transparent alpha channel. Really appreciate it!

  4. Hey,
    Thanks so much for sharing this.
    With the new Apple Silicon, it seems that FFMPEG supports hardware acceleration using videotoolbox option.
    Would you be able to enlighten us on that?

Leave a Comment

Your email address will not be published. Required fields are marked *

Enjoying this article? Subscribe to OTTVerse and receive exclusive news and information from the OTT Industry.