Home > Debian, Fedora, Gentoo, Linux, Tutorial, Ubuntu, Windows > Recording and encoding a radio streaming.

Recording and encoding a radio streaming.

Hello! Today we will see how to record a radio streaming. This tutorial can be used in Linux and Windows because we are going to use tools present in both “OSes”.

Image Hosted by ImageShack.us

The tools used are mplayer and lame encoder. We are going to use the command line version because, in my opinion, a radio streaming is not supposed to be a “once life time event” but a regular event so we have to schedule it.

We have to create two scripts: one for recording and one for encoding.
I will show you the Windows batch files because they’re really tricky (unix shell >> dos shell) and we have to use some workaround.

record.bat:

@ ECHO OFF
ECHO Starting recording at:
date /T
mplayer.exe -dumpstream http://live.mediaserver.kataweb.it/capital

endode.bat:

@ ECHO OFF
mplayer.exe -vo null -vc null -af volume=0,resample=22050:0:1 -ao pcm:fast:file="outfile.wav" stream.dump
del stream.dump
lame.exe outfile.wav outfile.mp3 -V9 -q9 -B128 --lowpass 15 --resample 24
for /f "tokens=1-5 delims=/ " %%d in ("%date%") do rename "outfile.mp3" capitalisti-%%e-%%d-%%f.mp3
del outfile.wav

Just some quick advice:
- the option -af in mplayer is useful if you had to record a really long radio show so you need to resample it in 22.95 MHz beacuse if you don’t use it you will have really big .wav file (in my case a 3 hour long show was 2Giga reduced to 1G resampling).
- my lame configuration is just a try. In that way I can obtain a small file without losing a big amount of quality but my advice is to RTFM lame P

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blinkbits
  • Bumpzee
  • Technorati
  • BlinkList
  • Furl
  • Rec6
  • Simpy
  • Slashdot
  • Facebook
  • LinkedIn
  • TwitThis
  1. October 2nd, 2008 at 12:36 | #1

    It has long been looking for this information, Thank you for your work.

  2. November 6th, 2008 at 01:20 | #2

    It’s fun. ATP Subscribe to the RCC perhaps

  1. No trackbacks yet.