本帖最后由 77七 于 2023-2-4 12:23 编辑
- @echo off
- cd /d "%~dp0"
- for /f "delims=" %%i in ('dir /b /s /ad') do (
- pushd "%%i"
- for /f "delims=" %%a in ('dir /b /a-d *.ts') do (
- echo file '%%~fa'
- )>>temp.txt
- if exist temp.txt (
- ffmpeg -f concat -safe 0 -i temp.txt -c copy "%%~ni.mp4"
- for /f "tokens=2 delims='" %%b in ('type "temp.txt"') do (
- del "%%b"
- )
- del temp.txt
- )
- popd
- )
- pause
复制代码
加了个合并后删除功能,如果数据非常重要,可以删掉,第10、11、12这三行直接删除,以防合并出现错误、或效果不理想后丢失源文件
使用前先备份 |