Skip to content

Add frames on the fly? #47

@david-zwicker

Description

@david-zwicker

I'm running a complicated numerical simulation and would like to send frames calculated for a movie to ffmpeg on the fly, e.g., during the calculation. Storing all the data and processing later is impractical since the data would be too large. Is it possible to use the ffmpeg package to achieve this?

In pseudo-code, I want to do something like this:

from ffmpeg import FFmpeg

ffmpeg = (
       FFmpeg()
        .option("y")
        .input("pipe:0")
        .output("output.mp4")
    )

ffmpeg.execute()  # Is this necessary in this case?

for i in range(...):
    # this would be a much more complicated simulation that would calculate a frame
    frame = ... # a NxMx3 array of color values
    ffmpeg.add_frame(frame)

ffmpeg.finalize()  # might be necessary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions