Skip to content

Recipes

Outcome: two jobs done end to end — a folder of files converted in one pass, each output probed — and a third job, ripping a CD, laid out with its one unprovable rung clearly marked.

Convert a whole folder

Chapter 8's command converts one file. A folder is the same command inside a loop — the pattern every scripted use of VLC grows into. The lab ran it over a folder holding the fixture video and the fixture tone, extracting each file's audio as a 96-kilobit MP3 (transcript t11):

for f in batch-in/*; do
  cvlc -I dummy "$f" \
    --sout "#transcode{vcodec=none,acodec=mp3,ab=96}:std{access=file,mux=raw,dst=batch-out/$(basename "$f").mp3}" \
    vlc://quit
done

And the outputs, probed rather than assumed:

parade.mp4.mp3    mp3   11.96 s   143,569 bytes
tone.flac.mp3     mp3    8.05 s    96,549 bytes

Both durations match their sources; both sizes match 96 kilobits for their length; the video's contribution is its tone, the tone's is itself. Expect chapter 8's two findings to come with the batch: the alarming vcodec=none error lines (ten of them for the video, six for the audio file — count the outputs, not the error lines), and no tags on the results. Note also the recipe's blunt edge: the output names keep the old suffix (parade.mp4.mp3). A loop tidier about names is a shell exercise, left to the reader's taste; the media work is identical.

Rip a CD you own

A CD is just another thing VLC opens: this build ships the module for it — cdda, "Audio CD input", named in the module list (transcript t12). The shape of the job is chapter 8 with a different door:

# The shape of it — the lab had no CD drive to run this against.
cvlc -I dummy cdda:///dev/sr0 \
  --sout '#transcode{vcodec=none,acodec=mp3,ab=192}:std{access=file,mux=raw,dst=track.mp3}' \
  vlc://quit

Honesty about rungs: the sout half of that command is the exact machinery chapter 8, and the batch recipe above, proved against files, and the cdda module is present in this build. The last rung — a physical disc in a physical drive, its table of contents read, track boundaries and CD-Text/online titles gathered — the lab could not run, having no drive at all; it is documented behaviour, and this guide labels it so rather than dressing the command above as a transcript. In the window, the same job is Media → Open Disc → Audio CD, then Convert/Save per track — and a folder of results from either route still needs its tags written by a tagging tool, per chapter 8.

Only rip discs you own, for your own listening: the copy is a convenience the law in most places allows a buyer, and a lending library's disc is not yours to keep. That line is chapter 1's privacy-and-permission line, drawn in its second place.

A still from a film

One small job that rounds out the toolkit: a screenshot from a playing video. In the window it is Video → Take Snapshot, and the still lands in your pictures folder. The options behind it are real entries in the help (transcript t12): --snapshot-path where they go, --snapshot-prefix how they're named, --snapshot-format png, jpg or tiff. The lab leaves this one documented: its video output was a dummy that throws pictures away, which is a poor camera.