Skip to content

Instantly share code, notes, and snippets.

@daveio
Created January 5, 2026 20:31
Show Gist options
  • Select an option

  • Save daveio/cbe25988e055572836eb381934b31d51 to your computer and use it in GitHub Desktop.

Select an option

Save daveio/cbe25988e055572836eb381934b31d51 to your computer and use it in GitHub Desktop.
Video compositing
ffmpeg -i stream1.m3u8 -i stream2.m3u8 ... -i stream12.m3u8 \
-filter_complex "
[0:v]scale=640:360[v0];
[1:v]scale=640:360[v1];
...
[11:v]scale=640:360[v11];
[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10][v11]xstack=inputs=12:layout=0_0|640_0|1280_0|1920_0|0_360|640_360|1280_360|1920_360|0_720|640_720|1280_720|1920_720[out]
" -map "[out]" output.m3u8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment