Skip to content

Commit 446a42d

Browse files
committed
Only output the warning
1 parent bf016d7 commit 446a42d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
for file in ./docs/img/*; do
1+
for file in ./docs/img/**; do
22
codec=$(mediainfo --Inform="Video;%CodecID%" "$file")
33
if [ "$codec" = "hvc1" ]; then
4-
# Construct the output file name
5-
output_file="${file%.*}_avc1.${file##*.}"
6-
# Convert the file to avc1 (H.264)
7-
ffmpeg -i "$file" -c:v libx264 -c:a copy "$output_file"
8-
rm $file
9-
mv $output_file $file
10-
echo "Fixed codec for $file"
4+
echo "Invalid codec for $file"
5+
echo "Convert it to avc1 with:"
6+
echo "ffmpeg -i $file -c:v libx264 -c:a copy ${file%.*}_avc1.${file##*.}"
7+
echo "rm $file"
8+
echo "mv $output_file $file"
119
fi
1210
done

0 commit comments

Comments
 (0)