我正在尝试剪辑一堆视频,下面的脚本可以工作,但它没有保留字幕。有没有办法保留字幕?
@Echo Off
SetLocal
Set "ext=mkv"
Set "opts=-v quiet"
Set "opts=%opts% -print_format "compact=print_section=0:nokey=1:escape=csv""
Set "opts=%opts% -show_entries "format=duration""
If Exist *.%ext% (If Not Exist "Trimmed\" MD Trimmed)
For %%a In (*.%ext%) Do Call :Sub "%%~a"
Exit/B
:Sub
For /f "Tokens=1* Delims=." %%a In (
'C:\ffmpeg\bin\FFProbe %opts% %1') Do (Set/A "ws=%%a-8.25" & Set "ps=%%b")
rem If %ws% Lss 20 GoTo :EOF
Set/A hh=ws/(60*60), lo=ws%%(60*60), mm=lo/60, ss=lo%%60
If %hh% Lss 10 Set hh=0%hh%
If %mm% Lss 10 Set mm=0%mm%
If %ss% Lss 10 Set ss=0%ss%
C:\ffmpeg\bin\FFMpeg -i %1 -ss 00:01:54 -to %hh%:%mm%:%ss%.%ps:~,3% -c:v copy -c:a copy "Trimmed\%~1"