How to Batch Create ProRes Proxies with FFmpeg and Bash

This article provides a complete Bash script and guide to automate the creation of low-resolution Apple ProRes proxy video files from high-resolution MOV source files using FFmpeg. You will learn how to set up the script, traverse directories, scale down video resolution, and output optimized editing proxies to speed up your video editing workflow.

The Bash Script

Save the following code into a file named make_proxies.sh in the directory containing your high-resolution MOV files:

#!/bin/bash

# Create a folder for the proxies if it doesn't exist
mkdir -p proxies

# Loop through all .mov files in the current directory (case-insensitive)
shopt -s nocaseglob
for file in *.mov; do
    # Prevent errors if no .mov files are found
    [ -e "$file" ] || continue

    # Extract the file name without the extension
    filename="${file%.*}"
    
    echo "Processing: $file"
    
    # Run FFmpeg to convert the video to ProRes Proxy
    ffmpeg -i "$file" \
           -c:v prores_ks \
           -profile:v 0 \
           -vendor ap10 \
           -pix_fmt yuv422p10le \
           -vf "scale=1280:-2" \
           -c:a copy \
           "proxies/${filename}_proxy.mov"
done
shopt -u nocaseglob

echo "All proxies generated successfully in the 'proxies' directory."

How the Script Works

  • mkdir -p proxies: Creates a subdirectory named proxies inside your working directory to store the output files, ensuring your original footage directory remains organized.
  • shopt -s nocaseglob: Enables case-insensitive matching so the script processes both .mov and .MOV files.
  • ${file%.*}: Removes the file extension from the variable, allowing the script to append _proxy.mov to the original filename.
  • -c:v prores_ks: Uses the high-quality FFmpeg Apple ProRes encoder.
  • -profile:v 0: Sets the ProRes profile to Proxy (0 = Proxy, 1 = LT, 2 = Standard, 3 = HQ).
  • -vendor ap10: Flags the video file vendor as Apple, which helps video editing software like Premiere Pro and DaVinci Resolve natively recognize it as a standard Apple ProRes file.
  • -pix_fmt yuv422p10le: Sets the pixel format to 10-bit YUV 4:2:2, which is required for standard ProRes compliance.
  • -vf "scale=1280:-2": Scales the video resolution down to a width of 1280 pixels. The -2 value automatically calculates the height to maintain the original aspect ratio while ensuring the height is divisible by 2 (a requirement for most video codecs).
  • -c:a copy: Copies the original audio streams without re-encoding, preserving the original audio tracks, channels, and quality.

How to Run the Script

  1. Install FFmpeg: Ensure you have FFmpeg installed on your system. You can install it via Homebrew on macOS (brew install ffmpeg) or APT on Ubuntu (sudo apt install ffmpeg).

  2. Make the script executable: Open your terminal, navigate to the folder containing your script, and run the following command:

    chmod +x make_proxies.sh
  3. Execute the script: Run the script in the terminal:

    ./make_proxies.sh

Once the process finishes, you will find all your newly created low-resolution ProRes Proxy files in the newly generated proxies folder.