Skip to content

Commit 688e53d

Browse files
committed
updated video_to_720p_mp4.sh
1 parent 913db03 commit 688e53d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

media/video_to_720p_mp4.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ SECONDS=0
5858

5959
time \
6060
for filepath in "$@"; do
61-
mp4_filepath="${filepath%.*}.720p.mp4"
62-
if [ -s "$mp4_filepath" ]; then
63-
timestamp "File already exists, skipping: $mp4_filepath"
61+
new_mp4_filepath="${filepath%.*}.720p.mp4"
62+
if [ -s "$new_mp4_filepath" ]; then
63+
timestamp "File already exists, skipping: $new_mp4_filepath"
6464
else
6565
# shellcheck disable=SC2016
66-
trap_cmd 'echo; echo "removing partially done file:"; rm -fv -- "$mp4_filepath"; untrap'
67-
timestamp "converting $filepath => $mp4_filepath"
68-
time nice ffmpeg -i "$filepath" -vf "scale=-1:720" -c:v libx264 -crf 23 -preset medium -c:a copy -movflags +faststart -- "$mp4_filepath"
66+
trap_cmd 'echo; echo "removing partially done file:"; rm -fv -- "$new_mp4_filepath"; untrap'
67+
timestamp "converting $filepath => $new_mp4_filepath"
68+
time nice ffmpeg -i "$filepath" -vf "scale=-1:720" -c:v libx264 -crf 23 -preset medium -c:a copy -movflags +faststart -- "$new_mp4_filepath"
6969
echo >&2
7070
fi
7171
"$srcdir/vidopen.sh" "$mp4_filepath"

0 commit comments

Comments
 (0)