diff --git a/src/ffmpeg/dag/schema.py b/src/ffmpeg/dag/schema.py index 72a7b7ad..7293d127 100644 --- a/src/ffmpeg/dag/schema.py +++ b/src/ffmpeg/dag/schema.py @@ -69,6 +69,10 @@ def _repr_png_(self) -> bytes: # pragma: no cover with open(self.view(format="png"), "rb") as f: return f.read() + def _repr_svg_(self) -> bytes: # pragma: no cover + with open(self.view(format="svg"), "rb") as f: + return f.read() + @dataclass(frozen=True, kw_only=True) class Node(HashableBaseModel, ABC): @@ -182,3 +186,25 @@ def upstream_nodes(self) -> set[Node]: output |= input.node.upstream_nodes return output + + def view(self, format: Literal["png", "svg", "dot"] = "png") -> str: + """ + Visualize the Node. + + Args: + format: The format of the view. + + Returns: + The file path of the visualization. + """ + from ..utils.view import view + + return view(self, format=format) + + def _repr_png_(self) -> bytes: # pragma: no cover + with open(self.view(format="png"), "rb") as f: + return f.read() + + def _repr_svg_(self) -> bytes: # pragma: no cover + with open(self.view(format="svg"), "rb") as f: + return f.read() diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[not config][graph].png b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[not config][graph].png index a91c5de9..bfbc5c3d 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[not config][graph].png and b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[not config][graph].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[not set with global args][graph].png b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[not set with global args][graph].png index 67d13085..c942e8fb 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[not set with global args][graph].png and b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[not set with global args][graph].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set n is False with global args][graph].png b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set n is False with global args][graph].png index 67d13085..c942e8fb 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set n is False with global args][graph].png and b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set n is False with global args][graph].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set n is True with global args][graph].png b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set n is True with global args][graph].png index 507db13c..174149c2 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set n is True with global args][graph].png and b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set n is True with global args][graph].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y is True with global args0][graph].png b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y is True with global args0][graph].png index 3dfc4209..3fcb64b4 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y is True with global args0][graph].png and b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y is True with global args0][graph].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y is True with global args1][graph].png b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y is True with global args1][graph].png index 67d13085..c942e8fb 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y is True with global args1][graph].png and b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y is True with global args1][graph].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y with overwrite_output][graph].png b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y with overwrite_output][graph].png index 3dfc4209..3fcb64b4 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y with overwrite_output][graph].png and b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_global_node_with_args_overwrite[set y with overwrite_output][graph].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_node_prop[global-node][graph].png b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_node_prop[global-node][graph].png index 71d0c4bf..84c94c81 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_node_prop[global-node][graph].png and b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_node_prop[global-node][graph].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_node_prop[merge-output-node][graph].png b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_node_prop[merge-output-node][graph].png index 67e52eb9..5b4c0815 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_node_prop[merge-output-node][graph].png and b/src/ffmpeg/dag/tests/__snapshots__/test_nodes/test_node_prop[merge-output-node][graph].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_dag[org].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_dag[org].png index ec745259..d7534f96 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_dag[org].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_dag[org].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][org].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][org].png index ec745259..d7534f96 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][org].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][org].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace A - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace A - E].png index 125921c3..7fdc9600 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace A - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace A - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace B - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace B - E].png index 4ccf65ce..02b65d1e 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace B - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace B - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace C - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace C - E].png index 9c56762d..85c0d0e1 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace C - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace C - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace D - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace D - E].png index 8e02b05c..d0a388db 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace D - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[linear][replace D - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][org].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][org].png index 4f5562bd..d8703dfe 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][org].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][org].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace A - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace A - E].png index 0c1b2e31..35edfa89 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace A - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace A - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace B - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace B - E].png index 27c6a6dc..61d118e2 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace B - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace B - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace C - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace C - E].png index 0f31b677..a3e6241a 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace C - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace C - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace D - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace D - E].png index 8e02b05c..d0a388db 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace D - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[multi_loop][replace D - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][org].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][org].png index 28cc34c1..009007ba 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][org].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][org].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace A - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace A - E].png index 2c4d4a2a..479d4c69 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace A - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace A - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace B - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace B - E].png index 1a0d7b54..24bfcaa1 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace B - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace B - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace C - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace C - E].png index 0f31b677..a3e6241a 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace C - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace C - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace D - E].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace D - E].png index 8e02b05c..d0a388db 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace D - E].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[simple_loop][replace D - E].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][org].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][org].png index 6096e5bc..777bc1cc 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][org].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][org].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace B - B#].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace B - B#].png index 5477b868..572df03a 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace B - B#].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace B - B#].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace C - C##].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace C - C##].png index cef6d4e9..dc2cc2b2 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace C - C##].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace C - C##].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace C - C#].png b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace C - C#].png index 75ece79c..b9fe0bec 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace C - C#].png and b/src/ffmpeg/dag/tests/__snapshots__/test_schema/test_replace[update_node][replace C - C#].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][add-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][add-split].png index 156f2c8a..ae7747eb 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][add-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][add-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][before].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][before].png index 76998531..d3628159 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][before].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][before].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][remove-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][remove-split].png index 76998531..d3628159 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][remove-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream-2][remove-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][add-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][add-split].png index 6ce0b322..ca7f9467 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][add-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][add-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][before].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][before].png index 7625c425..e220d5ca 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][before].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][before].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][remove-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][remove-split].png index 7625c425..e220d5ca 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][remove-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[amix-stream][remove-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][add-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][add-split].png index 4932c084..055fbbca 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][add-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][add-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][before].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][before].png index 81343913..84618828 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][before].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][before].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][remove-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][remove-split].png index 81343913..84618828 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][remove-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[complex-stream][remove-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][add-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][add-split].png index 4ccc3ec4..46991d4e 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][add-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][add-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][before].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][before].png index d333fe6b..9ace62be 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][before].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][before].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][remove-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][remove-split].png index 4ccc3ec4..46991d4e 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][remove-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[not-utilize-split][remove-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][add-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][add-split].png index 28a67f2b..9712dd9a 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][add-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][add-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][before].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][before].png index d2eb00bc..1d23598c 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][before].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][before].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][remove-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][remove-split].png index 31e13631..2419863e 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][remove-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-duplicate][remove-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][add-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][add-split].png index 4ccc3ec4..46991d4e 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][add-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][add-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][before].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][before].png index d333fe6b..9ace62be 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][before].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][before].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][remove-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][remove-split].png index 4ccc3ec4..46991d4e 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][remove-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reduntant-split-outputs-1][remove-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][add-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][add-split].png index e052595f..3371750e 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][add-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][add-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][before].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][before].png index e052595f..3371750e 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][before].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][before].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][remove-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][remove-split].png index e052595f..3371750e 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][remove-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-input][remove-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][add-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][add-split].png index 1f33df7d..afd5730d 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][add-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][add-split].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][before].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][before].png index 97d82222..ceb9a20f 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][before].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][before].png differ diff --git a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][remove-split].png b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][remove-split].png index 97d82222..ceb9a20f 100644 Binary files a/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][remove-split].png and b/src/ffmpeg/dag/tests/__snapshots__/test_validate/test_rebuild_graph[reuse-stream][remove-split].png differ diff --git a/src/ffmpeg/utils/view.py b/src/ffmpeg/utils/view.py index a19cc141..aab75227 100644 --- a/src/ffmpeg/utils/view.py +++ b/src/ffmpeg/utils/view.py @@ -59,6 +59,6 @@ def view(node: Node, format: Literal["png", "svg", "dot"]) -> str: for node in context.all_nodes: for idx, stream in enumerate(node.inputs): - graph.edge(stream.node.hex, node.hex, label=f"{stream.index or '*'} => {idx}") + graph.edge(stream.node.hex, node.hex, label=f"{'*' if stream.index is None else stream.index} => {idx}") return graph.render(engine="dot")