update sub_extract_convert
This commit is contained in:
parent
82dafd7e90
commit
f646e81c11
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# usage: $scriptname $files $output_sub_format
|
# usage: $scriptname $files $output_sub_format
|
||||||
output_sub_format=${@: -1}
|
output_sub_format=${@: -1}
|
||||||
for i in $@
|
for i in "$@"
|
||||||
do
|
do
|
||||||
if [ ! -e "$i" ];
|
if [ ! -e "$i" ];
|
||||||
then
|
then
|
||||||
|
@ -9,16 +9,16 @@ do
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
index=$(ffprobe -v 8 -show_streams -select_streams s "$i" | grep index | cut --delimiter="=" -f 2)
|
index=$(ffprobe -v 8 -show_streams -select_streams s "$i" | grep index | cut --delimiter="=" -f 2)
|
||||||
if [ -z $index ];
|
if [ -z "$index" ];
|
||||||
then
|
then
|
||||||
echo "No subtitle streams found."
|
echo "No subtitle streams found."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
ffprobe -v 8 -show_streams -select_streams "$i"
|
ffprobe -v 8 -show_streams -select_streams "$i"
|
||||||
filename=${i%.*}
|
filename=${i%.*}
|
||||||
mkvextract "$i" tracks $index:"${filename}.en.ass"
|
mkvextract "$i" tracks "$index":"${filename}.en.ass"
|
||||||
if [ ! -z $1 ];
|
if [ -n "$1" ];
|
||||||
then
|
then
|
||||||
subtitleedit /convert "${filename}.en.ass" $output_sub_format 2>/dev/null | grep --color=none ass
|
subtitleedit /convert "${filename}.en.ass" "$output_sub_format" 2>/dev/null | grep --color=none ass
|
||||||
fi
|
fi
|
||||||
done
|
done
|
Loading…
Reference in New Issue