Hi,

I am trying to populate a drive with music and I have encountered some folders of .ogg files and I wish to convert them to .mp3

I am following along with a description of the process found here https://linuxconfig.org/how-to-batch-convert-music-files-with-ffmpeg

Does this look right, please?

#! bin/bash

#Script to convert a directory of .ogg files to .mp3 files


#srcExt=$1   .ogg
#destExt=$2  .mp3
#
#srcDir=$3   `/Music/
#destDir=$4  `/Music/

#opts=$5

#for filename in "$srcDir"/*.$srcExt; do

#done


#! /bin/bash

srcExt=$1
destExt=$2

srcDir=$3
destDir=$4

opts=$5

for filename in "$srcDir"/*.$srcExt; do

        basePath=${filename%.*}
        baseName=${basePath##*/}

        ffmpeg -i "$filename" $opts "$destDir"/"$baseName"."$destExt"

done

echo "Conversion from ${srcExt} to ${destExt} complete!"


Many thanks

Andrew


_______________________________________________
luv-main mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to