I just needed to record a video stream. Usually, I use mplayer for these kinds of jobs, but this time it failed. However, on the internet I found a way to do it using VLC, which apparently has quite a command line interface.

This comment revealed that the VLC media player comes with some command line magic. Of course, not much is documented in the man page, but the user guide on their website seems to be useful.

Long story short, I ended up with the following command to save the stream http://STREAM.mp4 to /tmp/file.mkv :

vlc http://STREAM.mp4 --sout="#std{access=file,mux=mkv,dst='/tmp/file.mkv'}" vlc://quit


For the records, here are some alternatives:

# using mplayer
mplayer -dumpstream http://STREAM.mp4 -dumpfile /tmp/file.mp4
# using ffmpeg
ffmpeg -i http://STREAM.mp4 -acodec copy -vcodec copy /tmp/file.mp4

Martin Scharm

stuff. just for the records.


Martin | Permalink | 2014-07-09 10:44:46

Usually, I am using youtube-dl . It is a good alternative but only for well-known sites. Check here:


Martin Scharm | Permalink | 2014-07-09 13:14:14

Ah, interesting! I thought youtube-dl is just for youtube.. O.o

??? | Permalink | 2016-11-29 09:05:00

Cool, I never thought that VLC could have such useful function. I will try it later. Aside from using VLC, Acethinker Free Screen Recorder is another good choice to do screen recording, it’s my first choice, it’s free and even allows for editing.

Post a comment

read more about submitting comments