Image sequence into ProRes

Problem

Transcode an image sequence into an Apple ProRes 422 HQ file for post-production purposes.

Solution

ffmpeg \
    -f image2 \
    -framerate 24 \
    -i input_file_%06d.ext \
    -c:v prores_ks \
    -profile:v 3 \
    output_file

General command

ffmpeg \
    -f image2 \
    -framerate frames_per_second \
    -i input_file_regex.ext \
    -c:v prores_ks \
    -profile:v profile_number \
    output_file

Command syntax

ffmpeg
starts the command
-f image2
forces the image file de-muxer for single image files
-framerate frames_per_second
sets the frame rate
-i input_file_regex.ext
path, name with regex and extension of the input files
-c:v prores_ks
video codec ProRes is set
-profile:v profile_number
chooses the variant of ProRes
output_file
path, name and extension of the output file

Discussion

The parameters witch apply to the input files must precede them. Therefore the option -f image2 must precede the image sequence given as input.

The frame rate of sound film is 24 fps (frames per second) and the default frame rate of image2 is 25 fps, therefore we have to change it.

The regex %06d matches six digits long numbers, possibly with leading zeroes. This allows to read in ascending order, one image after the other, the full sequence inside one folder. The command must of course match the naming convention actually used. And for image sequences starting at 086400 (captured at 24 fps with a timecode starting at 01:00:00:00) or at 090000 (captured at 25 fps with a timecode starting at 01:00:00:00), add the flag -start_number 86400 or -start_number 90000 before -i input_file_%06d.ext.

The extension for TIFF files is .tif or maybe .tiff; the extension for DPX files is .dpx (or eventually .cin for old Cineon files). Other file formats are possible.

The video codec is specified by -codec:video, which is usually abbreviated as -c:v (-codec:v or -c:video are also possible). We advise to avoid the alias -vcodec.

The possible video profile values for the ProRes codec prores_ks are1:

  • 5 = 4444 XQ
  • 4 = 4444
  • 3 = HQ (high quality)
  • 2 = standard (rarely called ST)
  • 1 = LT (light)
  • 0 = proxy (sometimes called PR)

The extension of the output files must be one of .mov, .mkv or .mxf, because the containers QuickTime, Matroska and Material eXchange Format can hold the various flavours of the ProRes 422 and 4444 codecs.

Note that transcoding from another format than a video file with Y′CBCR colour space and 4:4:4 or 4:2:2 chroma subsampling to ProRes does diminish the image quality.

 

A Bash script allowing to perform this transcoding is included in our collection Bash Script for Audiovisual Preservation.


Note

1
The codec_tag_string for the different ProRes 4444 flavours are:
  • ap4x = 4444 XQ
  • ap4h = 4444
The codec_tag_string for the different ProRes 422 flavours are:
  • apch = HQ (high quality)
  • apcn = standard (rarely called ST)
  • apcs = LT (light)
  • apco = proxy (sometimes called PR)

2021-12-04