Extract Raw VP9 Video Streams Using FFmpeg

Extracting raw video streams encoded with the VP9 codec (using libvpx-vp9) is a common task when analyzing video bitstreams, performing quality assessments, or preparing files for hardware decoder testing. This article provides a straightforward, step-by-step guide on how to use FFmpeg to demux and extract VP9 video streams from container files like WebM or MP4 into raw IVF (Indeo Video Format) files without re-encoding.

Why Use the IVF Container for Raw VP9?

Unlike H.264 or H.265, which have standard Annex-B byte streams (allowing for raw .h264 or .hevc files), VP9 does not have a widely supported raw byte stream format. Instead, raw VP9 frames are typically wrapped in a lightweight IVF (.ivf) container. IVF provides just enough structure—specifically, a simple header with frame sizes and timestamps—to allow decoders to parse the raw VP9 stream.

The FFmpeg Command to Extract VP9

To extract the VP9 stream without re-encoding, use FFmpeg’s stream copy functionality. Run the following command in your terminal:

ffmpeg -i input.webm -c:v copy -an output.ivf

Command Breakdown

Extracting to a Raw VP9 Byte Stream

If your workflow specifically requires a raw stream without the IVF header (for custom parser development, for example), you can force FFmpeg to output a raw video payload:

ffmpeg -i input.webm -c:v copy -an -f rawvideo output.vp9

Note: Most media players and standard decoders cannot play back raw .vp9 files directly without the IVF header, so using the .ivf method is highly recommended for almost all practical use cases.