mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2025-04-06 04:15:44 +08:00
#18: use get_stream_spec_nodes
in view
This commit is contained in:
parent
4af484feee
commit
2d6b0d4730
@ -8,7 +8,7 @@ import tempfile
|
|||||||
|
|
||||||
from ffmpeg.nodes import (
|
from ffmpeg.nodes import (
|
||||||
FilterNode,
|
FilterNode,
|
||||||
get_stream_map,
|
get_stream_spec_nodes,
|
||||||
InputNode,
|
InputNode,
|
||||||
OutputNode,
|
OutputNode,
|
||||||
Stream,
|
Stream,
|
||||||
@ -44,12 +44,7 @@ def view(stream_spec, **kwargs):
|
|||||||
if filename is None:
|
if filename is None:
|
||||||
filename = tempfile.mktemp()
|
filename = tempfile.mktemp()
|
||||||
|
|
||||||
nodes = []
|
nodes = get_stream_spec_nodes(stream_spec)
|
||||||
stream_map = get_stream_map(stream_spec)
|
|
||||||
for stream in stream_map.values():
|
|
||||||
if not isinstance(stream, Stream):
|
|
||||||
raise TypeError('Expected Stream; got {}'.format(type(stream)))
|
|
||||||
nodes.append(stream.node)
|
|
||||||
|
|
||||||
sorted_nodes, outgoing_edge_maps = topo_sort(nodes)
|
sorted_nodes, outgoing_edge_maps = topo_sort(nodes)
|
||||||
graph = graphviz.Digraph()
|
graph = graphviz.Digraph()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user