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:


  1. I highly recommend iDealshare VideoGo which can batch convert MKV to MP4 with high output quality on Mac or Windows

    It also helps to convert video back to MKV or even convert between MKV, AVI, MP4, MOV, FLV, MPG, WMV, VOB, DV, ProRes, ASF, WebM, H.264