jauche_sortierer.sh 681 B

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