schema
¶
DAG schema definitions for FFmpeg filter graphs.
Classes:
Name | Description |
---|---|
HashableBaseModel |
A base class for hashable dataclasses. |
Node |
A 'Node' represents a single operation in the Directed Acyclic Graph (DAG). |
Stream |
A 'Stream' represents a sequence of data flow in the Directed Acyclic Graph (DAG). |
HashableBaseModel
dataclass
¶
HashableBaseModel()
Bases: Serializable
A base class for hashable dataclasses.
Attributes:
Name | Type | Description |
---|---|---|
hex |
str
|
Get the hexadecimal hash of the object. |
Node
dataclass
¶
Node(
*,
kwargs: FrozenDict[
str, str | int | float | bool | LazyValue
] = FrozenDict({}),
inputs: tuple[Stream, ...] = ()
)
Bases: HashableBaseModel
A 'Node' represents a single operation in the Directed Acyclic Graph (DAG).
Note
Each node in the DAG represents a single operation that transforms the data from its input form to its output form. The node is an essential component of the DAG, as it defines the nature of the operations that are performed on the data.
Methods:
Name | Description |
---|---|
replace |
Replace the old node in the graph with the new node. |
repr |
Get the representation of the node. |
view |
Visualize the Node. |
Attributes:
Name | Type | Description |
---|---|---|
hex |
str
|
Get the hexadecimal hash of the object. |
inputs |
tuple[Stream, ...]
|
Represents the input streams of the node. |
kwargs |
FrozenDict[str, str | int | float | bool | LazyValue]
|
Represents the keyword arguments of the node. |
max_depth |
int
|
Get the maximum depth of the node. |
upstream_nodes |
set[Node]
|
Get all upstream nodes of the node. |
inputs
class-attribute
instance-attribute
¶
inputs: tuple[Stream, ...] = ()
Represents the input streams of the node.
kwargs
class-attribute
instance-attribute
¶
kwargs: FrozenDict[
str, str | int | float | bool | LazyValue
] = FrozenDict({})
Represents the keyword arguments of the node.
max_depth
property
¶
max_depth: int
Get the maximum depth of the node.
Returns:
Type | Description |
---|---|
int
|
The maximum depth of the node. |
upstream_nodes
property
¶
upstream_nodes: set[Node]
Get all upstream nodes of the node.
Returns:
Type | Description |
---|---|
set[Node]
|
The upstream nodes of the node. |
replace
¶
repr
¶
repr() -> str
Get the representation of the node.
Returns:
Type | Description |
---|---|
str
|
The representation of the node. |
view
¶
view(format: Literal['png', 'svg', 'dot'] = 'png') -> str
Visualize the Node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
format
|
Literal['png', 'svg', 'dot']
|
The format of the view. |
'png'
|
Returns:
Type | Description |
---|---|
str
|
The file path of the visualization. |
Stream
dataclass
¶
Stream(
*,
node: Node,
index: int | None = None,
optional: bool = False
)
Bases: HashableBaseModel
A 'Stream' represents a sequence of data flow in the Directed Acyclic Graph (DAG).
Note
Each stream in the DAG is a sequence of operations that transforms the data from its input form to its output form. The stream is an essential component of the DAG, as it defines the order and the nature of the operations that are performed on the data.
Methods:
Name | Description |
---|---|
view |
Visualize the stream. |
Attributes:
Name | Type | Description |
---|---|---|
hex |
str
|
Get the hexadecimal hash of the object. |
index |
int | None
|
Represents the index of the stream in the node's output streams. |
node |
Node
|
Represents the node that the stream is connected to in the upstream direction. |
optional |
bool
|
Represents whether the stream is optional. |
index
class-attribute
instance-attribute
¶
index: int | None = None
Represents the index of the stream in the node's output streams.
Note
See Also: Stream specifiers stream_index
node
instance-attribute
¶
node: Node
Represents the node that the stream is connected to in the upstream direction.
Note
In the context of a data stream, the 'upstream' refers to the source of the data, or where the data is coming from. Therefore, the 'upstream node' is the node that is providing the data to the current stream.
optional
class-attribute
instance-attribute
¶
optional: bool = False
Represents whether the stream is optional.
Note
See Also: Advanced options
view
¶
view(format: Literal['png', 'svg', 'dot'] = 'png') -> str
Visualize the stream.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
format
|
Literal['png', 'svg', 'dot']
|
The format of the view. |
'png'
|
Returns:
Type | Description |
---|---|
str
|
The file path of the visualization. |