FFmpeg help... deleteing original source after convering

Hey all, actually have 2 sections to this question. First i'm uploading a video and converting to FLV after the upload. This works fine, but i'm trying to take a screenshot of the flv after the conversion but it doesn't work. I do have a workaround. I take first a screenshot of the video before the conversion and then proceed to convert the video. This works fine, but i was wondering if you can capture a screen shot AND convert at the same time. 2nd and most importantly, after the conversion is done, is there anyway that i can delete the original file? I've tried deleting it in the code after the ffmpeg line, but the problem is that it deletes the original before it even gets to the conversion part. Any input would be greatly appreciated. Attached is some of the code i'm using. thanx all!

...>>> can i somehow combine the 2 wscript.run's ?  and then delete?
set wshell = server.createobject("wscript.shell")
wshell.run "ffmpeg -i " & server.MapPath("/videos/" &  newFileName) & " -f image2 -t 0.001 -ss 3 " & server.MapPath("/videos/" &  videoID & ".jpg")
wshell.run "ffmpeg -i " & server.MapPath("/videos/" &  newFileName) & " -y -ar 22050 -ab 32 -f flv -s 320x240 " & server.MapPath("/videos/" &  replace(newFileName,ext,".flv"))
      set wshell = nothing      

                      'Deletes to fast for conversion.
      set fso = server.CreateObject("scripting.filesystemobject")
            fso.deleteFile server.MapPath("/videos/" &  newFileName)
      set fso = nothing

Thanx all
Who is Participating?
onskeeConnect With a Mentor Commented:
One of the optional arguments to supply to .Run is bWaitOnReturn
object.Run(strCommand, [intWindowStyle], [bWaitOnReturn])
If you supply True to this parameter, the command will wait until it's finished processing before it continues to the rest of the script.

So you might do something like:
wshell.run("ffmpeg -i " & server.MapPath("/videos/" &  newFileName) & " -f image2 -t 0.001 -ss 3 ", 0, True)

Hope this helps --
Sorry.. Link didn't post correctly:
engineroomAuthor Commented:
Perfect. Thanx dude!
engineroomAuthor Commented:
Are you still around? Have a quick question to ask...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.