jamesfed Posted July 8, 2010 Posted July 8, 2010 Hi all, As part of the schools digital media sections of IT the students have to capture and edit video – since the IT Teachers want to stick with XP Movie Maker (which I understand because of its simplicity for the year 7/8/9 students) we are constantly running into problems with video file formats not being supported. Usually if a student had some video that couldn’t be edited I would stick it into SUPER and re render the video on my desktop PC however with the volume of video this can sometimes take quite a while. As such I was thinking does anyone know of a way that I could get one of the servers to automatically render the video for me? The way I see this working (or something similar)- 1. Student finds they can’t use video in movie maker 2. Student cops video file to a network shared folder 3. Every few minutes the server looks at that folder to see if there is anything in there 4. Server converts video and puts it in a ‘rendered videos’ network folder 5. Server s deletes original video from folder (maybe even deletes the rendered video after a specific time period) What would be even better is if this could also be done with music files to. I know this is a tall order and I’d be happy to have a go at anything. If I need to run a separate OS (or even Linux) to do this then that shouldn’t be a problem as we have plenty of RAM in our virtual server. Thanks, James
SYNACK Posted July 8, 2010 Posted July 8, 2010 (edited) So long as you have all the required codecs to read the files on the server this should not be a problem to implement as you want. A bit of VBS or Batch on a scheduled task along with Expression Encoder and you should be able to do this easily enough. How Do I: Encode a Video from the Command Line Command-line operation http://www.edugeek.net/forums/downloads/58812-expression-encoder-4-a.html Edited July 8, 2010 by SYNACK 1
jamesfed Posted July 8, 2010 Author Posted July 8, 2010 Wow thanks thats just the kind of answer I was looking for - video was useful and I've got a bat file setup but don't know what source/target values I should be using to do the contents of a folder? Thanks again!
SYNACK Posted July 8, 2010 Posted July 8, 2010 You would probably need to do them one by one, your best bet would be to make a VBS script that reads through the file names in that folder one by one and for each of them runs that command line then delets the source file. Something like "encoder.exe /source " & SourceDir & "\" & FileName & " /target f:\encodedvids\" & Filename pushed into a shell run command. These should have all the required code in them, just a case of combining it into a script and setting it as a scheduled task to run every hour or so: List All Files in Folder using VBScript Run Method (Windows Script Host) Copy, delete or move a file - Real's WSH VBS How-to
jamesfed Posted July 8, 2010 Author Posted July 8, 2010 Oooh this is where the uming and errring begins I'll have a look through the docs - thanks again!
plexer Posted July 8, 2010 Posted July 8, 2010 FFMPEG Automated Video Convert Basically use a folder monitoring app to check for new files and then invoke ffmpeg on new files. Ben
jamesfed Posted July 8, 2010 Author Posted July 8, 2010 Was just looking into FFMPEG too - any suggestions on a folder monitoring application?
plexer Posted July 8, 2010 Posted July 8, 2010 Not used any but have a look here: 7 Free Tools To Monitor Folder Changes Ben
jamesfed Posted July 9, 2010 Author Posted July 9, 2010 Wow making serious progress now- Are using Expression Encoder 2 and Directory Monitor from deventerprise.net (expect a quick how to when I get it working perfectly). Only one thing is - how do I get the bat file that I have setup to output the original file name with the new .wmv extension? Another option I was thinking about was using the date/time as the filename and then the .wmv extension. Any clues?
Arthur Posted July 9, 2010 Posted July 9, 2010 how do I get the bat file that I have setup to output the original file name with the new .wmv extension? I use this one for FFmpeg... MP4toWMV.cmd @echo off for %%a in (*.mp4) do ffmpeg -y -i "%%a" -b 900k -vcodec wmv2 -acodec wmav2 -ab 128k -ac 2 -ar 44100 "%%~na.wmv"
Arthur Posted July 9, 2010 Posted July 9, 2010 Another option I was thinking about was using the date/time as the filename and then the .wmv extension. The following batch file will do that... MP4toWMV_DateAsFilename.cmd @echo off & setlocal ENABLEEXTENSIONS :: Call Functions call :GetTime h n s t call :GetDate y m d :: Convert video for %%a in (*.mp4) do ffmpeg -y -i "%%a" -b 900k -vcodec wmv2 -acodec wmav2 -ab 128k -ac 2 -ar 44100 "%h%-%n%-%s%_%y%-%m%-%d%.wmv" :: Exit goto :EOF ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :GetTime hh nn ss tt :: :: By: Ritchie Lawrence, updated 2007-05-12. Version 1.3 :: :: Func: Loads local system time components into args 1 to 4. :: For NT4/2000/XP/2003 :: :: Args: %1 Var to receive hours, 2 digits, 00 to 23 (by ref) :: %2 Var to receive minutes, 2 digits, 00 to 59 (by ref) :: %3 Var to receive seconds, 2 digits, 00 to 59 (by ref) :: %4 Var to receive centiseconds, 2 digits, 00 to 99 (by ref) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: setlocal ENABLEEXTENSIONS for /f "tokens=5-8 delims=:,. " %%a in ('echo/^|time') do ( set hh=%%a&set nn=%%b&set ss=%%c&set cs=%%d) if 1%hh% LSS 20 set hh=0%hh% endlocal&set %1=%hh%&set %2=%nn%&set %3=%ss%&set %4=%cs%&goto :EOF ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :GetDate yy mm dd :: :: By: Ritchie Lawrence, 2002-06-15. Version 1.0 :: :: Func: Loads local system date components into args 1 to 3. :: For NT4/2000/XP/2003. :: :: Args: %1 var to receive year, 4 digits (by ref) :: %2 var to receive month, 2 digits, 01 to 12 (by ref) :: %3 Var to receive day of month, 2 digits, 01 to 31 (by ref) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: setlocal ENABLEEXTENSIONS set t=2&if "%date%z" LSS "A" set t=1 for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo/^|date') do ( for /f "tokens=%t%-4 delims=.-/ " %%d in ('date/t') do ( set %%a=%%d&set %%b=%%e&set %%c=%%f)) endlocal&set %1=%yy%&set %2=%mm%&set %3=%dd%&goto :EOF ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1
jamesfed Posted July 9, 2010 Author Posted July 9, 2010 Perfect!! Code is now- @echo off & setlocal ENABLEEXTENSIONS :: Call Functions call :GetTime h n s t call :GetDate y m d :: Convert video "C:\Program Files (x86)\Microsoft Expression\Encoder 2\encoder.exe" /source %1 /target "c:\encode\output\%h%-%n%-%s%_%y%-%m%-%d%.wmv" :: Exit ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :GetTime hh nn ss tt :: :: By: Ritchie Lawrence, updated 2007-05-12. Version 1.3 :: :: Func: Loads local system time components into args 1 to 4. :: For NT4/2000/XP/2003 :: :: Args: %1 Var to receive hours, 2 digits, 00 to 23 (by ref) :: %2 Var to receive minutes, 2 digits, 00 to 59 (by ref) :: %3 Var to receive seconds, 2 digits, 00 to 59 (by ref) :: %4 Var to receive centiseconds, 2 digits, 00 to 99 (by ref) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: setlocal ENABLEEXTENSIONS for /f "tokens=5-8 delims=:,. " %%a in ('echo/^|time') do ( set hh=%%a&set nn=%%b&set ss=%%c&set cs=%%d) if 1%hh% LSS 20 set hh=0%hh% endlocal&set %1=%hh%&set %2=%nn%&set %3=%ss%&set %4=%cs%&goto :EOF ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :GetDate yy mm dd :: :: By: Ritchie Lawrence, 2002-06-15. Version 1.0 :: :: Func: Loads local system date components into args 1 to 3. :: For NT4/2000/XP/2003. :: :: Args: %1 var to receive year, 4 digits (by ref) :: %2 var to receive month, 2 digits, 01 to 12 (by ref) :: %3 Var to receive day of month, 2 digits, 01 to 31 (by ref) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: setlocal ENABLEEXTENSIONS set t=2&if "%date%z" LSS "A" set t=1 for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo/^|date') do ( for /f "tokens=%t%-4 delims=.-/ " %%d in ('date/t') do ( set %%a=%%d&set %%b=%%e&set %%c=%%f)) endlocal&set %1=%yy%&set %2=%mm%&set %3=%dd%&goto :EOF ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Last thing to do now is to get it to delete the origional file when its done and thats me happy for the day
jamesfed Posted July 9, 2010 Author Posted July 9, 2010 Last thing to do now is to get it to delete the origional file when its done and thats me happy for the day Which was indeed just call the del command for %1 Wow this project has worked out better than expected! Time to do a little testing and then I'll mash together a How to
plexer Posted July 9, 2010 Posted July 9, 2010 How about reading the owner of the original creator of the file then having the server dump the converted movie in the home folder and then delete the original? Ben
Arthur Posted July 9, 2010 Posted July 9, 2010 James. I noticed you missed out the goto :EOF in your batch file. You should keep that. By the way, thanks for the link to that Directory Monitor program. It looks really good. How about reading the owner of the original creator of the file then having the server dump the converted movie in the home folder and then delete the original? That's a brilliant idea! Is there an easy way to do that?
plexer Posted July 9, 2010 Posted July 9, 2010 Dunno but bunch of scripts here Scripting Files and FileSystems using VBScript including vbscript for monitoring folders. Maybe it can all be done via a vbscript? Ben
jamesfed Posted July 9, 2010 Author Posted July 9, 2010 James. I noticed you missed out the goto :EOF in your batch file. You should keep that. Ooops its in there now I've also added a pause in the code to as everytime someone tried to upload a file it tried to start rendering immedately (and as the file wasn't totaly uploaded it failed). Should have the final steps to take out in the next few hours (to many things today being the only Tech in!).
jamesfed Posted July 9, 2010 Author Posted July 9, 2010 The following batch file will do that... Hi Arthur - if this is your code could I have your permission to include it (in its current state) in the guide I'm putting together? Thanks, James
Arthur Posted July 9, 2010 Posted July 9, 2010 (edited) Sure. No problem. The date and time functions are from this website though: http://commandline.co.uk/lib/treeview/. I'm sure he won't mind them being included in your guide if you mention his website. Edited July 9, 2010 by Arthur
jamesfed Posted July 9, 2010 Author Posted July 9, 2010 Just for referance the guide I made can now be seen here (thought it made sense to start a new thread to get the guide part at the top) - http://www.edugeek.net/forums/how-do-you-do/59582-video-rendering-server-how-guide.html
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now