convert
parent
db5e789ece
commit
2d8a7fc023
|
@ -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
|
Loading…
Reference in New Issue