5
3
Is there a way to batch covert a folder of .mkv files to .m4v files using ffmpeg in Mac?
I setup a service that will do individual files, but I really would like to batch them.
The 'Run Shell Script' that I'm using is:
for f in "$@"
do
/Users/username/Movies/ffmpeg -i "$f" -c:v copy -c:a copy "${f%.*}.m4v"
done
Here is a screen shot of what I have that works for individual files:
Dude: I am struggling with this a bit. The name of my files are this format....
tvshow s01e01 - name of tvshow.mkv
my script still will do individual files within the folder. I just right click the file and look under services and then select the name of my service that i created.
If I try right clicking on my folder name. I get an error. – ldiastx – 2016-02-22T15:48:31.440
Just try running Dude's command inside Terminal! It should loop thru all the MKV files in the current folder/directory, converting them to MP4. It preserves the names of the files, just changing the extension. – jimtut – 2016-02-22T17:31:46.847
1PERFECT! Thanks so much. Works like a charm. – ldiastx – 2016-02-23T13:23:52.533
Curious what "${f%mkv}mp4" is? Learn more about "String Operations": http://tldp.org/LDP/abs/html/refcards.html#AEN22828
– beausmith – 2016-08-07T19:41:12.777