VLC Command Line: cvlc, Streaming और Automation

उन्नत अंतिम अपडेट: लागू होता है: Windows / macOS / Linux · VLC 3.0.x

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

  1. Linux/macOS पर, cvlc VLC के साथ install होता है। Windows पर, full path use करें: "C:\Program Files\VideoLAN\VLC\vlc.exe" नीचे दिए --intf flags के साथ।

    Binary available है।

  2. Headless file play करें: cvlc /path/to/movie.mkv --intf dummy --play-and-exit

    VLC file play करता है और बिना किसी window के exit हो जाता है।

  3. Play किए बिना file की streams को list करें: cvlc movie.mkv --intf dummy --play-and-exit -vvv 2>&1 | grep -i "stream 0"

    Codec और stream info print होती है।

नोट--play-and-exit scripts के लिए workhorse flag है: file खत्म होने पर VLC quit हो जाता है, इसलिए cron/systemd jobs cleanly terminate होते हैं।

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 stream को port 8080 पर serve करता है; कोई भी player 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) या dshow:// (Windows)।

    एक live H.264 stream broadcast होता है।

  3. Ctrl+C के साथ रोकें — VLC listener को clean up करता है।

    Stream खत्म हो जाता है।

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

    File convert हो जाती है।

  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

    हर file sequentially convert हो जाती है।

  3. 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 में क्या अंतर है?
cvlc वही binary है जिसमें कोई GUI interfaces loaded नहीं हैं — यह सभी platforms पर मौजूद है लेकिन कुछ Linux packages पर एक wrapper है। Windows पर, vlc.exe call में same effect के लिए --intf dummy add करें।
क्या VLC मेरे webcam को किसी webpage पर stream कर सकता है?
हाँ — Step 2 में device-stream example एक HTTP stream serve करता है, और आप URL की ओर pointing किसी HTML5 video tag के साथ उसे embed कर सकते हैं (TS mux अधिकांश browsers में काम करता है)।
CLI conversion GUI से slower क्यों है?
यह slower नहीं है — दोनों same software encoder use करते हैं। GUI बस friendlier दिखता है। यदि speed matters है, तो GPU encoders के साथ ffmpeg use करें।
मैं सभी VLC CLI options कैसे पाऊँ?
cvlc --longhelp (या --help --help-verbose) run करें और किसी file में pipe करें: cvlc --longhelp > vlc-help.txt। Per-module options "Stream output" sections के तहत listed हैं।