rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: Henry on May 12, 2009, 03:56:13 PM

Title: How do you move a file to a new folder only after upload is complete?
Post by: Henry on May 12, 2009, 03:56:13 PM
I'm setting up an automated Flash video conversion workstation.  Here's how it works:

1) user logs into HFS and uploads quicktime file to real folder on HFS machine.
2) on HFS machine, sorenson squeeze is watching the folder, and automatically converts the file and places it in my Wowza content folder
3) Wowza streams to fast start Flash player embedded in our web site

HOWEVER

Sorenson Squeeze wants to start converting IMMEDIATELY when it senses a quicktime file in the folder it's watching.  Thusly, it will begin to convert the quicktime before the file is done uploading, and subsequently fails.

Is there a way to enable completion moving so that i can upload to a different real folder, then have HFS automatically move the file to the Squeeze watched folder when the upload is complete?

Thanks in advance!

Henry
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on May 12, 2009, 04:30:10 PM
yes, but you will need HFS 2.3 (currently in beta)

just add this event script (ALT+F6)

[+upload completed]
{.move|%item-resource%|C:\another_folder\%item-name%.}


clearly you don't need to publish "another folder" in any way.
untested!
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on May 13, 2009, 02:09:46 PM
How can i run external app on upload completion?

I would like to encode uploaded files with mencoder, like this:

hfs.events

[+upload complete]

mencoder.exe %item-folder%%item-name% -o %item-folder%/[previews]/%item-name%.flv -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on May 13, 2009, 02:12:56 PM
[+upload completed]
{.exec|mencoder.exe %item-resource% -o   etc etc etc.}
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on May 13, 2009, 02:58:36 PM
Hi Rejetto, thank you for your sudden reply!  :)

I tried in many ways, but it didn't work.

Where should i put the file "mencoder.exe"?
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on May 13, 2009, 04:52:45 PM
I even tried this:


[+upload completed]
{.move|%item-resource%|C:\another_folder\%item-name%.}


but nothing happened. It seems that my hfs #238 is ignoring my scripts at all  ???

I have macros enabled in my hfs config.



Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on May 14, 2009, 07:43:44 AM
Where should i put the file "mencoder.exe"?

you can keep it where it is, and specify the path
{.exec|C:\folder\mencoder.exe etcetc.}

or you can move mencoder to the hfs.exe folder
or you can move it to any folder specified in your "path" enviroment variable. [more] (http://vlaurie.com/computers2/Articles/environment.htm)

[+upload completed]
{.move|%item-resource%|C:\another_folder\%item-name%.}
but nothing happened. It seems that my hfs #238 is ignoring my scripts at all  ???

whoops! this is a bug in HFS.
the file is still locked when "upload completed" is run, so it cannot be moved.
i will fix this problem for next release!
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on May 14, 2009, 08:19:06 AM
Yes, i've already set up hfs folder in my PATH variable.

I put notepad.exe in my C:\ folder, and set up hfs.events to launch it each time upload is completed:

[+upload completed]
{.exec|C:\notepad.exe.}

or

[+upload completed]
{.exec|C:\notepad.exe|document.txt.}

nothing happens :(

Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on May 14, 2009, 11:56:45 AM
whoops, that's another bug :D
{.exec.} has been actually broken in version #232 when i introduced optional parameter "out".
at the moment it is not working without this optional parameters. it's like it is not truly "optional" :D
i will fix this bug too in next release.
i hope to publish it tomorrow!

in the while, you can use this version. it should work.
{.exec|C:\notepad.exe|\boot.ini|out=xxx.}


you can post in the italian forum if you like ;)
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Mars on May 14, 2009, 12:08:25 PM
Quote
i will fix this bug too in next release.
i hope to publish it tomorrow!

un avant goût par mail comme d'hab ;)
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on May 14, 2009, 12:37:11 PM
Quote
whoops, that's another bug  :D

LOL  ;D

Quote
{.exec.} has been actually broken in version #232 when i introduced optional parameter "out".
at the moment it is not working without this optional parameters. it's like it is not truly "optional" :D

I didn't find in the docs a detailed description of {.exec.}, it would be helpful for me  ;)

Quote
i will fix this bug too in next release.
i hope to publish it tomorrow!

Great news, i'll wait for the next release,then ;)

Quote
you can post in the italian forum if you like ;)

Yes, thank you, i posted here (despite of my bad english) cause this could be helpful for Henry and for other non-italian users ;)



Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on May 14, 2009, 02:45:58 PM
I didn't find in the docs a detailed description of {.exec.}, it would be helpful for me  ;)

