Record Internet Radio Streams with FFmpeg on Linux

Recording a live internet radio stream on Linux is a straightforward process when using FFmpeg, a powerful command-line tool for handling multimedia data. This article provides a quick overview of the exact command needed to capture audio streams, explains how the command works breakdown by breakdown, and offers tips on automating your recordings for scheduling purposes.

To record a live internet radio stream, you need the direct URL of the audio stream (often ending in .mp3, .aac, or .pls) and the FFmpeg package installed on your Linux system. The basic command structure captures the live network data and saves it directly to your local storage without re-encoding, preserving the original audio quality.

The standard command to record a stream is:

ffmpeg -i "http://streaming.radio.com/stream.mp3" -c copy output.mp3

Here is what each part of that command does:

If you want to limit the recording to a specific duration, you can add the -t flag. For example, to record exactly one hour (3600 seconds), use the following command:

ffmpeg -i "http://streaming.radio.com/stream.mp3" -c copy -t 3600 output.mp3

For advanced users, this command can be paired with Linux utilities like cron or at to automate and schedule recordings of your favorite radio shows while you are away from your computer.