2025-01-09 03:07:48 +00:00
|
|
|
|
#bash convert.sh
|
|
|
|
|
# convert all mp3 files to ogg files under the same directory
|
|
|
|
|
# command example: ffmpeg -i input.mp3 -c:a libvorbis -qscale:a 5 output.ogg
|
|
|
|
|
|
|
|
|
|
|
2025-01-12 06:02:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ffmpeg -i "c02_吕萍_01_梦楼.mp3" -c:a libvorbis -qscale:a 8 "./ogg/c02_吕萍_01_梦楼.ogg"
|
|
|
|
|
|
2025-01-09 03:07:48 +00:00
|
|
|
|
# makdir ogg if not exist
|
|
|
|
|
if [ ! -d "./ogg" ]; then
|
|
|
|
|
mkdir ogg
|
|
|
|
|
fi
|
|
|
|
|
# clear the ogg directory
|
|
|
|
|
rm -rf ./ogg/*
|
|
|
|
|
# convert all mp3 files to ogg files
|
|
|
|
|
for file in *.mp3
|
|
|
|
|
do
|
|
|
|
|
# put the output files to the ./ogg directory
|
|
|
|
|
# the quality range is from 0–10, where 10 is the highest quality and 3–7 are a good range to try
|
2025-06-05 09:37:30 +00:00
|
|
|
|
ffmpeg -i "$file" -c:a libvorbis -qscale:a 8 "./ogg/${file}.ogg"
|
2025-01-09 03:07:48 +00:00
|
|
|
|
done
|