Friday, July 31, 2015

VLC Command Line Change Container MKV to MP4

I wanted to change a bunch of MKVs to MP4, while doing a direct stream copy. VLC can do this with the GUI, but there was a lot of stuff to remux, so I decided to do it with the VLC CLI instead. Here is the bash one-liner I used:

 for f in *.mkv; do vlc "$f" --sout="#std{access=file,mux=mp4,dst='${f/%mkv/mp4}'}" vlc://quit; done;

I used the following sites for reference:
https://www.videolan.org/doc/streaming-howto/en/ch03.html
https://wiki.videolan.org/Transcode

4 comments: