Updated for Ubuntu 22.04. Also fixed merge videos cmin check
[videoscripts/.git] / mkv2mp4small
1 #!/bin/bash
2
3 # step 1: convert the mkv to mpg ; many mkv files do not directly get converted to mp4
4 mencoder "$1" -ovc lavc -lavcopts vcodec=mpeg1video -aid 0 -oac pcm -o delete_me.mpg
5
6 # step 2: convert the mpg file to mp4
7 mencoder -of lavf -lavfopts format=mp4 -oac lavc -ovc lavc -lavcopts \
8 aglobal=1:vglobal=1:acodec=libfaac:vcodec=mpeg4:abitrate=128:vbitrate=640:keyint=250:mbd=1:vqmax=10:lmax=10:turbo  -af lavcresample=44100 \
9 -vf harddup,scale=640:-3 "delete_me.mpg" -o "$1.mp4"
10
11 # step 3: delete the temporary huge sized mpg file 
12 rm "delete_me.mpg"