I have my film and series collection in one directory, which obviously has a lot of sub directories and a lot of different formats. It's constantly being added to by all of us here. What I'd like to do is make a script that I can run occasionally when one or all of us has added in new stuff that will search for files in that directory/sub directories and convert them to a format that kodi/xbmc can stream to my trusty old xbox 360. I'm running Gnome 16.04, I'm not sure if that's relevant or not.
So far I've found the code to convert the actual files;
for i in *mkv; do ffmpeg -i $i -vcodec copy -acodec copy "$i.mp4"; done
and the files are all located in;
/media/dave/Seagate Expansion Drive/Media
So, these are the problems I'm left with.
Is mp4 the best way to go? Googling this hasn't really cleared it up for me, there are a million different opinions! So far it'll play some MP4's but not all.
How to adapt that little line of code to search for more than just mkv - there are mpeg, avi, wmv, mov, everything you can think of! Would I need to just repeat that line of code for each different file type?
How to make it search the subdirectories
How to make it delete the original file only if the conversion if successful
How can I set kodi/xbmc to load on start up already minimised?
Any help, suggestions or pointers to get this sorted would be REALLY appreciated :)