I'm running Arch/Gnome and am trying to convert a few hundred gigs of family videos from various formats (mov, wmv, mkv, avi mainly, but a few curveballs too) into trusty mp4s.
My scripting knowledge is strictly amateur, so far I have;
for i in *.avi; do ffmpeg -i "$i" "${i%.*}.mp4"; done
That works fine for one directory. There are hundreds. I'd like to replace that one-liner with something more encompassing that I can just run and go to bed.
Wish list;
run recursively
convert from mov, wmv, mkv and avi without having to run separate scripts
delete old file upon successful completion
keep the same file name
if it finds an error, just skip the file and keep going - don't stop the process
Any help with any and/or all of these bits to cobble something together that'll work would be most appreciated.
For any sort of recursion like this, your first option should be to try
find
, as in:with the script "convertanddelete" being: