在线转flv+flash在线录制视频

需要用到的组件
ASPExec
mencoder
ffmpeg.exe

第一步骤: 在线转换

Set Executor = Server.CreateObject("ASPExec.Execute")
Executor.Application = "cmd /c mencoder E:\qiancheng\upload\"&request.QueryString("keys")&" -o E:\qiancheng\shipin\record\streams\_definst_\record\"&lid&"\"&keys&".flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -lavcopts vcodec=flv:vbitrate=200:mbd=2:mv0:v4mv:last_pred=3:dia=3:cmp=3:vb_strategy=1 -vf scale=330:-3 -ofps 12 -srate 22050"
Executor.Parameters = ""
strResult = Executor.ExecuteDosApp

asp执行 .bat文件

第二步骤: 通过ffmpeg生成所略图+fso 删除源件

Server.ScriptTimeout=0
flvname=keys
streamPath="../shipin/record/streams/_definst_/record/"&lid&"/"&flvname&".flv"
imgW ="120"
imgY = "90"
imgQuality = "100"
ss="3"
newName = "../upload/"&flvname&".jpg"
str="e:\qiancheng\webadmin\ffmpeg.exe"
str=str+" -i "&server.mappath(streamPath)&" -ss 3 -vframes 1 -r 1 -ac 1 -ab 2 -s 120*90 -f image2 "&server.mappath(newName)&""
Set shellffmpeg=server.CreateObject("ffmpeg.shellffmpeg")
aa=shellffmpeg.shellffmpeg1(str)
Set shellffmpeg = Nothing
'删除上传的文件
tupianid="../upload/"&request.QueryString("keys")
set   fso=server.CreateObject("scripting.filesystemobject")   
if fso.FileExists(Server.MapPath(tupianid))   then   
fso.deletefile(server.MapPath(tupianid))   
end if   
set fso=nothing

你可能感兴趣的:(Flash)