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

Important Windows Compatibility Notes

When piping raw binary data on Windows, the environment you use to run the command matters:

  1. Use Windows Command Prompt (cmd.exe): CMD handles raw binary pipes natively without altering the byte stream.

  2. 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.