Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem assumes 1920x1080 input
- rem viewport:offset
- rem default crop for 4 files is 480:270:720:405
- rem (1920-480)/2 = 720 = 25% horizontally centered
- rem (1080-270)/2 = 405 = 25% vertically centered
- rem
- rem default crop for 2 files is 480:540:720:270
- rem (1920-480)/2 = 720 = 25% horizontally centered
- rem (1080-540)/2 = 270 = 50% vertically centered
- rem enable use of variables defined inside if-blocks using !var! instead of %var%
- setlocal EnableDelayedExpansion
- if not "%~5"=="" (
- goto :inval
- ) else if not "%~4"=="" (
- rem setpts=PTS-STARTPTS
- set "crop=:v] setpts=N/(30*TB), crop=480:270:720:405, drawtext=fontsize=12:fontfile=Consolas:x=8:y=8:fontcolor=white:box=1:boxcolor=black@0.1:text="
- ffmpeg -report -i "%~f1" -i "%~f2" -i "%~f3" -i "%~f4" -filter_complex "[0!crop!'%~n1' [v0]; [1!crop!'%~n2' [v1]; [2!crop!'%~n3' [v2]; [3!crop!'%~n4' [v3]; [v0][v1] hstack=inputs=2 [v01]; [v2][v3] hstack=inputs=2 [v23]; [v01][v23] vstack=inputs=2" -vcodec rawvideo -max_muxing_queue_size 99999 -f nut - | mpv -fs -pause -
- ) else if not "%~3"=="" (
- goto :inval
- ) else if not "%~2"=="" (
- set "crop=:v] setpts=N/(30*TB), crop=480:540:720:270, drawtext=fontsize=12:fontfile=Consolas:x=8:y=8:fontcolor=white:box=1:boxcolor=black@0.1:text="
- ffmpeg -i "%~f1" -i "%~f2" -filter_complex "[0!crop!'%~n1' [v0]; [1!crop!'%~n2' [v1]; [v0][v1] hstack=inputs=2" -vcodec rawvideo -max_muxing_queue_size 99999 -f nut - | mpv -fs -pause -
- ) else (
- goto :inval
- )
- rem pause
- exit
- :inval
- echo drop 2 or 4 files on this bat
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement