Tuesday, February 27, 2018

Transcode with VLC

VLC as a Recorder
In addition to being a great way to play video and audio content, VLC is also a great way to record Internet streams (e.g., radio) -- see Record Internet Radio.

MP3 streams are the simplest to record because they can just be dumped to a "raw" file, but that often won't work with other types of streams. The solution is to transcode (convert) streams into MP3 format with VLC before writing them to a "raw" file. It's also a good way to reduce the bitrate of MP3 streams for speech.

Example of VLC output without transcoding:
--sout="#std{access=file,mux=raw,dst=Recording.mp3}"

Corresponding example with transcoding for speech
(bitrate 48 Kbps, stereo, speech sample rate):
‑‑sout="#transcode{acodec=mp3,ab=48,channels=2,samplerate=22050}:std{access=file,mux=raw,dst=Recording.mp3}"

Corresponding example with transcoding for music
(bitrate 128 Kbps, stereo, music sample rate):
‑‑sout="#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=raw,dst=Recording.mp3}"

For the complete recording procedure, see Record Internet Radio.