Pipe FFmpeg Raw Video to Another Tool on Windows
This article explains how to write and execute an FFmpeg command on Windows to output raw, uncompressed video frames and pipe them directly into another command-line tool. You will learn the correct parameters to format the raw video stream, how to redirect the output to stdout, and how to avoid common Windows-specific piping pitfalls.
To pipe raw video from FFmpeg to another executable on Windows, you
must configure FFmpeg to output uncompressed pixel data to the standard
output (stdout) channel using the pipe operator
(|).
The Basic Command Structure
The standard command template for piping raw video in Windows is:
ffmpeg -i input.mp4 -f rawvideo -pix_fmt rgb24 - | target_tool -Parameter Breakdown
-i input.mp4: Specifies your source video file.-f rawvideo: Forces FFmpeg to use the raw video muxer. This strips away container formats (like MP4 or MKV) and outputs only the raw, sequence-of-bytes pixel data.-pix_fmt rgb24: Defines the pixel format. Raw video has no headers to tell the receiving tool how the pixels are structured, so you must explicitly define the color space. Common choices arergb24(8 bits per red, green, and blue channel) oryuv420p.-(the single dash): Instructs FFmpeg to send the output tostdoutinstead of writing to a physical file on your hard drive.|(the pipe operator): A Windows command-line operator that intercepts thestdoutof FFmpeg and feeds it directly into thestdin(standard input) of the next command.target_tool -: The executable receiving the raw video. The trailing dash-is commonly used by command-line utilities to indicate they should read input fromstdin.
Important Windows Compatibility Notes
When piping raw binary data on Windows, the environment you use to run the command matters:
Use Windows Command Prompt (
cmd.exe): CMD handles raw binary pipes natively without altering the byte stream.Avoid Windows PowerShell: By default, PowerShell attempts to parse pipeline data as text strings rather than raw bytes. This process corrupts the raw video stream. If you must use PowerShell, you have to bypass its default behavior by calling cmd directly:
cmd /c "ffmpeg -i input.mp4 -f rawvideo -pix_fmt rgb24 - | target_tool -"
Practical Verification Example
You can test your pipe locally by sending raw video from one FFmpeg process to FFplay (FFmpeg’s media player). Because raw video has no metadata, you must explicitly tell the receiving tool the resolution and pixel format of the incoming stream:
ffmpeg -i input.mp4 -f rawvideo -pix_fmt rgb24 - | ffplay -f rawvideo -pixel_format rgb24 -video_size 1920x1080 -i -In this test, FFmpeg decodes input.mp4 to raw RGB24
bytes, pipes it through CMD, and FFplay reads, reconstructs, and
displays the raw video stream in real-time.