I'm still little new with bash commands and I've hit a brick wall. Recently I found you don't have to re-encode MKV's if you want to turn them into MP4's, you just simply change the container. I'm using the program FFMpeg to accomplish this. The below command looks in the current folder for any MKV and changes the container to MP4, it then goes through and renames the files.
Code:
for i in *mkv; do ffmpeg -i "$i" -codec copy "$i".mp4; rename 's/\.mkv\.mp4$/\.mp4/' *mkv.mp4;done
It works great, however what this means is I have to navigate into each TV show, then each season, and run the string. As it takes a little time to run it's becoming quite tedious to babysit the progress, then when it finishes change to the next folder, rinse and repeat. This is repetitive task I know that can be scripted to save time.
My file hierarchy looks like this:
Code:
-TV
--Seinfeld
--Star Trek TNG
---Season 01
---Season 02
Episode 01
Episode 02
Episode 03
...
---Season 03
---Season 04
...
--Star Wars Clone Wars
What I want is to run the command from the root TV folder and it recursively to go through each subfolder and run it's conversion operation. Whether there's some code I can add to the original string to do this, or if I have to write a little script file, whatever is more effective. I know this is probably a simple answer for someone with experience. Any help would be appreciated, thanks!