Capture RTMP Stream to stdout Using FFmpeg on Windows

This article explains how to capture a live RTMP stream using FFmpeg on Windows and output the raw data stream directly to standard output (stdout). Redirecting stream data to stdout is a powerful technique that allows you to pipe media data directly into other command-line tools, scripts, or media players in real-time without saving temporary files to your hard drive.

To capture an RTMP stream and send it to stdout, you must configure FFmpeg to suppress its own log messages (which are normally sent to stderr but can sometimes interfere with stdout redirection depending on your shell setup) and specify a container format, since stdout does not have a file extension to tell FFmpeg which muxer to use.

Use the following command syntax in Windows Command Prompt (cmd) or PowerShell:

ffmpeg -loglevel quiet -i "rtmp://your-rtmp-server-url/live/stream_key" -f mpegts -

Command Breakdown:

Piping the Output

Once the stream is written to stdout, you can pipe it directly into another utility. For example, to play the incoming RTMP stream in real-time using VLC media player via stdout, run:

ffmpeg -loglevel quiet -i "rtmp://your-rtmp-server-url/live/stream" -f mpegts - | vlc -