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

3 comments:

  1. I highly recommend iDealshare VideoGo which can batch convert MKV to MP4 with high output quality on Mac or Windows http://www.idealshare.net/video-converter/mkv-to-mp4-converter-mac-windows.html

    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

    ReplyDelete