The split
operator now does the right thing:
import ffmpeg
overlay_file = ffmpeg.input('overlay.png')
split = (ffmpeg
.input('input.mp4')
.hflip()
.split()
)
(ffmpeg
.concat(
split[0].vflip(),
split[1]
)
.output('out.mp4')
)
This paves the way to having both multi-input and multi-output components. To access particular outputs of a multi-output node, use either the .stream
function or bracket shorthand:
split = in.split()
split0 = split.stream(0)
split1 = split[1]
I decided to forego the automatic split
stuff for now. It was probably more work to add multi-output support right away, but I think it's more correct in the long run. The automatic splitting will eventually happen as a pre-processing step and produce the same kind of graph as though the split
were inserted manually.