VLC Command Line: cvlc, Streaming और Automation
GUI के पीछे, VLC एक पूरा command-line media engine है। Headless binary cvlc (या vlc --intf dummy) आपको playback को script करने, एक streaming server चलाने, batches convert करने, और यहाँ तक कि किसी text interface के माध्यम से किसी running instance को control करने देता है। यदि आप किसी server या NAS पर media manage करते हैं, तो यह वह गाइड है जो VLC को आपके लिए unlock करता है।
Step 1 — Basic playback from the terminal
Linux/macOS पर, cvlc VLC के साथ install होता है। Windows पर, full path use करें: "C:\Program Files\VideoLAN\VLC\vlc.exe" नीचे दिए --intf flags के साथ।
Binary available है।
Headless file play करें:
cvlc /path/to/movie.mkv --intf dummy --play-and-exitVLC file play करता है और बिना किसी window के exit हो जाता है।
Play किए बिना file की streams को list करें:
cvlc movie.mkv --intf dummy --play-and-exit -vvv 2>&1 | grep -i "stream 0"Codec और stream info print होती है।
Step 2 — Stream a file or device to the network
HTTP stream:
cvlc movie.mkv --sout "#standard{access=http,mux=ts,dst=:8080}"VLC stream को port 8080 पर serve करता है; कोई भी player http://
:8080 खोल सकता है। Live webcam/device stream:
cvlc -vvv v4l2:///dev/video0 --sout "#transcode{vcodec=h264,vb=1200}:standard{access=http,mux=ts,dst=:8090}"(Linux) या dshow:// (Windows)।एक live H.264 stream broadcast होता है।
Ctrl+C के साथ रोकें — VLC listener को clean up करता है।
Stream खत्म हो जाता है।
Step 3 — Batch convert with one command
Single file:
cvlc input.mkv --sout "#transcode{vcodec=h264,acodec=mpga,vb=2000}:standard{mux=mp4,dst=output.mp4}" --sout-keep --play-and-exitFile convert हो जाती है।
Loop over a folder:
for f in *.mkv; do cvlc "$f" --sout "#transcode{...}:standard{mux=mp4,dst=${f%.mkv}.mp4}" --play-and-exit; doneहर file sequentially convert हो जाती है।
Heavy jobs के लिए पहले ffmpeg alternative check करें — cvlc software में encode करता है और hardware encoders वाले ffmpeg से slower है।
आपने काम के लिए सही tool चुना।
Step 4 — The rc interface for remote control
- एक control channel के साथ शुरू करें:
cvlc --extraintf rc --rc-host 127.0.0.1:4212 movie.mkv - किसी दूसरे terminal से connect करें:
telnet 127.0.0.1 4212(Linux/macOS) या Windows पर कोई telnet client use करें। - Commands: play, pause, stop, seek 120, volume 80, next, prev, info, playlist।
- एक file के माध्यम से scriptable: printf "play\nvolume 60\n" | cvlc --extraintf rc --rc-fake-tty movie.mkv
अक्सर पूछे जाने वाले प्रश्न
vlc और cvlc में क्या अंतर है?
क्या VLC मेरे webcam को किसी webpage पर stream कर सकता है?
CLI conversion GUI से slower क्यों है?
मैं सभी VLC CLI options कैसे पाऊँ?
cvlc --longhelp (या --help --help-verbose) run करें और किसी file में pipe करें: cvlc --longhelp > vlc-help.txt। Per-module options "Stream output" sections के तहत listed हैं।