本帖最后由 Wypo 于 2023-8-9 14:29 编辑
回复 13# 877 - @echo off
-
- rem 文件要求,MPEG类的可拼接的格式。直接转avi文件格式
-
- rem %userprofile%\desktop\视音频合并.bat
- rem %userprofile%\desktop\合并列队
- rem %userprofile%\desktop\合并列队\名称A
- rem %userprofile%\desktop\合并列队\AABB
- rem %userprofile%\desktop\合并列队\1234
- rem [media:]1.avi,2.avi,3.avi...200.avi
-
- rem \视音频合并.bat:
-
- rem sFdp:批量目录位置/sInFx:要合并的格式/sOtFx:要保存的格式
- set sFdp=%~dp0合并列队
- set sInFx=.avi
- set sOtFx=.avi
-
- set FFMPEG=X:\ffmpeg\bin\ffmpeg.exe
- set FFMPEG=C:\Users\pc\Desktop\UTOOL\API\FFmpeg\ffmpeg-N-109469-g62da0b4a74-win64-gpl-shared\bin\ffmpeg.exe
-
- set sFdp=%sFdp:"=%
- set sFdp=%sFdp:"=%
- for /f "tokens=*" %%a in ('dir /ad/b "%sFdp%"') do (
- for /f "tokens=*" %%b in ('
- dir /a-d/b "%sFdp%\%%~a"
- ^|find /c /i "%sInFx%"
- ') do if %%b gtr 0 (
- setlocal ENABLEDELAYEDEXPANSION
- set asList[]=concat:
- for /l %%c in (1,1,%%b) do (
- if exist "%sFdp%\%%~a\%%c%sInFx%" (
- set "asList[]=!asList[]!/%sFdp%\%%~a\%%c%sInFx%"
- )
- )
- set "asList[]=!asList[]::/=:!"
- set "asList[]=!asList[]:/=|!"
- rem
- set "sOtFn=%%~a"
- if exist "%sFdp%\%%~a\!sOtFn!%sOtFx%" (
- set $NUL=!Date:~0,10!
- set $NUL=!$NUL:/=!
- set SYS_DATE_TIME=!$NUL:~-8!
- set !NUL=00000000!time:.=!
- set $NUL=!$NUL: =0!
- set $NUL=!$NUL::=!
- set SYS_DATE_TIME=!SYS_DATE_TIME!!$NUL:~-8!
- set "sOtFn=!sOtFn!_!SYS_DATE_TIME!"
- )
- call "%FFMPEG%" -i "!asList[]!" -c:v h264 -c:a aac -q 0 -y "%sFdp%\%%~a\!sOtFn!%sOtFx%"
- endlocal
- )
- )
复制代码
|