OSDN Git Service

cws2fws: Improve error message wording.
[coroid/libav_saccubus.git] / tools / jauche_sortierer.sh
1 #!/bin/sh
2 #GPL
3 #TODO
4 #add pixelformat/sampleformat into the path of the codecs
5
6 FFP=../ffprobe
7 TMP=$(mktemp) || exit 1
8 TARGET=$1
9 shift
10
11 for v do
12     BASE=$(basename $v)
13     echo $v | egrep -i '(public|private)' >/dev/null && echo Warning $v may be private
14     $FFP $v 2> $TMP
15     FORM=$((grep 'Input #0, ' -m1 $TMP || echo 'Input #0, unknown') | sed 's/Input #0, \([a-zA-Z0-9_]*\).*/\1/' )
16     mkdir -p $TARGET/container/$FORM
17     ln -s $v $TARGET/container/$FORM/$BASE
18     eval $(grep 'Stream #0\.[^:]*: [a-zA-Z0-9][^:]*: [a-zA-Z0-9]' $TMP | sed 's#[^:]*: \([a-zA-Z0-9]*\)[^:]*: \([a-zA-Z0-9]*\).*#mkdir -p '$TARGET'/\1/\2 ; ln -s '$v' '$TARGET'/\1/\2/'$BASE' ; #')
19 done
20
21 rm $TMP