Skip to content

Allow editing multiple videos at the same time. #480

@Eggiverse

Description

@Eggiverse

Problem

I am trying to make several videos that share some logics.
I realize I have to completely finish 1 video before starting making another one since CURRENT_VIDEO contains only 1 video object.
This makes my code less neat since I want to create several similar objects that belong to different video in a loop.

My solution

If objects can be created by naming the video object where they should be explicitly, it will enable making several videos at the same time. For example:

videos = [Video(500, 500) for i in 1:10]

......

obs = []
for (i, video) in enumerate(videos)
    ob = Object(video, frames, create_fun, Point(0,0))
    push!(obs, ob)
end

......

for (i, video) in enumerate(videos)
    render(video; "output/$i.mp4")
end

New Object api should work with existing api well because of multiple dispatch.
A new method of Object and other related functions like Background can be added.

For example:

function Object(video::Video, frames, func::Function, start_pos::Union{Object,Point}; kwargs...)
# Do not check if CURRENT_VIDEO is empty or not.
......

end

Construction of Video should also be altered to meet the new requirement. I haven't come up with a good idea about how.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions