Recording Internet Streams
with FFmpeg

Let’s say you need to record a live internet stream and listen back to it later. You could buy some dedicated software, or you could use the free FFmpeg command line tool. It’s super easy. It supports all standard Icecast and Shoutcast streams.

Here’s how to do it…

Step 1: Download the software

FFmpeg is open source software, so anyone can download and run it. On Windows, the official builds are distributed by Zeranoe. From the Zeranoe downloads page, select the latest “64-bit Static” build.

FFmpeg Download Screenshot

This gives you zip file file which contains all the decoding and encoding libraries you need, compatible with Windows 64-bit machines (‘Static’ means it doesn’t rely on external libraries).

Step 2: Extract the ZIP

Extract the downloaded ZIP file and find the file “ffmpeg.exe” (in the bin/ directory). Copy this EXE file to a new folder on your local hard drive (e.g. C:\StreamRecorder).

FFmpeg Extract Screenshot

Step 4: Open the Command Prompt

Find the Windows Command Prompt and run it. You can do Start > Run > cmd.exe or just search for it in the Start Menu.

Then, change your directory to where ffmpeg.exe lives (e.g. cd C:\StreamRecorder).

Step 5: Run the command

The actual command is super simple. Here’s an example with the Hope MP3 stream:

ffmpeg.exe -y -i http://stream2.cnmns.net/hope-mp3 hopestream-latest.mp3

FFmpeg CMD Launch Screenshot

The output of this command shows you the status.

Automatically Recording Schedules

If you want to automatically record a specific time period, setup a scheduled task in Windows Task Scheduler. To stop the recording, set the option “Set the task if it runs longer than”.

Command Explanation

Here’s what the command options signify:

  • -y
    Allows existing files to be automatically rewritten.
  • -i http://stream2.cnmns.net/hope-mp3
    This is the stream URL to be recorded. Set it to any Icecast or Shoutcast internet stream URL.
  • hopestream-latest.mp3
    This is the output filename

 

Get the Broadcast Technology Newsletter

Sign up for the email newsletter about media and technology. Sent irregularly. No spam.

I'm Anthony Eden, and I'm a IT Professional, Broadcast Technician, Software Developer, and Solutions Engineer. I've been working in broadcast media since 2008, and developing software and websites for just as long. Right now, I provide freelance services through Media Realm - in particular, to the media and not-for-profit industries.

Follow Anthony on Twitter: @anthony_eden