Skip to content

python composition of various media types using moviepy

Notifications You must be signed in to change notification settings

safhac/RenderingEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple rendering engine


Background (1 min read)


Composition:

class Composition(NamedTuple):
    resolution: Resolution
    framerate: Framerate
    duration: Duration
    data: List[Layer]

Layer:

class Layer(NamedTuple):
    layer_type: ClipType
    layer_name: Name
    layer_args: ARGS

Executer:

class CompositionExecuter:
    
    def __init__(CompositionReader, CompositionRenderer)
    
    def execute(Composition):
        validated_data = reader.validate(composition)
        await renderer.render(validated_data)
    

Renderer:

class CompositionRenderer:
    
    def __init__(LayerRenderer)
        
    def render(CompositionSpec):
        instatiate each layer using _module_  
        ...    
        process the composition rendering 

Reader:

class CompositionReader(CompositionProvider):
    
    def __init__(LayerReader)
        
    def provide_composition_spec(Composition)-> CompositionSpec:
        validate each layer using LayerReader 
        ...    
        return validated Composition 

Validation:

class LayerSpec(BaseModel):
    1. provide generic mechanism to validate variadic 3rd party _module_ classes
    2. validate layer type belongs to _module_
    3. validate layer arguments are legal to the type
    

About

python composition of various media types using moviepy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages