0

我对这个小脚本编译器返回错误“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
4

1 回答 1

3

我建议你更换%

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

"每种情况下。

那样可能会更好一些...

于 2013-06-28T13:36:35.323 回答