Creating ProRes Quicktimes on Windows with ffmpeg

Created by Bob Maple - 25-Oct-2012
Revised 15-Jan-2014


While Apple has never released a ProRes encoding codec for Quicktime on Windows, some very clever guys have reverse-engineered the codec and contributed it to the open-source project ffmpeg. Here's a complete guide to getting going with ffmpeg so you can create ProRes Quicktimes on Windows without having to feed it into a Mac.

Note: There are other software tools that encode to ProRes on Windows, like Cinemartin Cinec or SGO's MambaFX which generally use the same underlying libav library that ffmpeg does for encoding.


To get setup:

  1. Pick up a copy of ffmpeg for Windows.
    ffmpeg is a very active open-source project and the code changes often; There are no "official" Windows releases, but you can find several of the last few weeks' development builds up at Zeranoe - Grab one of the "Static" builds in 64-bit for running on your DS workstation.
  2. Unzip it into a folder on one of your drives; you might need 7zip if you don't have it, or modern versions of WinZip can probably decompress it too.

  3. Although there are many 3rd-party GUI front-ends for it, ffmpeg is natively a command-line application and as such we're going to go commando.
    Open a Command Prompt or a PowerShell window by either hitting Windows Key-R and typing cmd, or by tapping the Windows key and typing Power to find PowerShell.

  4. CD into the ffmpeg\bin directory you unzipped:

    cd d:\ffmpeg-x-win64-static\bin


Now let's encode something!


ffmpeg can read (and create) a myriad of codecs in a myriad of containers, but we'll use a Quicktime file as a source, aptly named SourceFile.mov, and create a new ProRes Quicktime called OutputProRes.mov. Our mythical file is an Uncompressed 10-bit 422yuv file, 1920x1080 at 23.98fps, with stereo audio (more on formats and exporting things specifically from DS later.)

Into your shell, type:

.\ffmpeg.exe -i SourceFile.mov -codec:v prores_ks -profile:v 2 -codec:a pcm_s16le -filter_complex asetnsamples=n=16384:p=0 OutputProRes.mov

Here's what everything does:





If your source Quicktime also had timecode, it should get passed along in the ProRes movie as well, or you can set it manually by adding -timecode HH:MM:SS:FF to the parameters, somewhere before the output filename. Otherwise, that's basically it! As mentioned above, the prores_ks encoder is somewhat slow, although your mileage will vary based on many things like the speed of the disks you're reading from/writing to, what format the source file is, the complexity of the material, and of course the speed of your workstation.


Export suggestions from DS for feeding into ffmpeg


As mentioned, ffmpeg can read a variety of formats and codecs -- including image sequences -- and can even read from multiple sources. However, I'm only going to talk about Quicktimes here, and there are of course caveats because Quicktime is Quicktime.

For an ideal, perfectly color-matching ProRes encode from a 422 YUV sequence in DS version 10.5 or above, the best way is to create an 8-bit Uncompressed 422 Quicktime from DS using the AJA 2vuy codec, which write out standard yuv422 Quicktimes -- they will import into Final Cut for instance and play realtime as standard 422 uncompressed files.

Why DS version 10.5 or above? Because up until 10.5 DS's Quicktime IO was only RGB, which meant a YUV->RGB conversion by DS plus another RGB->YUV conversion by Quicktime, which screws up your levels and gamma. In v10.5 and above, DS can pass the YUV data directly to Quicktime as YUV and avoid all the screwups (and it's a ton faster.) When exporting the Quicktime, select 601/709 for your levels. Don't use Quicktime Reference Movies from DS because they decode as RGB, and have other broken behaviors. They wouldn't work anyway since ffmpeg doesn't actually use Quicktime and thus can't access the DS reference codec.

For older versions of DS, well, you're going to have to either live with a colorspace conversion and your colors changing a bit, or bypass Quicktime by outputting a .YUV image sequence from DS with a separate audio file and feed them all into ffmpeg for encode. However that requires some different/extra command-line options to specify the image sequence and audio, set the frame rate, etc. which I'm not covering here. Perhaps I'll write a separate document if enough people need it. For Quicktime, your best bet is to create an Animation codec Quicktime at 100% quality, using Graphics or Legacy Graphics levels from DS. Just know that:

  1. If your sequence/media is 10-bit, you're squashing it down to 8-bit right out of the gate
  2. Your YUV is being converted to RGB and the levels are being scaled from 16-235 to 0-255 (and eventually back again) which can cause additional banding and artifacts
  3. The color conversion will be incorrect. In order to properly go from RGB to ProRes, you need to add the arguments:
    -pix_fmt yuv422p10le -vf colormatrix=bt601:bt709
    to the commandline, just before the output filename.



User Interface for FFmpeg

Appended by Igor Ridanovic - 12-Nov-2012

The command line gives you the full control of FFmpeg, but if you're not comfortable with it, or if you often encode ProRes with same parameters over and over again, you can try the batch file prores.bat.

Installation


Download prores.bat and place on desktop or other place where you keep your batch files.

Configuration


Prores.bat assumes that FFmpeg is installed on your system in a particular place. While the program path is correct for my system and the current build of FFmpeg, it will likely be wrong on other computers. To configure the path:

  1. Right click prores.bat
  2. Select "Edit"
  3. Look for line set FFmpegpath="C:\Program Files\ffmpeg-20121105-git-c995644-win64-static\bin"and change it to reflect the location of your FFmpeg (save the file too!)

Usage


Prores.bat can be used in drag-and-drop fashion or by double clicking the file.

Drag and drop a valid Quicktime file onto the prores.bat icon. This will launch FFmpeg and encode a "standard" quality 4:2:2 ProRes version of your clip and save it next to the original clip as originalname_ProRes.mov.

If you need to change the quality settings and/or the file name and destination path, double click prores.bat. The batch file will walk you through all the options. When entering paths and file names in prores.bat prompts, you don't have to enclose them in quotes whether or not they contain white spaces. In fact, using quotes will probably result in an error.

Revised: Jan 15, 2014 2:07 pm