main
Kar 2025-05-16 18:18:33 +00:00
parent db5e789ece
commit 2d8a7fc023
1 changed files with 25 additions and 0 deletions

25
video-convert.sh Normal file
View File

@ -0,0 +1,25 @@
#!/bin/bash
while IFS= read -r filepath; do
# Skip empty lines
[ -z "$filepath" ] && continue
# Get the base name without extension and directory
dir=$(dirname "$filepath")
filename=$(basename "$filepath" .wmv)
output="$dir/$filename.mp4"
echo "Converting: $filepath -> $output"
# Run ffmpeg conversion
ffmpeg -i "$filepath" -c:v libx264 -preset fast -crf 23 -c:a aac -b:a 128k "$output"
# If ffmpeg succeeded, delete the original file
if [ $? -eq 0 ]; then
echo "Conversion successful. Deleting: $filepath"
rm "$filepath"
else
echo "Conversion failed for: $filepath"
fi
# find ./ -type f -iname "*.wmv"
done < wmv.txt