Export Uncompressed TGA Frames with FFmpeg
This article provides a quick, step-by-step guide on how to extract individual, uncompressed video frames in the Targa (.tga) format using FFmpeg. You will learn the exact command-line syntax required to disable Run-Length Encoding (RLE) compression, control the frame extraction rate, and define custom output naming conventions for seamless integration into professional video editing and visual effects workflows.
The Basic Command for Uncompressed TGA Export
To export every frame of a video as an uncompressed Targa image, use the following FFmpeg command:
ffmpeg -i input.mp4 -c:v targa -rle 0 frame_%04d.tgaCommand breakdown: * -i input.mp4:
Specifies the input video file. * -c:v targa: Tells FFmpeg
to use the Targa video encoder. * -rle 0: Disables
Run-Length Encoding (RLE) compression, ensuring the output TGA files
remain completely raw and uncompressed. * frame_%04d.tga:
Defines the output file name template. The %04d argument
creates a sequential, four-digit zero-padded number (e.g.,
frame_0001.tga, frame_0002.tga).
Exporting a Specific Frame Rate
If you do not want to export every single frame of the video, you can
limit the extraction rate using the -r option. For example,
to export exactly one frame per second:
ffmpeg -i input.mp4 -r 1 -c:v targa -rle 0 frame_%04d.tgaExporting from a Specific Time Range
To avoid cluttering your storage, you can define a specific segment
of the video to export using -ss (start time) and
-t (duration) or -to (end time):
ffmpeg -ss 00:01:30 -i input.mp4 -t 10 -c:v targa -rle 0 frame_%04d.tga-ss 00:01:30: Starts the extraction at 1 minute and 30 seconds.-t 10: Limits the extraction duration to 10 seconds.
Preserving Transparency (Alpha Channel)
The Targa format supports alpha channel transparency. If your source
video has an alpha channel (such as Apple ProRes 4444 or WebM with
transparency) and you want to preserve it, ensure you force the pixel
format to rgba:
ffmpeg -i input_with_alpha.mov -c:v targa -pix_fmt rgba -rle 0 frame_%04d.tga