Support multiple identical inputs

Author: coppitCreated Sep 26, 2025Updated Aug 28, 2026

I can't construct this command line:

ffmpeg -i input.mov -i input.mov -filter_complex '[0:v]trim=end_frame=2:start_frame=1[s0];[s0]transpose=dir=clock[s1];[s1]crop=h=0.5in_h:w=0.5in_w:x=(in_w-out_w)/2:y=(in_h-out_h)/2[s2];[1:v]trim=end_frame=2:start_frame=1[s3];[s3]transpose=dir=clock[s4]' -map '[s2]' -f null - -map '[s4]' -f null -

because topo_sort() and the node's repr together cause input nodes created with the same filename to be merged. The error message says:

ValueError: Encountered transpose(dir='clock') <19764baa829a> with multiple outgoing edges with same upstream label None; a split filter is probably required

but I don't want to write special code for when my two clips happen to be from the same file.

By the way, this sort of thing also comes up when you're trying to run vidstabdetect on two clips which happen to be from the same file.

The only workaround I can think of is to create temporary symlinks with unique names, and use them as inputs.