David's suggestion on using echo is good for checking scripts before letting them loose.

There's shellcheck (lint tool for shell scripts) available for Debian, Fedora etc ... which I should remember to use more often.

Filenames with spaces in them will give problems, maybe check you don't have any and or check the file exists before you try to process it.

Test the exit status of ffmeg & show the offending file if it's non-zero


On 24/7/22 17:18, Andrew Greig via luv-main wrote:
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



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

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

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

done

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

Reply via email to