Вот мой скрипт:
Код: Выделить всё
echo "Warning! Please ensure before running this script that the files you'd like to convert are in the following format: 'series_name - SXXEYY' and mind that by running this script you're aware that the uncompressed files are goint to be automatically deleted. If you change your mind press 'Ctrl + C' to cancel or press [ENTER] to continue:"
read
echo "Enter destination of the input folder:"
read input
echo "Enter series name(how it's written inside the folder):"
read series_name
echo "Enter season number:"
read season_no
echo "Enter number of episodes in the season:"
read ep_no
echo "Enter destination of the output folder:"
read output
for i in $(seq -f "%02g" 1 $ep_no); do
input_file="$input/"$series_name - S${season_no}E${i}.mkv""
output_file="$output/"$series_name - S${season_no}E${i}.mkv""
ffmpeg -i "$input_file" -c:v libx264 -crf 22 -c:a copy -c:s copy -map 0 "$output_file"
done
rm -rf "$input"
clear
echo "Done :)"
Код: Выделить всё
nesco@nesker:~/uncompressed/Rome$ ls
'Rome - S01E01.mkv' 'Rome - S01E02.mkv'
Подробнее здесь: https://stackoverflow.com/questions/784 ... file-names
Мобильная версия