Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frames on the fly? #47

Open
david-zwicker opened this issue Mar 13, 2024 · 0 comments
Open

Add frames on the fly? #47

david-zwicker opened this issue Mar 13, 2024 · 0 comments

Comments

@david-zwicker
Copy link

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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant