Sunday, September 15, 2013

MP4 over UPnP to FreeBox v4 (minidlna)

i could only find one reference online on how to watch mp4 movie on a FreeBox v4:

http://legluondunet.over-blog.fr/article-freebox-lire-les-videos-au-format-mp4-sur-la-freebox-61411371.html

Unfortunately the conversion requires a GUI, which is bad[tm]. Instead i wrote a quick and dirty script to achieve something equivalent:



$ cat mp4tomkv.sh
#!/bin/sh

#set -x
in=$1
out=$(basename "$in" mp4)
out="${out}mkv"
mkvmerge --identify "$in" | grep Track > /tmp/dummy.txt
comp=""
while read line
do
tmp=`echo "$line" | cut -d' ' -f3`
comp="$comp --compression ${tmp}none"
done < /tmp/dummy.txt
echo "exec: mkvmerge -o $out $comp $in"
mkvmerge -q -o $out $comp $in