30 lines
514 B
Batchfile
Executable File
30 lines
514 B
Batchfile
Executable File
@echo off
|
|
setlocal
|
|
|
|
if "%~3"=="" (
|
|
echo Usage: %~nx0 input_file start_time end_time
|
|
echo Example: %~nx0 video.mp4 00:01:30 00:02:45
|
|
echo Example: %~nx0 video.mp4 90 165
|
|
exit /b 1
|
|
)
|
|
|
|
set "INPUT=%~1"
|
|
set "START=%~2"
|
|
set "END=%~3"
|
|
|
|
set "OUTPUT=%~dpn1_cropped%~x1"
|
|
|
|
ffmpeg -hide_banner -loglevel error ^
|
|
-ss %START% ^
|
|
-to %END% ^
|
|
-i "%INPUT%" ^
|
|
-c copy ^
|
|
"%OUTPUT%"
|
|
|
|
if errorlevel 1 (
|
|
echo Failed.
|
|
exit /b 1
|
|
)
|
|
|
|
echo Done.
|
|
echo Output: "%OUTPUT%" |