- if not "%~1"=="p" start /min zmd.exe /c %0 p&exit
- @echo off
-
- for /l %%A in (100001,1,102000) do (
- call :foo1 %%A
- )
- exit /b
-
- :foo1
- :: 删除testout中零字节ts最好e:\n零字节也删除一下一定要删除零字节因为零字节ts会导致合并视频失败从而导致testtesttest.ts不变大而不断重启下载进程我为这个浪费了好几天才找到原因
- :: for /r E:\N\testout %%i in (*.ts) do @(if %%~zi EQU 0 del "%%i" /f)
- set basename=%1
- set /a basename2=%1+1
- set basename=%basename:~1%
- set basename2=%basename2:~1%
- :loop
- call copy E:\testout\%basename%.ts E:\testout\test /y
- fciv.exa E:\testout\test\%basename%.ts -md5>11.txt
- :: 等待120秒的原因是如果文件变大则再复制00001.ts其22txt的md5是不一样的fciv不能访问被1exe下载的文件所以要复制
- timeout /nobreak /t 120
- :: 调用hebing.bat合并视频
- call "E:\testout\test\hebing.bat"
- call copy E:\testout\%basename%.ts E:\testout\test /y
-
-
- fciv.exa E:\testout\test\%basename%.ts -md5>22.txt
- fc.exa /b 11.txt 22.txt > nul
- if errorlevel 1 (
- :: 视频变大则跳转至此代码块开头隔120秒再监视是否变大
- goto loop
- ) else (
-
- :: 视频不变大则启动新下载任务
- taskkill /f /im 1.exe
- taskkill /f /im cmd.exe
- for /r E:\testout\test %%i in (*.ts) do @(if %%~zi EQU 0 del "%%i" /f)
- start cmd /k "1.exe -y -i http://64.1643.17.9:389/.m3u8 %basename2%.ts"
- :: 跳转至代码块2 1+1等于2 所以goto 11
-
- )
- exit /b
复制代码
|