HOWTO Dump video streams from the Internet

From LinuxReviews
Jump to navigationJump to search

You can save it if you can watch it. The two best alternatives for doing so are VLC if you prefer a graphical option and youtube-dl and mplayer if you prefer saving audio and video stream from the command-line.

Saving video streams with VLC[edit | edit source]

Start VLC and choose the menu View and select Advanced Controls. You will now get the secret "Advanced" toolbar under the video window.

Open your stream either by pressing ctrl-N or choosing Media -> Open Network Stream in the menu. Just click the red recording button to start recording the stream. Press it again to stop recording. Where oh where do these files go? They are by default placed in $HOME/Videos/.

You can change where recorded videos are stored. Select Tools then Preferences and select [x] All preferences in the bottom-left corner. Go to Input / Codecs. There is an option called Record directory at the very bottom of the Input / Codecs options.

Saving streams with youtube-dl[edit | edit source]

youtube-dl is a general-purpose tool for downloading video files from websites, it is not just for YouTube. It can also identify and save video-streams. Simply point it to a stream you would like to save and let it do it's job. Using it is this simple:

youtube-dl http://example.tld/stream.mp4

See the youtube-dl manual for detailed options. You probably don't need any; the default's fine.

Saving streams with mplayer[edit | edit source]

mplayer is a quite outdated video player compared to mpv but it does have the -dumpstream command-line option - as well as -dumpvideo and -dumpaudio if you are only interested in one of those options. The basic usage for these options is:

mplayer -dumpstream http://example.com/stream.mp4 -dumpfile videofile.mp4

mplayer will dump the video stream to ./stream.dump if you do not specify a -dumpfile. This may actually be a better idea if you do not know what kind of stream you are dumping. You can always rename the file to one with the right extension when you find out.

See the very long mplayer manual page for details.

Saving video files, not streams[edit | edit source]

Use youtube-dl if the video on a site is actually a video file and not a live-stream. Downloading the stored video file with youtube-dl is a much better option if it's just a video file being served and not a live-stream.