Generate multiple -map for outputs with multiple incoming edges

This commit is contained in:
Davide Depau 2017-12-21 17:13:53 +01:00
parent 44091f8a4a
commit aa0b0bbd03
No known key found for this signature in database
GPG Key ID: C7D999B6A55EFE86

View File

@ -93,11 +93,16 @@ def _get_output_args(node, stream_name_map):
if node.name != output.__name__:
raise ValueError('Unsupported output node: {}'.format(node))
args = []
assert len(node.incoming_edges) == 1
edge = node.incoming_edges[0]
stream_name = "[{}{}]".format(stream_name_map[edge.upstream_node, edge.upstream_label], "" if not edge.upstream_selector else ":{}".format(edge.upstream_selector))
if stream_name != '[0]':
args += ['-map', stream_name]
if len(node.incoming_edges) == 0:
raise ValueError("Output node {} has no mapped streams")
for edge in node.incoming_edges:
# edge = node.incoming_edges[0]
stream_name = "[{}{}]".format(stream_name_map[edge.upstream_node, edge.upstream_label], "" if not edge.upstream_selector else ":{}".format(edge.upstream_selector))
if stream_name != '[0]':
args += ['-map', stream_name]
kwargs = copy.copy(node.kwargs)
filename = kwargs.pop('filename')
fmt = kwargs.pop('format', None)