Statistics
| Branch: | Revision:

ffmpeg / tools / jauche_sortierer.sh @ 5d6e4c16

History | View | Annotate | Download (681 Bytes)

1 bf2d43de Michael Niedermayer
#!/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