From 8c54cbffcf10362e60a21f4cc990fc24c1707aa0 Mon Sep 17 00:00:00 2001 From: Grant Negri Date: Wed, 13 Dec 2023 11:34:21 -0500 Subject: [PATCH] add basic metadata file support --- ffmpeg/_run.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ffmpeg/_run.py b/ffmpeg/_run.py index f42d1d7..f15a5ca 100644 --- a/ffmpeg/_run.py +++ b/ffmpeg/_run.py @@ -117,20 +117,22 @@ def _get_global_args(node): def _get_output_args(node, stream_name_map): if node.name != output.__name__: raise ValueError('Unsupported output node: {}'.format(node)) - args = [] if len(node.incoming_edges) == 0: raise ValueError('Output node {} has no mapped streams'.format(node)) + args = [] + kwargs = copy.copy(node.kwargs) for edge in node.incoming_edges: # edge = node.incoming_edges[0] stream_name = _format_input_stream_name( stream_name_map, edge, is_final_arg=True ) if stream_name != '0' or len(node.incoming_edges) > 1: - args += ['-map', stream_name] + is_metadata_stream = str(kwargs.get("map_metadata")) == str(stream_name) + if not is_metadata_stream: + args += ['-map', stream_name] - kwargs = copy.copy(node.kwargs) filename = kwargs.pop('filename') if 'format' in kwargs: args += ['-f', kwargs.pop('format')]