compile_json
¶
JSON compilation utilities for FFmpeg streams.
Functions:
Name | Description |
---|---|
compile |
Compile a stream into a JSON string. |
parse |
Parse a JSON string into a Stream object. |
compile
¶
compile(stream: Stream, auto_fix: bool = True) -> str
Compile a stream into a JSON string.
This function takes a Stream object representing an FFmpeg filter graph and converts it into a JSON string that can be passed to FFmpeg.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stream
|
Stream
|
The Stream object to compile into a JSON string |
required |
auto_fix
|
bool
|
Whether to automatically fix issues in the stream |
True
|
Returns:
Type | Description |
---|---|
str
|
A JSON string that can be passed to FFmpeg |
parse
¶
parse(json: str) -> Stream
Parse a JSON string into a Stream object.
This function takes a JSON string that can be passed to FFmpeg and converts it into a Stream object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
json
|
str
|
The JSON string to parse into a Stream object |
required |
Returns:
Type | Description |
---|---|
Stream
|
A Stream object |