def join(*streams, **kwargs): ''' implementation of the ffmpeg join filter for merging multiple input streams, e.g. i1 = ffmpeg.input(file) s1 = i1['1:0'].join(i1['1:1'], inputs=2, channel_layout='stereo', map='0.0-FL|1.0-FR') s1.output('d:/junk/test_join.wav', acodec='pcm_s24le').run() :param streams: the streams to join. :param kwargs: args to pass to join. :return: the resulting stream. ''' return FilterNode(streams, join.__name__, kwargs=kwargs, max_inputs=None).stream()
def amerge(*streams, **kwargs): ''' implementation of the ffmpeg amerge filter for merging multiple input streams, e.g. i1 = ffmpeg.input(file) s1 = i1['1:0'].amerge(i1['1:1'], inputs=6) s1.output('d:/junk/test_join.wav', acodec='pcm_s24le').run() :param streams: the streams to join. :param kwargs: args to pass to join. :return: the resulting stream. ''' return FilterNode(streams, amerge.__name__, kwargs=kwargs, max_inputs=None).stream()
def fps(stream, **kwargs): return FilterNode(stream, "fps", kwargs=kwargs).stream()
def scale(stream, width='iw', height='ih'): return FilterNode(stream, "scale", args=[width, height]).stream()
def crop(stream, width='iw', height='ih', x='0', y='0'): return FilterNode(stream, "crop", args=[width, height, x, y]).stream()
def hstack(*streams, **kwargs): return FilterNode(streams, "hstack", kwargs=kwargs, max_inputs=None).stream()
def blend(*streams, **kwargs): return FilterNode(streams, "blend", kwargs=kwargs, max_inputs=None).stream()