Log on
Main page Graphics Photography Audio Video Tools Web Design Documents Space & Astro Amiga Funny Surreal Gallery Links & Contact

Video related unix commands


This is a collection of various little command lines that I figured out, and that I just want to put somewhere instead of having to figure them out again, the next time I need them. I cannot guarantee they will still work in the future, as some of the tools involved may change their syntax or behavior.

Remuxing several .ogm files into .mkv

find *.ogm -exec mkvmerge -o "{}.mkv" "{}" \;

Finding out what codecs are used in all your MKV files

find . -iname "*.mkv" -exec mkvinfo "{}" \; |grep -i "codec id"

Converting MKV (h264/aac) to MP4 in FreeBSD (1st method)

mkvextract tracks source.mkv 1:video.264 2:audio.aac 3:subtitles.ass mp4box -add video.264 -add audio.aac new.mp4

Converting MKV (h264/ac3) to MP4 in FreeBSD (2nd method)

#/bin/sh # usage: makemp4 <mkv filename> <framerate, e.g. 23.976> BASENAME=`echo $1|sed s/.mkv$//` mkvextract tracks "$1" 1:video.264 2:audio.ac3 3:"$BASENAME.ass" 4:"$BASENAME-b.ass" mplayer audio.ac3 -af channels=2 -ao pcm:fast:waveheader:file=audio.wav -channels 2 -novideo 2>&1 normalize --clipping --peak audio.wav faac -q 133 audio.wav audio.aac rm "$BASENAME.mp4" mp4box "$BASENAME.mp4" -fps $2 -add video.264 rm video.264 audio.wav audio.ac3 mp4box "$BASENAME.mp4" -add audio.aac rm audio.aac