Feature request: keepFrames option on renderMedia (frames get deleted when the stitch fails)

Open
#24 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start by locating renderMedia and reading how it creates and removes its temporary frames directory, then follow its call to stitchFramesToVideo. The issue suggests either configurable retention and a frames directory or the smaller behavior of retaining frames only when stitching fails. Done means failed stitching leaves the frames available and reports their path, while the default behavior remains as requested.

Written by the indexing model from the issue text.

Description

renderMedia renders the frames into a temp directory and deletes it in a finally:

} finally {
  // Cleanup temp frames
  fs.rmSync(tmpDir, { recursive: true, force: true });
}

So when stitchFramesToVideo throws (an FFmpeg error, a bad audio source, a full disk), all the rendered frames are deleted too, and the whole render has to be repeated. For long videos the frame render is by far the slowest part. We lost a ~1,600-frame 1080p render this way to the duration=Infinity error from #4.

Could renderMedia get a keepFrames option (default false), and maybe a framesDir option to choose where the frames go? If stitching then fails, the frames stay put, and it would help if the error message included the frames path, so you can retry stitchFramesToVideo() directly.

A smaller version would also help a lot: only keep the frames when the stitch fails, and print where they are.

Dominant language
TypeScript
Stars
159
Forks
32
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from thecodacus/rendiv

All issues in thecodacus/rendiv

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.