Last active
March 1, 2024 08:16
-
-
Save seaque/b3f8dbfdb7830589113e4d7f0f6f0392 to your computer and use it in GitHub Desktop.
FFmpeg batch file for trimming videos with downmix 5.1 to stereo and subtitles from source video.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:again | |
set /P start="Start: " | |
set /P end="End: " | |
set /P bit="Bitrate: " | |
set /P max="Maxrate: " | |
ffmpeg ^ | |
-ss %start% ^ | |
-to %end% ^ | |
-i "%~1" ^ | |
-c:v libx264 ^ | |
-b:v %bit% ^ | |
-maxrate %max% ^ | |
-threads 10 ^ | |
-c:a dca ^ | |
-strict -2 ^ | |
-af "volume=1.7, pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3" ^ | |
"%~p1%~n1_1.mp4" | |
"%~p1%~n1.srt" | |
if NOT ["%errorlevel%"]==["0"] goto:error | |
echo [92m%~n1 Done![0m | |
shift | |
if "%~1" == "" goto:end | |
goto:again | |
:error | |
echo [93mThere was an error. | |
pause | |
exit 0 | |
:end | |
cls | |
echo [92mEncoding succesful. This window will close after 7 seconds.[0m | |
timeout /t 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment