Skip to content

Instantly share code, notes, and snippets.

@shivanshtalwar0
Created July 6, 2024 23:20
Show Gist options
  • Select an option

  • Save shivanshtalwar0/fe2f1467be49a3a9031bfb20f3b88479 to your computer and use it in GitHub Desktop.

Select an option

Save shivanshtalwar0/fe2f1467be49a3a9031bfb20f3b88479 to your computer and use it in GitHub Desktop.

Revisions

  1. shivanshtalwar0 created this gist Jul 6, 2024.
    4 changes: 4 additions & 0 deletions grid.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    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