CH01 / Open-source tools

Saving a network stream with VLC media player

Last updated Editorial team Video Downloader Info8 segments~5 min

Key takeaways

  1. VLC media player, a free and open-source program from the VideoLAN non-profit, can save a direct video URL or network stream to a file through Media > Convert / Save, Network tab.
  2. From the command line, the stream output chain --sout "#std{access=file,mux=ts,dst=output.ts}" writes a stream to disk without opening a window when combined with the dummy interface.
  3. Choosing a conversion profile re-encodes the video; to keep the original quality, use a profile that keeps the original tracks or the dump mode.
  4. VLC works best with direct media URLs (an .mp4, an .m3u8 playlist, an RTSP or UDP stream); for video pages on large platforms, yt-dlp is more reliable.
  5. The VLC application is distributed under the GPL version 2 or later, and its core library libVLC under the LGPL 2.1 or later.
VLC media player 3.0 playing a video, screenshot
Image: VLC media player 3.0.16 screenshot,Software: VideoLAN Organization and developers Screenshot: VulcanSphere,CC BY 4.0,via Wikimedia Commons.

VLC can save a network stream to a file: open Media > Convert / Save, paste the URL in the Network tab, choose a profile and a destination file, then click Start. It works best when you have a direct media address, such as an .mp4 file, an .m3u8 playlist or an RTSP feed from your own IP camera. For pages on large video platforms, VLC is not the right tool; the end of this guide explains why and what to use instead.

Use VLC to record streams you own, public-sector or openly licensed broadcasts, or content whose owner permits it. Other cases fall under copyright and platform terms: see is downloading videos legal?.

What is VLC and why use it to save streams?

VLC media player is a free, open-source, cross-platform player developed by the VideoLAN non-profit. The application is distributed under the GPL version 2 or later and its core library, libVLC, under the LGPL 2.1 or later. Most people install it to play files, but it also includes a stream output system that can write whatever it receives to disk. Advantages:

  • It is probably already installed.
  • It opens a very wide range of protocols: HTTP(S), HLS, RTSP, RTP, UDP multicast, MMS.
  • It works the same on Windows, macOS and Linux.

How do I save a stream with the VLC interface?

On Windows and Linux (VLC 3):

  1. Open Media > Convert / Save (shortcut Ctrl+R).
  2. Go to the Network tab and paste the stream URL.
  3. Click Convert / Save at the bottom.
  4. Under Profile, choose the output format.
  5. Under Destination file, click Browse and enter a file name with the right extension.
  6. Click Start. The progress bar shows the recording; press Stop to end it on a live stream.

On macOS, the interface is different: look for the Convert / Stream entry in the File menu. Menu labels vary between versions and interface languages; the VideoLAN wiki documents the receive-and-save workflow.

Which profile should I choose?

Goal Profile approach Effect
Keep original quality A profile set to keep the original video and audio tracks, TS container No re-encoding, fast
Play on any device Video - H.264 + MP3 (MP4) Re-encodes, slower, slight quality loss
Audio only Audio - MP3 or similar Re-encodes audio, drops video

Re-encoding in VLC is convenient but less controllable than FFmpeg. A good practice is to save the raw stream first and convert it later with FFmpeg if needed.

How do I save a stream from the command line?

The stream output chain does the same thing without the interface:

vlc "https://example.org/live/stream.m3u8" \
    --sout "#std{access=file,mux=ts,dst=recording.ts}" vlc://quit
  • #std{...} is the standard output module: access=file writes to a file, mux=ts wraps the data in MPEG-TS, dst is the path.
  • vlc://quit closes VLC when the input ends.
  • On Linux, cvlc (or vlc -I dummy elsewhere) runs it without a window, which is handy on a server or in a scheduled task.

What is dump mode?

The dump module writes the input exactly as received, without demuxing:

vlc "URL" --demux=dump --demuxdump-file=capture.ts

It is the most faithful capture, but the result may need FFmpeg remuxing before it plays everywhere. In the interface, the Dump raw input checkbox of the Convert dialog offers the same idea; forum reports show it is temperamental with some sources.

How do I find a direct stream URL?

VLC needs the address of the media itself, not the web page around it. Legitimate places to find one:

  • Your own equipment: IP cameras and encoders expose RTSP or HTTP URLs in their settings.
  • Public broadcasters and institutions that publish their live HLS playlist or a direct download link.
  • Open-data archives such as the Internet Archive, which offer direct file links for public-domain films.

When a page builds its stream with JavaScript, or splits audio and video into separate adaptive tracks, VLC alone will struggle. Our explainers on HLS and MPEG-DASH show how those formats work.

Why is VLC the wrong tool for platform pages?

VLC includes Lua playlist scripts that try to turn some web pages into stream URLs. Platforms change their pages often, so these scripts regularly break, and fixes arrive only with VLC updates. Even when playback works, saving may produce a low-resolution combined stream rather than the best quality. For those pages:

Neither tool, nor VLC, can save DRM-protected streams from paid services, and circumventing that protection is prohibited in most jurisdictions. See DRM explained.

How do I record my own IP camera on a schedule?

A common legitimate use is keeping a rolling archive of your own camera or encoder. VLC can record for a fixed duration and exit, which makes it easy to call from a scheduler:

#!/bin/sh
# record-cam.sh : one hour of the camera feed, one file per run
cvlc "rtsp://192.168.1.20:554/stream1" --rtsp-tcp --run-time=3600 \
     --sout "#std{access=file,mux=ts,dst=/srv/cam/cam-$(date +%Y%m%d-%H%M).ts}" \
     vlc://quit
  • --rtsp-tcp asks for RTSP over TCP instead of UDP, which avoids grey or broken frames on lossy Wi-Fi links.
  • --run-time=3600 stops the input after 3,600 seconds, and vlc://quit then closes VLC.
  • The date in the file name gives one file per run, so a crash never corrupts the whole archive.

On Linux, a crontab line such as 0 * * * * /usr/local/bin/record-cam.sh starts a new file every hour. On Windows, create a task in Task Scheduler that runs vlc.exe with -I dummy and the same options. Keep in mind that recording people on camera is regulated: in the EU, the GDPR and national rules on video surveillance apply even to private installations that film beyond your own property.

Should I use VLC or FFmpeg to record a stream?

Criterion VLC FFmpeg
Graphical interface Yes No
Direct URLs (MP4, HLS, RTSP, UDP) Yes Yes
Precise control of codecs and containers Limited Full
Scripting and automation Possible with --sout Designed for it
Repairing timestamps, remuxing to MP4 No Yes

A pragmatic split: use VLC when you want to click, and FFmpeg when you need a file that is exactly right. Both can work together: record a TS file with VLC, then turn it into an MP4 without re-encoding with ffmpeg -i recording.ts -c copy recording.mp4. If the MP4 refuses to play, our FFmpeg guide covers the usual fixes.

Troubleshooting

Symptom Likely cause Fix
File is 0 KB URL is a web page, not a stream Find the direct media URL
File plays without sound Audio codec unsupported by the chosen container or player Use TS or MKV, or remux with FFmpeg
Recording stops after a few seconds Playlist expired or token-protected URL Use a fresh URL or a dedicated tool
Huge CPU usage A transcoding profile is active Keep original tracks instead

For a side-by-side view of VLC and the other options, see our comparison of open-source video downloaders.

Open-source tools in this guide

ToolLicence
VLC media playerGPL-2.0-or-later (libVLC LGPL-2.1-or-later)
yt-dlpUnlicense (public domain)

Frequently asked questions

Can VLC download YouTube videos?

VLC ships Lua scripts that let it open some platform pages, but these scripts break whenever the site changes and saving through them is unreliable. For video pages on large platforms, a dedicated tool such as yt-dlp is the better choice, used only for content you are allowed to keep.

Why does VLC play the stream instead of saving it?

This usually happens when the URL is a web page rather than a direct media stream, or when the Display the output option is ticked. Check that you pasted a media URL, such as a file or an m3u8 playlist, and that a destination file is set.

Does saving with VLC lose quality?

Only if you choose a profile that re-encodes. Profiles such as Video - H.264 + MP3 convert the content. To keep the original streams, use a profile that keeps the original video and audio tracks, the dump mode, or the command-line stream output with a TS container.

Where is the Convert / Save menu on macOS?

On macOS, the interface differs from Windows and Linux. Look for the Convert / Stream entry in the File menu, which offers the same idea: open media, choose a profile and save as a file. Menu names can change between VLC versions and languages, so check the VideoLAN documentation for yours.

Is VLC free and safe?

VLC is free, open-source software developed by the VideoLAN non-profit. Download it only from videolan.org or your operating system's official store or package manager, because fake VLC installers bundled with adware are common on download portals.

Sources and open data

  1. VLC media player official site · VideoLAN
  2. Documentation: Streaming HowTo, Receive and Save a Stream · VideoLAN wiki
  3. Documentation: Advanced Streaming Using the Command Line · VideoLAN wiki
  4. Dump module · VideoLAN wiki
  5. VideoLAN legal and licensing information · VideoLAN