因为想方便工作,在论坛找到大佬写的批量合并视频的ffmpeg的批处理文件:
@echo off
REM 设置片尾视频所在的子文件夹(请确保片尾、正片都是分辨率相同的视频文件)
set "FolderIn=Resource"
REM 合并之后的视频放在哪个子文件夹
set "FolderOut=Result"
cd /d "%~dp0"
set "FileList=MergeVideo.txt"
md "%FolderOut%" 2>nul
for /f "delims=" %%i in ('dir /b /a-d *.mp4') do (
for /f "delims=" %%j in ('dir /b /a-d "%FolderIn%\*.mp4"') do (
> "%FileList%" echo file '%%i'
>>"%FileList%" echo file '%FolderIn%\%%j'
ffmpeg.exe -f concat -safe 0 -i "%FileList%" -c copy "%FolderOut%\%%~ni+%%~nj%%~xi"
)
)
太特么好用了 就是使用期间出现以下问题,导致生成后的视频出现卡顿 时间异常:
Non-monotonous DTS in output stream 0:0; previous: 21587350, current: 12740928; changing to 21587351. This may result in incorrect timestamps in the output file
本着想自己查明原因的态度上网搜索后发现这个问题是普遍存在的,查到了其他大佬的解决办法:https://blog.csdn.net/qq_42667481/article/details/105522020 但是无奈小弟我实在不懂任何编程,希望有老哥帮忙看看怎么解决问题