Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A PLS file can tell VLC and other players to start playing an online radio. VLC is also capable of recording an audio stream to a file. Currently I tell VLC to do this manually and it requires many clicks. I would like to automate this task by creating a PLS or other kind of file that do that for me. I will just have to open the file in VLC and it will start to record the stream. Is that possible? Or will I have to create a macro in AutoHotKey? Or there is another tool that could help me?

share|improve this question
I saved the current playlist to a XSPF file, and opening that on a text editor I could see that it contained all the relevant information. But when opening such playlist on VLC no file is written, the stream is simply playbacked. – Jader Dias May 23 '11 at 0:50
up vote 5 down vote accepted

The easiest way to control VLC streaming is from the command line. While you could learn the syntax needed to control VLC in this manner, you can make the GUI do most of the work for you.

  1. Open the Media menu and select Streaming...
  2. Select any file or network stream, it doesn't matter which one. You'll still have to specify the exact stream you want to record later.
  3. Choose Stream.
  4. The Source window will appear, with the location of your stream pre-filled. Click Next.
  5. The Destination screen appears now. Under Destinations, File should be selected by default. Click Add to the right of that drop-down box.
  6. Choose the filename and location where you want to save the stream. You can select the right place now, or change it in the actual command to VLC.
  7. Choose the desired output format in the Transcoding section.
  8. Click Next to advance to the Miscellaneous Options screen.
  9. At the bottom there is a box labeled Generated stream output string. That is the command string you need to pass to VLC to replicate the output operation you just described. An example is highlighted in blue below:


Go ahead and copy that string. At the simplest, you can create a shortcut somewhere like your desktop that will run VLC and start recording the stream. Just copy the existing VLC shortcut by right-clicking on the VLC icon on your desktop, selecting Send to, and choosing Desktop (as shortcut), then right-click on the new shortcut and click Properties. In the Target box, add a space after the closing quote at the end, and then enter the address of the stream you want to record. Then, add another space and paste in the stream output string you copied earlier. If you need to change the save location, its located right after {dst= and before the closing } in the string. The whole thing should look something like this:

"C:\Program Files\VideoLAN\VLC\vlc.exe" :sout=#transcode{vcodec=theo,vb=800,scale=1,acodec=vorb,ab=128,channels=2,samplerate=44100}:file{dst=C:\\Users\\Patches\\Videos\\unicorns.ogg} :no-sout-rtp-sap :no-sout-standard-sap :sout-keep

Now you can just double-click that icon (or launch it with a hotkey) to record the stream.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .