ASP执行ffmpeg的非组件版

本文介绍了一种利用FFmpeg从FLV视频文件中截取指定时间点图片的方法,并通过Wscript.Shell在服务器端执行相关命令。具体实现了设置图片尺寸、质量等参数的功能。
用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
%>

转载于:https://www.cnblogs.com/MaxIE/archive/2006/11/29/576569.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值