except the "out" parameter, that i'm about to add, what would you want to read there?
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on May 14, 2009, 02:50:23 PM
Well, if some function has parameters, a brief description of each of them and a little example of its usage...  :P
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on May 14, 2009, 04:46:26 PM
at the moment every function is documented, and only 2 parameters were not documented.
now that i did it for the "out", only 1 parameter has left.
it's few months that i put examples in the docs, so only most recent functions have an example.
please, if you read the docs, report every command that you think it's not documented enough. we'll try to improve.
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on May 16, 2009, 10:09:20 AM
Well, notepad.exe is an easy task to verify that .exec is working, the final goal is to pass a complex string to mencoder  :D

However

[+upload completed]
{.exec|C:\notepad.exe|\boot.ini|out=xxx.}

still doesn't work for me.  :(

How about build #239?  :D
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Mars on May 16, 2009, 01:10:51 PM
Quote
still doesn't work for me.

To be more precise it is necessary to use it in this way


[+upload completed]
{.exec|C:\notepad.exe|\boot.ini|out=#note.}
{.add to log|{.^#note.}.}


'out' is stored here into the static var #note, And then you use it as check seems to you
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on May 20, 2009, 08:50:09 AM
Thank you VERY much rejetto, now with #239  {.exec.} works!!!  ;D

One more thing...

%item-resource% :  C:\myfolder\mysubfolder\myfile.ext

i need a variable like this:

%item-path%      :  C:\myfolder\mysubfolder\

to pass it to {.exec.} string

does it exist?

Cause  %folder% isn't formatted properly for my needs, it hasn't drive letter and has slashes instead of backslashes ( /myfolder/mysufolder/)
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on May 20, 2009, 01:49:56 PM
yes, try %folder-resource%
if it doesn't work, it will {.filepath|%item-resource%.}
anyway, consider #239 has an ugly bug that will cause malfunctioning when you have a folder starting with "p", like C:\pool
i have little time at the moment.
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on May 20, 2009, 02:26:53 PM
%folder-resource%, GREAT!  ;D

Yes i read about big trouble with that bug, for me is not a problem cause i don't have folders starting with "p", but i hope you can solve the problem with no headaches  :P

Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 19, 2009, 08:26:20 PM
pheww ! nobody told me that macro alt+f6 was for HFS 2.3 geez you guys gotta write that crap somewhere  ;D  anyways, the below event seem to be working, the real issue is there simply is no encoding taking place. i have enabled macro log but where to check this ? the log file. when i upload a video 20 mb mpeg when video upload completes cmd window popups, but there is no output for %item-name%.mp4 inside the upload directory there is no mp4. :o ???

oh is there something like - S silent run for cmd ?  :) i dont really want to even see that cmd window  ;D


Quote
[upload completed]
{.if|%item-ext%=mp3|
{.exec|C:\wamp\www\encoder\mencoder.exe '%item-resource%' -o '%item-name%.mp4' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame -s localhost -t .}
/if.}
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Mars on June 19, 2009, 08:47:50 PM
what is the original extension of the uploaded file?
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 19, 2009, 09:00:21 PM
video.mpeg

mpgv codec

no audio

i have tested this through cmd it works but not executing right through the event HFS  ???
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Mars on June 19, 2009, 09:36:37 PM
change the line

{.if|%item-ext%=mp3|

by replacing mp3 with  the correct extension file to be converted
 
probably:  {.if|%item-ext%=mpeg|
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 20, 2009, 04:55:50 PM
doesnt seem to be working changing mp3 to mpeg or avi  :-\

Quote
[upload completed]
[.if|%item-ext%=mpeg|
{.exec|C:\wamp\www\encoder\mencoder.exe '%item-resource%' -o '%item-name%.ogm' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame -s localhost -t .}
/if.}

 :'( er.... wonder why its not encoding everything seem to be alright
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Mars on June 20, 2009, 07:23:37 PM
look the beginning of line with 'if' : there is a syntax error , replace [ by {
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 20, 2009, 11:34:57 PM
still no luck now i dont see cmd window  :(

Quote
[upload completed]
{.if|%item-ext%=mpeg|.exec|C:\wamp\www\encoder\mencoder.exe '%item-resource%' -o '%item-name%.ogm' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame -s localhost -t .}
/if.}

is there any chance of making these codes much more simple to use and understand :O

something like this, just a idea, there is alot of {}|. its so ever confuesing


< Run code >

< HFS Exec >< Upload Completed >
// takes every input from uploader ? mpeg,mp4,ogm,rm etc and feeds it through mencoder :o
< if input-Video Extension = *.*

< exec C:\wamp\www\encoder\mencoder.exe $in -o $out.ogm -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame -s localhost -t >

< End code >
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on June 21, 2009, 10:59:02 AM
still no luck now i dont see cmd window  :(

because you broke it

[upload completed]
{.if|%item-ext%=mpeg|{:{.exec|C:\wamp\www\encoder\mencoder.exe '%item-resource%' -o '%item-name%.ogm' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame -s localhost -t .}
:}/if.}


i don't know if this will work, i just fixed some errors

Quote
is there any chance of making these codes much more simple to use and understand :O

there's always a way.
it's just not convenient.
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on June 21, 2009, 11:10:04 AM
Quote
still no luck now i dont see cmd window

You have to invoke mencoder through cmd.exe, like this:

[+upload completed]
{.if|%item-ext%=mpeg|{:{.exec|cmd.exe /K C:\wamp\www\encoder\mencoder.exe ...

Optional parameter /K keeps cmd windows opened after the process is completed , so you can check for errors.

Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 21, 2009, 04:00:40 PM
Quote
still no luck now i dont see cmd window

You have to invoke mencoder through cmd.exe, like this:

[+upload completed]
{.if|%item-ext%=mpeg|{:{.exec|cmd.exe /K C:\wamp\www\encoder\mencoder.exe ...

Optional parameter /K keeps cmd windows opened after the process is completed , so you can check for errors.



ok i find the cmd in system32

so which one to use  ??? can i use these to  :-\


Quote
[upload completed]
{.if|%item-ext%=mpeg|{:{.exec|C:\wamp\www\encoder\mencoder.exe '%item-resource%' -o '%item-name%.ogm' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame -s localhost -t .}
:}/if.}



Quote
[+upload completed]
{.if|%item-ext%=mpeg|{:{.exec|C:\WINDOWS\system32\cmd.exe /K C:\wamp\www\encoder\mencoder.exe '%item-resource%' -o '%item-name%.ogm' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame -s localhost -t .}
:}/if.}
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 21, 2009, 04:11:01 PM
now we getting somewhere

output cmd error

Quote
MEncoder Sherpya-SVN-r28126-4.2.5 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Celeron(R) CPU          540  @ 1.86GHz (Family: 6, Model: 22, Step
ping: 1)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

File not found: ''C:\Documents'
Failed to open 'C:\Documents.
Cannot open file/device.

Exiting...

C:\Documents and Settings\SL20009\My Documents\HFS>


i used the following


Quote
[upload completed]
{.if|%item-ext%=mpeg|{:{.exec|C:\wamp\www\encoder\mencoder.exe '%item-resource%' -o '%item-name%.ogm' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame .}
:}/if.}


[+upload completed]
{.if|%item-ext%=mpeg|{:{.exec|C:\WINDOWS\system32\cmd.exe /K C:\wamp\www\encoder\mencoder.exe '%item-resource%' -o '%item-name%.ogm' -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame .}
:}/if.}


i removed the localhost - t it gave me error about - t something like that and before this i also removed the - s thing.  :o

do any of you have a working example which you use ?
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on June 21, 2009, 04:19:19 PM
trash it all, and try this without modifications

[+upload completed]
{.if|%item-ext%=mpeg|{:{.exec|cmd.exe /C C:\wamp\www\encoder\mencoder.exe "%item-resource%" -o "%item-name%.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame .}
:}/if.}
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 21, 2009, 04:37:20 PM
thanks rejetto  its working great and everybody else who help me  ;D

rejetto, why its saving encoded file next to HFS.exe ? look picture below  :o


can i put something like this in output?

 C:\wamp\www\encoded\%item-name%.ogmc :D

(http://i44.tinypic.com/2j1alhj.png)
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 21, 2009, 05:58:10 PM
now trying to add batch script to delete files in uploads folder

[+upload completed]
{.if|%item-ext%=wmv|{:{.exec|cmd.exe /C C:\wamp\www\encoder\mencoder.exe "%item-resource%" -o "C:\wamp\www\encoded\%item-name%.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame .}
:}/if.}

[+upload completed]
{:{.exec|cmd.exe /C C:\Documents and Settings\SL20009\My Documents\HFS\delete.bat.}
:}/if.}

the batch to delete files, but it seems its not starting  :o anybody using batch with HFS ?
Quote
del /Q c:\wamp\www\uploads
cd\\
cd c:\wamp\www\
rmdir /S/Q uploads
echo Deleting Files
echo File Deleted
mkdir uploads
exit
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: SilentPliz on June 21, 2009, 07:05:11 PM
[+upload completed]
{.exec|C:\Documents and Settings\SL20009\My Documents\HFS\delete.bat.}

But at what timing do you want delete your files?

*********************************************

WIKI

http://www.rejetto.com/wiki/index.php/HFS:_Event_scripts

http://www.rejetto.com/wiki/index.php/HFS:_Template_macros
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on June 22, 2009, 08:16:57 AM
your second script is wrong,
but if it was fixed, it would be run at the same time of the encoding.
i don't think this is what you want.
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Caco on June 23, 2009, 12:21:03 PM
mysoogal, explain exactly what you want to do on upload completion.

For instance, in my system i use mencoder to create i light flash video preview of uploaded video files. This preview is created in a [previews] subfolder . When user clicks on preview button, rawr player points to the .flv file in [previews] and play.

When user wants to delete the original video file, a batch script automatically deletes its related preview, so the system is kept clean.

Maybe do you want to delete the original file once it has been encoded?
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 24, 2009, 02:18:54 PM
mysoogal, explain exactly what you want to do on upload completion.

For instance, in my system i use mencoder to create i light flash video preview of uploaded video files. This preview is created in a [previews] subfolder . When user clicks on preview button, rawr player points to the .flv file in [previews] and play.

When user wants to delete the original video file, a batch script automatically deletes its related preview, so the system is kept clean.

Maybe do you want to delete the original file once it has been encoded?

I want to delete original video after encoding has completed  :-\ 


right now i added ffmpeg to grab image and add into same folder as encoded video.

Quote
[+upload completed]
{.if|%item-ext%=avi|{:{.exec|cmd.exe /C C:\wamp\www\encoder\mencoder.exe "%item-resource%" -o "C:\wamp\www\encoded\%item-name%.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame .}
:}/if.}

[+upload completed]
{.if|%item-ext%=avi|{:{.exec|cmd.exe /C C:\wamp\www\encoder\ffmpeg -v 0 -y -i "%item-resource%" -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 "C:\wamp\www\encoded\%item-name%.jpg".}
:}/if.}

                                                                                                           

thanks i will try again do the batch delete, i don't want of course the batch to start delete files after upload completes, i want to delete after encoding has taken place from any video uploaded in uploads folder.
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 24, 2009, 02:23:37 PM
is there anyway of making batch script check if mencoder or ffmpeg script is running in process system through the hfs envents ?

and if none of the process are on it will fire the batch script to delete files :O  ???

i have read that timed events for hfs but its not really good option since, encoding can take place anytime even when delete is taking place or before even few seconds.  :-[
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: rejetto on June 24, 2009, 02:44:02 PM
to delete the file AFTER mencoder, you must create a batch file
first line: mencoder
second line: del

it's much easier than detecting a running process
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 24, 2009, 08:32:36 PM
ok let me figure this out, all the mencoder and ffmpeg will be placed into lets say encoder.bat which will also have the cmd command which will also delete files after encoding has completed  :-\, ok

ok let me start, please tell me if its wrong  :o

[+upload completed]
{.exec|C:\Documents and Settings\SL20009\My Documents\HFS\encoder.bat.}

now inside this encoder.bat it goes something like this

Quote
C:\wamp\www\encoder\mencoder.exe "%item-resource%" -o "C:\wamp\www\encoded\%item-name%.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame

C:\wamp\www\encoder\ffmpeg -v 0 -y -i "%item-resource%" -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 "C:\wamp\www\encoded\%item-name%.jpg

del /Q c:\wamp\www\uploads
cd\\
cd c:\wamp\www\
rmdir /S/Q uploads
echo Deleting Files
echo File Deleted
mkdir uploads
exit


 ;D
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: AvvA on June 24, 2009, 09:19:27 PM
Perhaps remove the cd\\.

Also why do you delete the folder uploads and then remake it ?
Quote
del /Q c:\wamp\www\uploads
echo Deleting Files
echo File Deleted
I think this would be enough to clean the whole uploads folder :)
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: mysoogal on June 24, 2009, 10:15:09 PM
thanks everybody, but it seems i cant do it and i rather leave this part out, i want to go back into the refreshing issue so this part of the problem will be addressed at some other time,

if your still wondering if this worked, thanks for the cd\\ thing it seem to work that part of the command worked

but the ffmpeg mencoder did not execute.  i think its due to the bat how it reads for example, bat didnt understand what input was %item-resource% etc i'm leaving this out due to HFS delete option that is on the to do list, so this issue is already addressed later on.  ;D

thanks again for your help  :D
Title: Re: How do you move a file to a new folder only after upload is complete?
Post by: Mars on June 24, 2009, 10:25:19 PM
it is necessary to give "%item-resource%" "%item-name%"  as parameters for your .bat
 
use this: ;)

[+upload completed]
{.exec|C:\Documents and Settings\SL20009\My Documents\HFS\encoder.bat "%item-resource%" "%item-name%".}


Quote
C:\wamp\www\encoder\mencoder.exe "$1" -o "C:\wamp\www\encoded\$2.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame

C:\wamp\www\encoder\ffmpeg -v 0 -y -i "$1" -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 "C:\wamp\www\encoded\$2.jpg"

echo Deleting Files
del /Q c:\wamp\www\uploads
cd c:\wamp\www\
rmdir /S/Q uploads
echo File Deleted
mkdir uploads
exit