Skip to content

Encoding longer clips #1114

@Yozer

Description

@Yozer

Hello!

I'm looking into the new video encoder functionalities. So for looks great but I'm not understanding one part of API (maybe it's too early?).
Assuming I have a long video and I do:
decoder -> model pipeline -> encode processed frames

how I can achieve the above with:
VideoEncoder(frames=frames, frame_rate=frame_rate),to_file('result.mp4')
Looks like the api requires to have all frames ready up front which is impossible for longer clips.
I would expect something like:

encoder = VideoEncoder(codec="hevc", frame_rate=30)
for frame in decoder:
   frame = process(frame)
   encoder.encode(frame)

encoder.close()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions