by Wojciech Sura

Scheduled recording internet streams

I’m a big fan of jazz. I can listen to this kind of music for hours.

One of the biggest Polish jazz composers and players, Jan “Ptaszyn” Wróblewski runs a radio show called “three-quarters of jazz” (its played in 3rd program of Polish Radio, hence the name). Unfortunately, it’s aired at 11pm, which is a little bit outside my range of consciousness.

But hey, I have a few GHz at my disposal. Let’s make use of them and ask the computer to record the show for me (fortunately, 3rd program of Polish Radio is streamed through the Internet as well).

My program of choice is VLC Player. This inconspicuous program offers more than you might think. It’s free and you can download it from its homepage.

Let’s now prepare a batch command, which will ask VLC to record the show. It looks like the following:

[shell]cd "C:\Program Files\VideoLAN\VLC"
"C:\Program Files\VideoLAN\VLC\vlc.exe" mms:// –run-time=4200 –sout "#transcode{acodec=mp3}:std{access=file,dst=D:\Dokumenty\Muzyka\Trojka.mp3}" vlc://quit[/shell]

Let’s break it into parts.

  • mms:// – this is the URL to stream I want to record.
  • –run-time=4200 – time of recording in seconds. I record five preceeding and five following minutes (4200 = 1:10:00)
  • –sout – tells the VideoLan to stream the output. Following string informs about streaming details.
  • #transcode{acodec=mp3} – appends a filter on the output stream, which encodes it to MP3 format.
  • :std{access=file,dst=D:\Dokumenty\Muzyka\Trojka.mp3}” – appends a filter on the stream encoded to mp3, which simply saves it to a file.
  • vlc://quit – this is actually second item in the playlist. When you ask VLC player to play this file, it’ll simply close.

The rest is simply a matter of adding an entry to Windows Scheduler.

You can read more about configuring streaming in the command line in VLC documentation.

Bonus chatter: If you want the computer to shut down after recording the stream, add another (carefully timed) entry to Windows Scheduler and call:

[shell]shutdown /s /t 0[/shell]

  • Zippydsmlee

    The trouble is I record 30min continuous segments for 8 hours a day……