展开全部
不清楚你的实际文件/情况,仅以问题中的说明为据
复制粘贴到记事本,另存为xx.bat,编码选ANSI,跟要处理的文件放一起运行
/*&cls&echo off&mode con lines=3000
rem 获取视频的相关属性信息(名字、大小、创建日期、时长、分辨率、帧数、帧率、比特率)
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
cd /d "%~dp0"
set ext=*.mp4 *.mkv *.rmvb *.mov
set "outfile=#result.csv"
type nul>"%outfile%"
set "exefile=ffprobe.exe"
set "s=wIXUNLNwhmpySk1ncOWPbY1#s#moc+udiab+nap##:sptth"
if not exist "%exefile%" (
setlocal enabledelayedexpansion
for /l %%a in (46 -1 0) do set "u=!u!!s:~%%a,1!"
set "u=!u:#=/!"
set "u=!u:+=.!"
echo;"%exefile%" not found
echo;download from: !u! 提取码:ncti, then extract the zipfile and put *.exe/*.bat together
endlocal
goto end
)
for /f "delims=" %%a in ('dir /a-d/b %ext%') do (
rem echo;"%%a"
%exefile% -v error -select_streams v:0 -show_entries stream -of json "%%a" 2>&1|cscript -nologo -e:jscript "%~f0" "%%a"
)
:end
echo;%#% +%$%%$%/%@% %z%
pause
exit
*/
var fso=new ActiveXObject('Scripting.FileSystemObject');
var a='*',b='*',c='*',d='*',e='*',f='*',g='*',h='*',i='*';
var file=fso.GetFile(WSH.Arguments(0));
a='"'+file.Name+'"';
b=formatsize(file.Size);
c=formattime(file.DateCreated);
while(!WSH.StdIn.AtEndOfStream){
var line=WSH.StdIn.ReadLine();
var m2=line.match(/"duration": *"(\d+)(?:\.\d+)?"/);
if(m2){
var t=Number(m2[1]);
var ho=Math.floor(t / 3600);
var mi=Math.floor(t / 60) % 60;
var se=t % 60;
hh=ho<10?'0'+ho.toString():ho.toString();
mm=mi<10?'0'+mi.toString():mi.toString();
ss=se<10?'0'+se.toString():se.toString();
d=hh+':'+mm+':'+ss;
}
var m3=line.match(/"width": *(\d+)/);
if(m3){e=m3[1];}
var m4=line.match(/"height": *(\d+)/);
if(m4){f=m4[1];}
var m5=line.match(/"nb_frames": *"([^"]+?)"/);
if(m5){g=m5[1];}
var m6=line.match(/"avg_frame_rate": *"([^"]+?)"/);
if(m6){h=eval(m6[1]).toFixed(2);}
var m7=line.match(/"bit_rate": *"([^"]+?)"/);
if(m7){i=(Number(m7[1])/1000).toFixed(2);}
}
WSH.StdErr.WriteLine(a+','+b+','+c+','+d+','+e+','+f+','+g+','+h+','+i);
function formattime(t){
var dt=new Date(t);
var ymd=dt.getFullYear()+'-'+add(dt.getMonth()+1)+'-'+add(dt.getDate());
var hms=add(dt.getHours()+1)+':'+add(dt.getMinutes())+':'+add(dt.getSeconds());
return ymd+' '+hms;
}
function formatsize(s){
var size=s + 'B';
if(s>=1073741824){
size=(s/1073741824).toFixed(2) + 'GB';
}else{
if(s>=1048576){
size=(s/1048576).toFixed(2) + 'MB';
}else{
if(s>=1024){
size=(s/1024).toFixed(2) + 'KB';
}
}
}
return size;
}
function add(t){return Number(t)<10?'0'+t:t;}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询