Use FFMpeg to extract part of a video

Standard method of extracting part of a video

ffmpeg -i in.mp4 -ss 00:01:48 -t 00:00:50 edited-out.mp4

General batch script:

@echo off
set /p filename=Enter the input file name (inc extension):
set /p "StartPosition=Start position (HH:MM:SS):
set /p "EndPosition=End position (HH:MM:SS):
echo.
set /A "ss=(((1%EndPosition::=-100)*60+1%-100)-(((1%StartPosition::=-100)*60+1%-100)"
set /A "hh=ss/3600+100,ss%%=3600,mm=ss/60+100,ss=ss%%60+100"
echo.
echo The duration of the output clip=%hh:~1%:%mm:~1%:%ss:~1%
echo.
ffmpeg -i %filename% -ss %StartPosition% -t %hh:~1%:%mm:~1%:%ss:~1% -cpu-used 0 edited-%filename% > ffmpeg-log.txt 2>&1
pause

Script adapted for a Directory Opus Button:

@set log={dlgchoose|This will extract a part of the video.\nDo you want to generate a ffmpeg log after extraction?|yes=> ffmpeg-log.txt 2>&1+no= }

@externalonly
@echo off
set /p "StartPosition=Start position (HH:MM:SS):
set /p "EndPosition=End position (HH:MM:SS):
echo.
set /A "ss=(((1%EndPosition::=-100)*60+1%-100)-(((1%StartPosition::=-100)*60+1%-100)"
set /A "hh=ss/3600+100,ss%%=3600,mm=ss/60+100,ss=ss%%60+100"
echo.
echo The duration of the output clip=%hh:~1%:%mm:~1%:%ss:~1%
echo.
ffmpeg -i {file$} -ss %StartPosition% -t %hh:~1%:%mm:~1%:%ss:~1% -cpu-used 0 edited-{file$} {$log}
pause