fedora wrote:
那是「關鍵幀」的問題...(恕刪)
ahwaiyuen98 wrote:
你好像甚麼都没看,#27...(恕刪)
感謝樓上兩位大大的詳細解說
來陰的 wrote:
但又出現一個問題了 就是切出來的影片 前半秒會定格這樣
nwm310 wrote:
用ffmpeg無損剪...(恕刪)
@echo off
set "aa=.;%path%"
for %%a in (ffmpeg.exe ffprobe.exe) do (
if "%%~$aa:a" == "" echo need %%a & pause & exit /b
)
::=====================
set mp4=
if "%~x1" == ".mp4" set mp4="%~1"
if "%mp4%" == "" echo drag mp4 to here & set /p mp4=
set "mp4=%mp4:"=%"
set mp4="%mp4%"
if not exist %mp4% echo %mp4% not exist & pause & exit /b
if not %mp4% == %mp4:'=% echo single quote exist & pause & exit /b
for %%a in (%mp4%) do (
set mp4="%%~sa"
set outMp4="%%~na_out%%~xa"
)
if exist %outMp4% echo %outMp4% exist & pause & exit /b
::=========================
set timeRange=
echo input startTime endTime startTime endTime
echo for example:
echo 0:10 0:20 1:3:5 1:3:30
set /p timeRange=
if "%timeRange%" == "" echo no startTime exist & pause & exit /b
::===================
set txt=concat.txt
set ffCmd=ffprobe.exe -select_streams v
set ffCmd=%ffCmd% -show_entries "frame=pkt_pts_time"
set ffCmd=%ffCmd% -of csv -sexagesimal
cd.> %txt%
call :aa %timeRange%
ffmpeg -n -safe 0 -f concat -i %txt% -c copy %outMp4%
goto :eof
::=========================
:aa
if "%~1" == "" goto :eof
for %%a in (%mp4:\=/%) do echo file '%%~a' >> %txt%
for /f "delims=, tokens=2" %%a in ('%ffCmd% -read_intervals %~1%%+#1 %mp4%') do (
echo inpoint %%a >> %txt%
)
if not "%~2" == "" echo outpoint %~2 >> %txt%
shift & shift
goto aa