Friday, February 8, 2013

Record Internet Radio

VLC as a Recorder
Tip: You can record without a computer using an online service. See Record Radio Online.

Tip: You can transcode streams to make them easier to record. See Transcode with VLC.

VLC media player (free open source cross-platform multimedia player and framework) is a great way to listen to Internet radio (streams). All you need is a streaming URL (often obtainable from the source website; e.g., from KUSC) which you open in VLC with Media > Open Network Stream. To save a source for future listening while it is playing, just drag the Title and drop it onto the Media Library.

Recording a source while it's playing is quite easy: View > Advanced Controls to make the recording control available; click on the red record button circle to record; and click again to stop recording. The recording file will be appropriately named and (on Windows) saved in your Music folder.

Scheduling recordings for times when you're not at your computer can be done with (a) the Task Scheduler built into Windows and (b) the VLC command line interface. Start by testing your recording command in a Command Prompt window, with the following four elements separated by spaces:
  1. Complete path to vlc.exe; e.g.,
    "C:\Program Files\VideoLAN\VLC\vlc.exe"
  2. Stream URL; e.g.,
  3. Recording duration in seconds; e.g., (for 60 mins)
    --run-time 3600 vlc://quit
  4. VLC record parameters; e.g.,
The record parameters above assume the stream is in the most universal MP3 format. Where a source has multiple stream formats available, choose MP3 to avoid problems; to try recording some other format, use the appropriate file extension (instead of .mp3). You can of course change the file name from Recording to whatever you might prefer. To create unique file names with date and time, see VLC Documentation: Format String; e.g., Recording_%Y%m%d_%H%M

Complete example with date and time (single line): ‑‑run‑time 3600 vlc://quit ‑‑sout‑file‑format ‑‑sout="#std{access=file,mux=raw,dst=The_Record_Shelf_%Y‑%m‑%d_%H%M_(KUSC).mp3}"

Putting them all together on a line in a Command Prompt window should launch the VLC GUI and create the recording file. After VLC has completed the recording and quit, double-click on the recording file to play it, or open it in VLC. When this is working properly, you can move on to scheduling:
  1. Open Task Scheduler
  2. Click Create Task
  3. On the General tab:
    1. Enter Name (e.g., My Stream)
    2. Select Run whether user is logged on or not
  4. On the Triggers tab, click New:
    1. Enter desired schedule
    2. Check Stop task if it runs longer than: and enter twice desired recording duration
    3. Make sure Enabled is checked
    4. Click OK
  5. On the Actions tab, click New:
    1. Action: Start a program
    2. Program/script: complete path to vlc.exe (1st item above); e.g.,
       "C:\Program Files\VideoLAN\VLC\vlc.exe"
    3. Add arguments (optional): 2nd and 3rd items separated by a space; e.g., --run-time 3600 vlc://quit --sout="#std{access=file,mux=raw,dst=Recording.mp3}"
      (Note: Display of line above may be truncated!)
  6. On the Conditions tab, set whatever options you wish
  7. On the Settings tab:
    1. Set Stop the task if it runs longer than: to twice desired recording duration
    2. Check If the running task does not end when requested, force it to stop
  8. Click OK to save the task
  9. Test the task by selecting it in the Task Scheduler Library:
    1. Click Run to start the task
    2. Click End to stop the task
    3. Check recorded file
  10. Close Task Scheduler





No comments:

Post a Comment