March 01, 2021, 04:56:29 PM



[2.6.4] Convert a whole folder

Started by mean, May 10, 2013, 06:16:10 AM

Previous topic - Next topic


May 10, 2013, 06:16:10 AM Last Edit: May 10, 2013, 06:52:49 AM by mean
The attached tinypy script does the following :

* Take all the files in inputFolder ending with ext. The default paramaters are : take all files in "/capture/links" ending by "mpg"
* Only take the one beginning by 'B'
* Output file ="outputfolder"+name+".mkv", for example /capture/links/foo.mpg will become /capture/manage2/foo.mpg.mkv
* If the output file already exists skip
* Let all the audio tracks as they are and re-encode video to 1024*576 x264 AQ=20 (PAL 16:9)
* Save as mkv

For windows, you might have to change the "/" to "\", not sure

Jan Gruuthuse

May 10, 2013, 06:30:18 AM #1 Last Edit: May 10, 2013, 07:53:37 AM by Jan Gruuthuse
Nice one. Just learned yesterday, if you want to use sub folders one level down in that folder you can do so with
for i in /capture/links/*.ts /capture/links/**/*.ts; do ....; done
Not clear how to incorporate this in your script.

/capture/links/*.ts in links itself
/capture/links/**/*.ts all sub folders one level below
/capture/links/**/**/*.ts all sub folders two levels below and so on /**/**/**/*, ...


Update the script, a badly placed comment was making it abort