Created by: depau
import ffmpeg
i = ffmpeg.input("test.ogg")
s = i.split(5)
l = [s[i].output("out"+str(i)) for i in range(5)]
o = ffmpeg.merge_outputs(*l)
print(o.get_args())
['-i', 'test.ogg', '-filter_complex', '[0]split=5[s0][s1][s2][s3][s4]', '-map', '[s0]', 'out0', '-map', '[s1]', 'out1', '-map', '[s2]', 'out2', '-map', '[s3]', 'out3', '-map', '[s4]', 'out4']
Split filter is now used as split=5
, which works. Should be done automatically, but this works for now. I didn't want to subclass stuff as I saw you're trying to avoid that as much as possible.
We could subclass FilterNode
to SplitNode
and override stream
to take note of how many splits are actually being done.