Convert Rec 601 to Rec 709 Using FFmpeg Colormatrix

This article explains how to convert video color space from Rec. 601 (standard definition) to Rec. 709 (high definition) using the colormatrix filter in FFmpeg. You will learn the exact command-line syntax, understand the filter parameters, and see how to correctly tag the output file's color metadata to ensure accurate playback across different media players.

To convert the color space of a video from Rec. 601 to Rec. 709, you must transform the actual pixel values using the colormatrix video filter and then tag the output stream with the correct metadata.

The FFmpeg Command

Run the following command in your terminal to perform the conversion:

ffmpeg -i input.mp4 -vf "colormatrix=bt601:bt709" -colorspace bt709 -color_trc bt709 -color_primaries bt709 -c:a copy output.mp4

How the Command Works

  • -i input.mp4: Specifies the source video file that is currently in the Rec. 601 color space.
  • -vf "colormatrix=bt601:bt709": Applies the video filter. The colormatrix filter takes two main arguments separated by a colon: the source color space (bt601) and the target color space (bt709). This physically recalculates the YUV pixel values.
  • -colorspace bt709: Sets the color space metadata in the output container.
  • -color_trc bt709: Sets the color transfer characteristics metadata to Rec. 709.
  • -color_primaries bt709: Sets the color primaries metadata to Rec. 709.
  • -c:a copy: Copies the audio stream without re-encoding to save time and preserve quality.
  • output.mp4: The path for the newly generated file.

Why Metadata Tagging is Necessary

Applying the colormatrix filter only changes the underlying pixel data. Without the -colorspace, -color_trc, and -color_primaries flags, media players may not realize the color space has changed. Explicitly tagging the output ensures that web browsers, operating systems, and media players read the file correctly and do not apply an incorrect color matrix during playback.