国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【bat文件+ffmpeg】實現(xiàn)視頻批量分割、轉(zhuǎn)格式、合并

2023-02-26 23:24 作者:星光易冷  | 我要投稿

1.split.bat

echo off

setlocal enabledelayedexpansion


set input=input.mp4

set outputFront=P

set startTime=00:00:00

set /a timeInterval=30

set endTime=00:02:46


call:timeToSec %startTime% s

set /a startSec=%s%


call:timeToSec %endTime% s

set /a endSec=%s%


set /a count=(%endSec%-%startSec%)/%timeInterval%

set /a rest=(%endSec%-%startSec%)%%%timeInterval%


if %rest% neq 0 (

set /a count=%count%+1

)

echo startSec=%startSec%,endSec=%endSec%,rest=%rest%,count=%count%

echo.


for /l %%i in (1,1,%count%) do (

set /a new=!startSec!+%timeInterval%

echo !new!

echo.

set st=void

call:secToTime !startSec! st


if !new! leq !endSec! (

set ed=void

call:secToTime !new! ed

set /a startSec=!new!

echo if1_: !startSec!

) else (

set ed=void

call:secToTime !endSec! ed

set /a startSec=!endSec!

echo if2_: !startSec!

)


echo loop:?%%i,start:?!st!,end:?!ed!

echo.

echo.

rem ffmpeg -i input.mp4 -ss 00:00:00 -to 00:01:30 -c:a copy -c:v copy output.mp4

ffmpeg -i %input% -ss !st! -to !ed! -y -c:a copy -c:v copy "%outputFront%%%i.mp4"

)

pause


REM==========================


:timeToSec

setlocal

set tt=%~1

set /a tt1=%tt:~0,2%

set /a tt2=%tt:~3,2%

set /a tt3=%tt:~6,2%

set /a ss=%tt1%*3600+%tt2%*60+%tt3%

(endlocal

set %~2=%ss%

)

goto:eof



REM==========================


:secToTime

setlocal

set /a s=%~1

set /a s1=%s%/3600

set /a s2=(%s%/60)%%60

set /a s3=%s%%%60

set tt=%s1%:%s2%:%s3%

(endlocal

set %~2=%tt%

)

goto:eof

2.changeFormat.bat

echo off


set inputFront=P

set concatNum=6

set originFormat=.mp4

set outputFormat=.ts


set inputName=concat:

for /l %%i in (1,1,%concatNum%) do (

echo %inputFront%%%i%originFormat%,%inputFront%%%i%outputFormat%

echo.

echo.

rem ffmpeg -i input.mp4 -c:a copy -c:v copy output.ts

ffmpeg -i %inputFront%%%i%originFormat% -y -c:a copy -c:v copy %inputFront%%%i%outputFormat%

)

pause

3.concat.bat

echo off

setlocal enabledelayedexpansion


set inputFront=P

set concatNum=6

set format=.ts

set outputName=test.mp4


set inputName=concat:

for /l %%i in (1,1,%concatNum%) do (

if %%i == %concatNum% (

set inputName=!inputName!%inputFront%

set inputName=!inputName!%%i%format%

) else (

set inputName=!inputName!%inputFront%

set inputName=!inputName!%%i%format%^|

)

)

echo !inputName!

rem ffmpeg -i "concat:01.ts|02.ts|03.ts" -c copy out.mp4

ffmpeg -i !inputName! -y -c:a copy -c:v copy %outputName%

pause

4.split2.bat

@echo off & title

cd /d %~dp0

for %%a in (*.mp4) do (

?ffmpeg -i "%%~sa" -y -codec copy -map 0 -f segment -segment_time 30 -q:v 1 "P%%02d.mp4"

)

pause

【bat文件+ffmpeg】實現(xiàn)視頻批量分割、轉(zhuǎn)格式、合并的評論 (共 條)

分享到微博請遵守國家法律
平阴县| 马边| 铅山县| 中阳县| 灵台县| 鹤壁市| 许昌市| 夹江县| 公主岭市| 纳雍县| 平塘县| 阿巴嘎旗| 吉林省| 安仁县| 冷水江市| 卓资县| 垫江县| 罗城| 青神县| 三江| 贵定县| 离岛区| 丘北县| 克拉玛依市| 千阳县| 卢龙县| 永泰县| 高要市| 武宁县| 石渠县| 松阳县| 东明县| 汪清县| 巩义市| 金堂县| 雷州市| 黄浦区| 金坛市| 凌海市| 星座| 西和县|