首页 > Web开发 > 详细

asp+ffmpeg获取视频的时长

时间:2015-09-11 17:45:47      阅读:383      评论:0      收藏:0      [点我收藏+]

 

<%
‘视频数据定义
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  
%>

asp+ffmpeg获取视频的时长

原文:http://my.oschina.net/u/1266171/blog/505048

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!