Add downscale_all_mp4_in_current_folder_to_1080p.sh

This commit is contained in:
Alice Gaudon 2022-09-12 19:27:03 +02:00
parent 2d8189a250
commit a906b07b81

View File

@ -0,0 +1,9 @@
#!/bin/bash
for input_file in *.mp4 ; do
basename=$(basename -s .mp4 "$input_file")
old_file="${basename}.old.mp4"
mv "$input_file" "$old_file"
(ffmpeg -i "$old_file" -c:a copy -fps_mode passthrough -vf "scale=-1:'min(1080,ih)'" "$input_file" && rm "$old_file") || \
(mv "$input_file" "${input_file}.conv_err" && mv "$old_file" "$input_file")
done