Dump RTMP Live Stream to FLV with FFmpeg

This guide provides a straightforward, step-by-step tutorial on how to use FFmpeg to capture a live RTMP stream and save it directly into an FLV container. You will learn the exact command-line syntax required to dump the stream without re-encoding, preserving the original quality of the broadcast while keeping CPU usage to an absolute minimum.

The Basic Command

To dump a live RTMP stream directly to an FLV file, run the following FFmpeg command in your terminal:

ffmpeg -i "rtmp://example.com/live/stream_key" -c copy output.flv

Command Breakdown

Handling Unstable Connections

Live streams can sometimes suffer from network jitter or brief disconnects. To make your dumping process more resilient, you can add parameters to handle timeouts and force the output format:

ffmpeg -rw_timeout 10000000 -i "rtmp://example.com/live/stream_key" -c copy -f flv output.flv