September 18, 2024
O. Wolfson
Creating a polished, professional-quality cinema experience requires careful attention to both the video and audio formats. When preparing video content for projection on a surround sound system in theaters, it’s essential to ensure the resolution, aspect ratio, and audio configurations are all optimized for a Digital Cinema Package (DCP). In this guide, we’ll walk through the steps we follow to prepare stereo MP4s for the cinema, focusing on video conversion, audio upscaling to Dolby Digital 5.1 surround sound, and final packaging as a DCP using DCP-O-Matic.
One of the first decisions when creating a DCP is selecting the proper video resolution. DCP supports several resolutions, each suited to specific aspect ratios and projection systems. For our project, since our source material is in 1080p (1920x1080), we typically convert it to 2K flat (1998x1080), which closely matches the original resolution and avoids unnecessary upscaling or cropping. However, DCPs can be created using a variety of resolutions depending on the original content and target output.
2K Flat (1998x1080):
2K Scope (2048x858):
4K Flat (3996x2160):
4K Scope (4096x1716):
2K Full Frame (2048x1080):
4K Full Frame (4096x2160):
Since our source material is in 1080p, we generally stick to 2K flat (1998x1080) to maintain the original quality without introducing unnecessary scaling.
The idea is to process the video first then the audio. Then merge the two files together into an MP4 file.
bashffmpeg -i video.mp4 -vf "scale=-1:1080,pad=1998:1080:(ow-iw)/2:(oh-ih)/2,fps=24" -an -c:v libx264 -pix_fmt yuv420p -preset slow -crf 18 video_2K_Flat_24fps_video_only.mp4
Here above is example FFmpeg command to convert a video to 2K flat resolution. The command scales the video to 1998x1080, adds padding if necessary to maintain the aspect ratio, and sets the frame rate to 24 fps. The -an flag removes the audio stream, ensuring that only the video is processed. This script automatically adds padding based on the aspect ratio of the original video, ensuring a smooth conversion to 2K flat resolution.
for testing purposes you can constrain the number of seconds to process by adding -t 10 to the command. This will process the first ten seconds of the video.
bashffmpeg -i video.mp4 -vf "scale=-1:1080,pad=1998:1080:(ow-iw)/2:(oh-ih)/2,fps=24" -an -c:v libx264 -pix_fmt yuv420p -preset slow -crf 18 -t 10 video_2K_Flat_24fps_video_only.mp4
One of our videos had a resolution of 3840 × 2160. The padding didnt work as expected. We had to manually add padding to the video. Below is the command we used to add padding to the video.
bashffmpeg -i 3840X2160_video.mp4 -vf "scale=1998:1080:force_original_aspect_ratio=increase,crop=1998:1080" -an -c:v libx264 -pix_fmt yuv420p -preset slow -crf 18 3840X2160_video_2K_Flat_24fps_video_only.mp4
Since we had many files to deal with we used a script to process multiple files. Below is the batch script that contains our ffmpeg command.
bash#!/bin/bash
# Input directory containing videos
input_directory="/path/to/input_videos"
# Output directory for converted videos (video-only)
output_directory="/path/to/output_videos"
# Create output directory if it doesn't exist
mkdir -p "$output_directory"
# Loop through all video files in the input directory
for file in "$input_directory"/*.mp4 "$input_directory"/*.mov; do
# Extract the filename from the input file
filename=$(basename "$file")
# Define the output file path
output_file="$output_directory/converted_${filename%.*}_video_only.mp4"
# Use ffprobe to check the resolution and aspect ratio of the video
resolution=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=p=0 "$file")
width=$(echo $resolution | cut -d',' -f1)
height=$(echo $resolution | cut -d',' -f2)
# Calculate aspect ratio
aspect_ratio=$(echo "$width / $height" | bc -l)
# Target aspect ratio for 2K flat (1998x1080) ~1.85:1
target_aspect_ratio=$(echo "1998 / 1080" | bc -l)
# ffmpeg command to process the video (video only) with padding based on its aspect ratio
if (( $(echo "$aspect_ratio > $target_aspect_ratio" | bc -l) )); then
ffmpeg -i \
-vf \
-r 24 \
-an -c:v libx264 -crf 18 -preset fast
ffmpeg -i \
-vf \
-r 24 \
-an -c:v libx264 -crf 18 -preset fast
With the visual format taken care of, the next step is transforming the audio. While standard MP4s typically come with stereo sound (2 channels), a cinema setting demands more immersive audio. That’s where Dolby Digital 5.1 comes in, offering 6 audio channels (front left, front right, center, subwoofer, surround left, and surround right).
We use the following FFmpeg command to convert the stereo mix into 5.1 surround sound:
bashffmpeg -i video.mp4 -filter_complex \
"[0:a]volume=0.5,pan=5.1|c0=FL|c1=FR|c2=0.4*FL+0.4*FR|c3=0.8*FL+0.8*FR|c4=FL|c5=FR" \
-ac 6 -ar 48000 -b:a 640k _audio_5.1_surround.ac3
This command creates 6 channels by mapping the stereo audio to surround sound, ensuring that the audience experiences audio from multiple directions, enhancing the cinematic feel.
A helpful utility to check the audio channels are ffprobe. Below is an example of how to use ffprobe to check the audio channels of a video file.
bashffprobe -v error -select_streams a:0 -show_entries stream=channels -of default=noprint_wrappers=1:nokey=1 video.mp4
The output will show the number of audio channels in the video file. In this case, we are looking for 6 channels (5.1 surround sound).
bash6
I also used the following command to split the audio channels into separate WAV files for testing purposes. I can bring these files into an audio editing software to verify the audio channels.
bashffmpeg -i video-surround-final-ac3.mp4 -filter_complex \
"[0:a]channelsplit=channel_layout=5.1[left][right][center][lfe][left_surround][right_surround]" \
-map "[left]" left.wav \
-map "[right]" right.wav \
-map "[center]" center.wav \
-map "[lfe]" lfe.wav \
-map "[left_surround]" left_surround.wav \
-map "[right_surround]" right_surround.wav
Now that we have the video converted to 2K flat resolution and the audio transformed into Dolby Digital 5.1 surround sound, the next step is to merge the two files into a single MP4 file. We use FFmpeg to combine the video and audio streams:
bashffmpeg -i video_2K_Flat_24fps_video_only.mp4 -i video_audio_5.1_surround.ac3 -c:v copy -c:a copy video_2K_Flat_24fps_5.1_surround.mp4
After converting the video to a DCP-compatible resolution and upscaling the audio to 5.1 surround sound, the final step is packaging everything into a Digital Cinema Package (DCP). We use DCP-O-Matic, a user-friendly tool for converting videos into the DCP format, to handle this step.
Here’s how to package the final video and audio files:
Preparing content for cinema involves careful conversion of both video and audio formats to meet DCP standards. By converting our 1080p stereo MP4s to a 2K flat resolution and transforming the audio into Dolby Digital 5.1 surround, we create a polished, theater-ready product. DCP-O-Matic simplifies the final packaging process, making it easy to deliver high-quality content to cinemas worldwide.
Whether you're working with 1080p, widescreen content, or full-frame 4K material, choosing the correct resolution and audio setup is essential for ensuring a seamless cinema experience.
The expected delivery format for a DCP (Digital Cinema Package) is typically a portable hard drive formatted in the following way:
File System: EXT2 or EXT3 (Linux file systems) are the most commonly accepted formats. This ensures compatibility with the digital cinema servers (media block) used in most theaters.
Drive Type:
Partition Scheme: The drive should use Master Boot Record (MBR) for broader compatibility with servers.
Drive Size: Ensure that the drive size is sufficient for the DCP, which can range from several GB to hundreds of GB, depending on the film length and quality (e.g., 2K vs. 4K).
Delivery: DCPs are often delivered in a pelican case or similar protective casing to safeguard the drive during transportation.
By following these guidelines, you ensure your DCP is compatible with most digital cinema servers worldwide.