Add some pre-existing scripts.

This commit is contained in:
Lukáš Kucharczyk
2020-07-30 15:44:20 +02:00
parent 848694ed11
commit e1434f1a1e
9 changed files with 181 additions and 0 deletions

24
sub_extract_convert Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# usage: $scriptname $files $output_sub_format
output_sub_format=${@: -1}
for i in $@
do
if [ ! -e "$i" ];
then
echo "File does not exist."
continue
fi
index=$(ffprobe -v 8 -show_streams -select_streams s "$i" | grep index | cut --delimiter="=" -f 2)
if [ -z $index ];
then
echo "No subtitle streams found."
exit
fi
ffprobe -v 8 -show_streams -select_streams "$i"
filename=${i%.*}
mkvextract "$i" tracks $index:"${filename}.en.ass"
if [ ! -z $1 ];
then
subtitleedit /convert "${filename}.en.ass" $output_sub_format 2>/dev/null | grep --color=none ass
fi
done