Skip to content

Instantly share code, notes, and snippets.

@powerswitch
Last active January 25, 2021 17:05
Show Gist options
  • Save powerswitch/9692166 to your computer and use it in GitHub Desktop.
Save powerswitch/9692166 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
# Finde alle Filmordner
MOVIES=$(find . | grep STREAM$)
# Für jeden Film:
for M in $MOVIES
do
# Liste alle Filmdateien auf
FILES=$(ls $M/*.m2ts)
# Extrahiere den Namen
NAME=$(echo $M | sed -r "s/[^\/]*\/([^\/]*)\/STREAM/\1/")
# mkvmerge-Kommando
COMMAND="yes no | mkvmerge "
for F in $FILES
do
# Datei anhängen
COMMAND=$COMMAND+$F" "
done
# Ausgabepfad setzen
COMMAND=$COMMAND" -o "$M"/../"$NAME".mkv"
# Eigentlich ausführen, aber hier nur Trockenübung
echo $COMMAND
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment