- @echo off
- chcp 65001 >nul
- rem 批处理保存为utf-8编码格式
- for /d %%d in (*) do (
- pushd "%%d"
- setlocal enabledelayedexpansion
- set n=0
- for /f "delims=" %%i in ('dir /b /a-d *.mp4') do (
- if %%~ni gtr !n! set n=%%~ni
- )
- (for /l %%l in (1,1,!n!) do (
- if exist "%%l.mp4" echo file '%%l.mp4'
- ))>xxx.txt
- endlocal
- if exist xxx.txt if not exist "%~dp0%%~nxd.mp4" (
- ffmpeg.exe -f concat -safe 0 -i xxx.txt -c copy "%~dp0%%~nxd.mp4"
- )
- del xxx.txt 2>nul
- popd
- )
- pause
复制代码
|