Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rem this script will loop all mkv files in folder
- rem it will create a single jpg from the mkv video found and embed it in the output video
- rem it will rename the video output by appending the text "(1080p)" to the end of file name
- rem at it will -map the video stream and name the stream "set title="%%~nI" (mkv video's name)
- rem it will capture audio stream 0:2 and name it "Surround 5.1 (DTS)"
- rem it will re-encode audio stream 0:2 to eac encoder
- rem it will delete the jpg at the end of encoding
- @echo off
- setlocal enabledelayedexpansion
- prompt $g
- color 0a
- pushd "%~dp0"
- set FF=C:\MAB\local64\bin-video\ffmpeg.exe
- :: create cover art jpg file
- for %%G in (*.mkv) do (
- %FF% -hide_banner -ss 30 -y -i "%%G" -vframes 1 -an cover.jpg
- )
- :: run ffmpeg x265
- for %%I in (*.mkv) do (
- set fname="%%~nxI"
- set title="%%~nI"
- set fout="%%~nI(1080p).mkv"
- call :runFF !fname! !title! !fout!
- del /s /q *.jpg
- pause
- goto:eof
- )
- :runFF
- %FF% ^
- -y ^
- -i "%~1" ^
- -attach cover.jpg ^
- -map_metadata 0 ^
- -map_chapters 0 ^
- -metadata title="%~2" ^
- -map 0:0 -metadata:s:v:0 language=eng -metadata:s:s:0 language=eng -metadata:s:s:0 title="English" -metadata:s:t:0 filename="cover.jpg" -metadata:s:t:0 mimetype="image/jpeg" ^
- -map 0:2 -metadata:s:a:0 language=eng -metadata:s:a:0 title="Surround 5.1 (DTS)" ^
- -c:v libx265 -preset medium -crf 20 -vf "scale=1920:-1" -threads 0 ^
- -c:a ac3 -b:a 640k -ac 6 ^
- "%~3"
- exit /b
Add Comment
Please, Sign In to add comment