I have two MP4 files and would like to merge them side by side (to show a visual comparison) but not divided by a vertical border but rather a diagonal from bottom left to top right. Is this possible?
You can use the blend filter to achieve this.
There is an example which does almost what you want, you just need to substitute X
for W-X
to get the diagonal split to go in your desired direction.
Note that filtering requires your inputs to be transcoded which may not be what you are after, depending on what exactly it is you are trying to show with your visual comparison.
Here's an example which will generate a 10s diagonally split clip: ffmpeg -f lavfi -i testsrc -f lavfi -i testsrc -filter_complex "[1:v] negate [a]; [0:v][a]blend=all_expr='if(gt((W-X),(Y*(W/H))),A,B)'" -c:v libx264 -crf 18 -t 10 diags.ts