我遇到了这个脚本编译器返回错误"invalid switch -f“的问题。这让我大吃一惊:-|你能帮我吗?非常感谢。
@echo off
set maxbytesize=2000000000
set /a c=1
setlocal ENABLEDELAYEDEXPANSION
FOR /f %%i in ('dir /b /a-d %D:\Temp\IKS\MAO\*.MP4%') do ffmpeg\bin\ffmpeg.exe -i %%i -c copy -bsf:v h264_mp4toannexb -f mpegts %%~ni.ts
FOR /f %%i in ('dir /b /a-d %D:\Temp\IKS\MAO\*.ts%') do (
if %%~zi GTR %maxbytesize% (
echo file '%%i' >> ts_list.txt
) else (
echo file '%%i' >> ts_list.txt
set /a c=c+1
ffmpeg\bin\ffmpeg.exe -f concat -i ts_list.txt -c copy output_!c!.mp4
del /f ts_list.txt
del /f *.ts
)
)
endlocal发布于 2013-06-28 21:36:35
我建议你换掉%
FOR /f %%i in ('dir /b /a-d HERE>> %D:\Temp\IKS\MAO\*.MP4% << HERE
FOR /f %%i in ('dir /b /a-d HERE>> %D:\Temp\IKS\MAO\*.ts% << AND HERE每种情况下都使用"。
那样可能会更好一点。
https://stackoverflow.com/questions/17365777
复制相似问题