ASP执行ffmpeg的非组件版

用Wscript.Shell

<%
Server.ScriptTimeout=0
'On Error Resume Next
flvname=request.QueryString("flvname")
'streamPath="../record/streams/_definst_/"&flvname&".flv"
streamPath="dd/"&flvname&".flv"
imgW ="160"
imgY = "120"
imgQuality = "70"
ss="3"
'newName = "../videoimage/"&flvname&".jpg"
newName = "dd/"&flvname&".jpg"
strd="ffmpeg.exe"
strd=server.mappath(strd)
strd=strd+" -i "&server.mappath(streamPath)&" -ss 3 -vframes 1 -r 1 -ac 1 -ab 2 -s "&imgW&"*"&imgY&" -f image2 "&server.mappath(newName)&""
Set WshShell = server.CreateObject("Wscript.Shell")
IsSuccess = WshShell.Run(strd,1,FALSE)
'(strd,1,FALSE)为1时服务器端显示进度,为2时则无
if IsSuccess = 0 Then
Response.Write strd
response.write " <br />成功执行"
else
Response.Write strd
Response.write "<br />命令执行失败!权限不够或者该程序无法运行"
end if
Set WshShell = Nothing
'if err.number <> 0 then
'Response.Write "<p>错误号码:" & Err.number
'Response.Write "<p>原因:" & Err.description
'Response.Write "<p>错误来源:" & Err.Source
'Response.end
'end if
%>

你可能感兴趣的:(ffmpeg)