VLC Command Line: cvlc, Streaming & Automation

Advanced Last updated: Applies to: Windows / macOS / Linux · VLC 3.0.x

Behind the GUI, VLC is a full command-line media engine. The headless binary cvlc (or vlc --intf dummy) lets you script playback, run a streaming server, convert batches, and even control a running instance over a text interface. If you manage media on a server or NAS, this is the guide that unlocks VLC for you.

Step 1 — Basic playback from the terminal

  1. On Linux/macOS, cvlc is installed with VLC. On Windows, use the full path: "C:\Program Files\VideoLAN\VLC\vlc.exe" with the --intf flags below.

    The binary is available.

  2. Play a file headless: cvlc /path/to/movie.mkv --intf dummy --play-and-exit

    VLC plays the file and exits without any window.

  3. List the file’s streams without playing: cvlc movie.mkv --intf dummy --play-and-exit -vvv 2>&1 | grep -i "stream 0"

    Codec and stream info is printed.

Note--play-and-exit is the workhorse flag for scripts: VLC quits when the file ends, so cron/systemd jobs terminate cleanly.

Step 2 — Stream a file or device to the network

  1. HTTP stream: cvlc movie.mkv --sout "#standard{access=http,mux=ts,dst=:8080}"

    VLC serves the stream on port 8080; any player can open http://:8080.

  2. Live webcam/device stream: cvlc -vvv v4l2:///dev/video0 --sout "#transcode{vcodec=h264,vb=1200}:standard{access=http,mux=ts,dst=:8090}" (Linux) or dshow:// (Windows).

    A live H.264 stream is broadcast.

  3. Stop with Ctrl+C — VLC cleans up the listener.

    The stream ends.

Step 3 — Batch convert with one command

  1. Single file: cvlc input.mkv --sout "#transcode{vcodec=h264,acodec=mpga,vb=2000}:standard{mux=mp4,dst=output.mp4}" --sout-keep --play-and-exit

    The file is converted.

  2. Loop over a folder: for f in *.mkv; do cvlc "$f" --sout "#transcode{...}:standard{mux=mp4,dst=${f%.mkv}.mp4}" --play-and-exit; done

    Every file is converted in sequence.

  3. Check the ffmpeg alternative first for heavy jobs — cvlc encodes in software and is slower than ffmpeg with hardware encoders.

    You chose the right tool for the job.

Step 4 — The rc interface for remote control

  • Start with a control channel: cvlc --extraintf rc --rc-host 127.0.0.1:4212 movie.mkv
  • Connect from another terminal: telnet 127.0.0.1 4212 (Linux/macOS) or use a telnet client on Windows.
  • Commands: play, pause, stop, seek 120, volume 80, next, prev, info, playlist.
  • Scriptable via a file: printf "play\nvolume 60\n" | cvlc --extraintf rc --rc-fake-tty movie.mkv

Frequently asked questions

What is the difference between vlc and cvlc?
cvlc is the same binary with no GUI interfaces loaded — it exists on all platforms but is a wrapper on some Linux packages. On Windows, add --intf dummy to the vlc.exe call for the same effect.
Can VLC stream my webcam to a webpage?
Yes — the device-stream example in Step 2 serves an HTTP stream, and you can embed it with an HTML5 video tag pointing at the URL (TS mux works in most browsers).
Why is CLI conversion slower than the GUI?
It is not — both use the same software encoder. The GUI just looks friendlier. If speed matters, use ffmpeg with GPU encoders.
How do I find all VLC CLI options?
Run cvlc --longhelp (or --help --help-verbose) and pipe to a file: cvlc --longhelp > vlc-help.txt. The per-module options are listed under "Stream output" sections.