Types
Introspection
Bases: Dynamic
Introspection holds internal media information and technical details from media resources. The media introspection may vary based on the media type and underlying library.
Usage:
# Introspect from ffprobe video info or PIL.Image, etc.
video = Introspection(**ffprobe)
image = Introspection(**PIL.Image)
# Introspection dynamically receives all the metadata from the underlying library output.
# The "WARNING" here is that based on the media type,
# the introspection content could change and requires an extra review.
File
Bases: Media[Path]
Local media file representation. This class is used to represent any media stored in local host.
Usage:
# Introspect from ffprobe video info or PIL.Image, etc.
video_meta = Introspection(**ffprobe)
# create a local file with metadata information
file = File(Path("local_video.mp4"), video_meta)
Engine(lib)
Bases: ABC
Engine implements a media engine adapter. It uses an underlying library as an interface to process media files. It produce output based on the provided settings.
Initialize a new instance with bound library
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lib |
Any
|
Any underlying lib |
required |
Source code in nucleus/sdk/processing/types.py
58 59 60 61 62 63 64 |
|
compile()
Compile engine settings into an map of arguments
Returns:
Type | Description |
---|---|
Iterator[Tuple[str, Any]]
|
A new map of compiled arguments based on settings |
Source code in nucleus/sdk/processing/types.py
66 67 68 69 70 71 72 |
|
configure(setting)
Add setting to media processing context
Parameters:
Name | Type | Description | Default |
---|---|---|---|
setting |
Settings
|
The setting to apply to the engine output. |
required |
Returns:
Type | Description |
---|---|
Engine
|
Engine object |
Source code in nucleus/sdk/processing/types.py
74 75 76 77 78 79 80 81 82 |
|
introspect(path)
abstractmethod
Return technical information of the input media.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
The media path |
required |
Returns:
Type | Description |
---|---|
Introspection
|
Any technical information collected from media. |
Source code in nucleus/sdk/processing/types.py
84 85 86 87 88 89 90 91 |
|
save(path)
abstractmethod
Store the new media based on settings and bound library.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
The output path |
required |
Returns:
Type | Description |
---|---|
File
|
File object |
Raises:
Type | Description |
---|---|
ProcessingEngineError
|
If any exception is captured during processing |
Source code in nucleus/sdk/processing/types.py
93 94 95 96 97 98 99 100 101 |
|