rem ===================需手动设置=================== rem 设定片头片尾长度,格式为 HH:mm:ss.fff set "s1=00:01:07.0" set "s2=00:01:30.0" rem ================================================
for /f "tokens=1-4delims=:." %%ain ("%s2%") do ( set /a "t2=(1%%a %% 100 *3600 + 1%%b %% 100 * 60 + 1%%c %% 100) * 1000 + 1%%d %% 1000" )
md myvideo 2>nul for%%iin (*.avi *.mkv *.mp4 *.flv) do ( for /f "tokens=2-5delims=:., " %%ain ('ffmpeg -i "%%i" 2^>^&1 ^| find "Duration:"') do ( set /a "t=(1%%a%%100*3600+1%%b%%100*60+1%%c%%100)*1000+1%%d0%%1000,t-=t2,ms=t%%1000,t/=1000" set /a h=t/3600,m=t%%3600/60,s=t%%60,h+=100,m+=100,s+=100,ms+=1000 set "t=!h:~1!:!m:~1!:!s:~1!.!ms:~1!" ffmpeg -ss !s1! -to !t! -accurate_seek -i "%%i" -c copy -avoid_negative_ts 1 "myvideo\%%i" -y ) ) pause
CI_COMMIT_REF_NAME: The branch or tag name for which project is built. CI_CONFIG_PATH: The path to the CI/CD configuration file. Defaults to .gitlab-ci.yml. Read-only inside a running pipeline. CI_PROJECT_PATH: The project namespace with the project name included. CI_BUILDS_DIR: The top-level directory where builds are executed. CI_PROJECT_DIR: The full path the repository is cloned to, and where the job runs from. If the GitLab Runner builds_dir parameter is set, this variable is set relative to the value of builds_dir. For more information, see the Advanced GitLab Runner configuration.