HOWTO Dump audio streams from the Internet

From LinuxReviews
Jump to navigationJump to search

You may want to save audio from radio streams or even video streams for later so you can jump in the file, cut, edit or just re-listen when you want to.

The simplest way of doing this from the command-line is to use ffmpeg. Simply specify the input-stream you'd like with -i for input and add -vn for no video and finish with the output filename you want.

To dump the radio you could use the command:

Shell command(s):
ffmpeg -i -vn mymusicfile.mp3

That would automatically transcode the music to MP3. Add -c:a copy to tell ffmpeg to just plainly copy the audio and use the same extension as the stream to avoid any transcoding:

Shell command(s):
ffmpeg -i -vn -c:a copy mymusicfile.ogg

Saving lossy streams in their original format is generally better than transcoding to another format as the end-result will be worse than the original stream.