I want to make an ambitious recursive batch file which loops through a website-style file structure until there are no child folders, then runs mencoder on the collection of video files in that final folder, saving it in the root folder (where the batch was run from) as the folder path to the file with the "\" replaced with ".". for example:
Code: Select all
Root (where the batch was run)
| |- SubSubfolder03
| | |- Video1.mpg
| | |- Video2.mpg
| | `- Video3.mpg
| `- SubSubfolder04
`- Subfolder01.SubSubfolder03.mpg <-- this is the resultant file of The batch process
Obviously the point of this is to generate a lot of files not just one, so when a file is created, (after possibly deleting the source files once I know this works) the pointer moves back up to the parent folder until it finds a sibling folder, then progresses down that route...etc hence the recursive nature of this batch file, exactly like a binary tree.
This is my partial pseudo code:
Code: Select all
for each folder in root
if folder contains a sub-folder
add folder name to file name string followed by "."
add folder to root path string
run mencoder with all files in folder
delete source video files
The main problems I am aware of are the fact this isn't like a programming language and doesn't have methods, making the recursive bit complicated, in terms of keeping track of the current folder and although I am (maybe) obviously a programmer I don't have a clue about DOS syntax. It would be great if I could collect building blocks of knowledge and do it myself, but I can appreciate it's less hassle and quicker for you guys to just make suggestions.
Finally, here is a page about running mencoder from the command line:
I'd greatly appreciate you guys' wealth of knowledge on this