<%
'视频数据定义
ffmpeg = "C:\ffmpeg\bin\ffmpeg.exe"
video = "D:\test\ffmpeg\test2\m1080p1.wmv"
'wscript脚本定义
set WshShell = CreateObject("Wscript.Shell")
str2 = "cmd.exe /c "&ffmpeg&" -i "&video&" 2>&1 -t Duration" 'ffmpeg 命令行 + win环境
set get_time = WshShell.Exec (str2)
n_time = get_time.StdOut.Readall
'截取字符串:视频播放时长
dstr_time=instr(n_time,"Duration") ' 用来判断是否含有某些字符串
dstr_time = dstr_time + 10
str_time=Mid(n_time,dstr_time,8)
'显示结果
Response.write ("<br/>视频文件"&video&"<br/>")
Response.write "<br/>"&"播放时长 = "&str_time
%>