Create a Negative Film Effect with FFmpeg Negate Filter

This guide explains how to use FFmpeg's built-in negate video filter to invert colors and produce a negative film effect. You will learn the basic command-line syntax for full-color inversion, how to combine the filter with other adjustments to mimic vintage film stock, and how to control specific color channels or preserve audio during processing.

Basic Color Inversion

The most straightforward way to create a negative effect is to apply the negate filter using the -vf (video filter) flag. This operation inverts all color components of the video stream.

ffmpeg -i input.mp4 -vf "negate" -c:a copy output.mp4

In this command:

  • -i input.mp4: Specifies the input video file.
  • -vf "negate": Applies the negative filter to every frame of the video.
  • -c:a copy: Copies the audio stream directly without re-encoding, preserving quality and speeding up processing.
  • output.mp4: The resulting output file.

Creating a Black-and-White Negative Film Effect

Traditional film negatives are often monochrome. To create a classic black-and-white negative, chain the format=gray or hue=s=0 filter with the negate filter.

ffmpeg -i input.mp4 -vf "hue=s=0,negate" -c:v libx264 -crf 18 -c:a copy output.mp4

Here, hue=s=0 strips the color saturation first, and negate inverts the resulting grayscale luminance values. The -crf 18 option ensures high visual quality in the output.

Working with Alpha Channels

If your input video contains an alpha (transparency) channel (such as ProRes 4444 or VP9 with transparency), the negate filter leaves the alpha channel untouched by default. If you need to invert the transparency mask as well, set the negate_alpha parameter to 1.

ffmpeg -i input_with_alpha.mov -vf "negate=negate_alpha=1" -c:v prores_ks -profile:v 4 output.mov

Selective Component Negation

The negate filter supports a components option, which lets you selectively invert specific color planes (such as Y, U, V, or R, G, B) using a bitmask:

  • 1: First component (e.g., Y / Luma or Red)
  • 2: Second component (e.g., U / Cb or Green)
  • 4: Third component (e.g., V / Cr or Blue)
  • 8: Fourth component (Alpha)

For example, to invert only the chroma (color) channels while keeping the original brightness (luma) intact in a standard YUV video:

ffmpeg -i input.mp4 -vf "negate=components=6" -c:a copy output.mp4

In this case, 6 (the sum of 2 and 4) instructs the filter to invert only the second and third components, producing an unnatural, surreal color shift.