Created
July 6, 2024 23:20
-
-
Save shivanshtalwar0/fe2f1467be49a3a9031bfb20f3b88479 to your computer and use it in GitHub Desktop.
ffmpeg grid for 4 videos on cuda device
This file contains 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
ffmpeg -y -hwaccel cuda \ | |
-i video1.mp4 -hwaccel cuda -i video2.mp4 -hwaccel cuda -i video3.mp4 -hwaccel cuda -i video4.mp4 \ | |
-filter_complex "[0:v]scale=iw/2:ih/2[v0];[1:v]scale=iw/2:ih/2[v1];[2:v]scale=iw/2:ih/2[v2];[3:v]scale=iw/2:ih/2[v3];[v0][v1]hstack[top];[v2][v3]hstack[bottom];[top][bottom]vstack" \ | |
-c:v h264_nvenc -preset fast -b:v 5M output.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment