Export Uncompressed TGA Frames with FFmpeg

Exporting video frames as uncompressed Targa (TGA) images using FFmpeg is a common workflow in video post-production, VFX, and animation pipelines requiring lossless visual fidelity. This guide explains how to use the FFmpeg command line to extract entire videos, specific segments, or single frames into raw, uncompressed 24-bit and 32-bit .tga sequence files.

Basic Frame Export Command

To convert an entire video into a sequence of uncompressed TGA frames, specify the targa video codec and provide an output pattern for the file naming:

ffmpeg -i input.mp4 -c:v targa output_%04d.tga

In this command:

  • -i input.mp4 defines the input file.
  • -c:v targa selects the Truevision Targa video encoder.
  • output_%04d.tga formats the output sequence using four zero-padded digits (e.g., output_0001.tga, output_0002.tga).

Ensuring Frames Are Fully Uncompressed

By default, FFmpeg's targa encoder writes raw, uncompressed raster data unless Run-Length Encoding (RLE) is explicitly requested. To guarantee standard 24-bit uncompressed RGB color data without accidental compression or color space discrepancies, define the pixel format explicitly:

ffmpeg -i input.mp4 -c:v targa -pix_fmt bgr24 frame_%05d.tga

The Targa format natively stores color channels in blue-green-red order (bgr24).

Preserving Alpha Channels (32-Bit Uncompressed)

If the source video contains transparency (such as ProRes 4444 or VP9 with alpha) and you need to preserve the alpha channel in the exported TGA files, switch the pixel format to bgra:

ffmpeg -i input_with_alpha.mov -c:v targa -pix_fmt bgra frame_%04d.tga

This exports 32-bit uncompressed Targa images with 8 bits each for blue, green, red, and alpha.

Exporting a Specific Time Range

To prevent filling disk space with unnecessary frames, export only a specific segment by using the start time (-ss) and duration (-t) or end time (-to) parameters:

ffmpeg -ss 00:01:15 -i input.mp4 -to 00:01:20 -c:v targa -pix_fmt bgr24 clip_%04d.tga

Placing -ss before -i enables fast seeking directly to the specified timestamp.

Exporting a Single Uncompressed Frame

To extract only one frame at a designated timestamp, combine -ss with -frames:v 1:

ffmpeg -ss 00:02:30 -i input.mp4 -frames:v 1 -c:v targa -pix_fmt bgr24 single_frame.tga