I just love Node.js!
You can do just about anything with it. My task was to transcode media files and keep the folder structure. I also had to check for media ype. RM videos, RM audio and WMA audio files were used at input.
If you are planning to try it out you must install ffpmeg, mencoder and ffprobe. Make sure you add installed files to Windows path!
So first I used 'final-fs' => 'npm install final-fs' to read all files from my input forder and create the same folder structure at my output.
Because each file was different I had to use ffprobe => 'npm install node-ffprobe' to inspect media info. I using under windows you have tho change source file so it uses win-spawn. So also you need to 'npm install win-spawn'. We will also need win-spawn to spawn ffmpeg or mencoder processes...
So after we get media file info we are ready to use the appropriate codec...
You can check the code here. The code is robust because I took only a few hours to write but it does the job done!