Skip to content

Instantly share code, notes, and snippets.

@seaque
Last active June 5, 2023 09:13
Show Gist options
  • Save seaque/97947371029d53b2432c00a69b05d1a2 to your computer and use it in GitHub Desktop.
Save seaque/97947371029d53b2432c00a69b05d1a2 to your computer and use it in GitHub Desktop.
ffmpeg batch files.
@echo off
:again
ffmpeg ^
-i "%~1" ^
"%~p1%~n1.srt"
if NOT ["%errorlevel%"]==["0"] goto:error
echo %~n1 Done!
shift
if "%~1" == "" goto:end
goto:again
:error

echo There was an error.
pause
exit 0
@echo off
echo Processing: "%~nx1"
ffmpeg -v error -stats -y -i "%~1" "%~n1".mp4
if errorlevel 1 pause
@echo off
echo,
set /P ts_start="Start: "
set /P ts_end="End: "
echo Processing: "%~nx1"
ffmpeg -v error -stats -y -ss %ts_start% -i "%~1" -to %ts_end% -c:v copy -c:a copy -avoid_negative_ts 1 -copyts "%~n1"_"trim".mkv
if errorlevel 1 pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment