-
Notifications
You must be signed in to change notification settings - Fork 116
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
optimize temp frame creation and transcoding #23
base: master
Are you sure you want to change the base?
Conversation
@mergebandit this would seriously reduce some of the issues we've seen with prod Automagical renders running out of disk space in the past. |
@transitive-bullshit Any plans on merging this PR soon? |
@xavierts The PR works fine for 95% of cases, but I've run into an issue with a more involved test case where ffmpeg just halts about 70% of the way through and haven't had time to follow-up. |
@transitive-bullshit : |
The only problem with this approach is that the After running a startup focused around video creation for several years, one hard & fast rule I've found when dealing with I have a few test cases for my previous company that this approach will randomly stall on, and aside from it likely being a bug somewhere in One possibility would be if I published a fork of Thoughts? |
ffmpeg and keeping-it-simple - agree. you never know if some rare option was rigorously tested or even designed to support all uses cases. having 2 active forks sounds bad. maintenance-wise: every fix has to be applied to both, ux-wize: developers would not know which of the forks is better. i can take this branch, build my app based on that, and run some tests on it for a while if that would help with confidence in ffmpeg current options. |
That'd be great @daniel-habib. I'd expect this branch to work for 95% of use cases. |
68a67b7
to
5939d40
Compare
Any update? |
nothing from my side, sorry. |
With the version on By using this version:
It works like a charm, thanks! |
Great to hear @soerface. You can also use the |
Is there any plan on merging this? |
Is this branch still actively developed? |
This works pretty well for my usage, however for some reason the output does not contain audio. Since I edit files with 3-30 GB and only want to add an introduction of 10 seconds, this would make it possible to automate this process. Unfortunately its unfeasible to use the version on master even with |
@badosu : not having audio on a result is kind of a "feature' |
Well, for often used cases the current functionality might be enough but I would expect to be able to concatenate videos with audio without scaling space usage as much as it is at the moment (with resolution x duration). If I have to make additional commands it loses a bit of purpose (which I assume to be user friendly to ffmpeg concatenation commands). |
This PR implements the approach discussed in #8, namely it makes a tradeoff between compute time versus temp storage requirements that should make the program more robust for larger input videos.
Previously, we first extracted all frames from each input video, then rendered the transitions where appropriate, then did a final transcoding pass that was very efficient since it only had one input source as a single stream of frames.
Now, we only extract frames from input videos that are actually used in the transitions, which for larger input videos can be a significant reduction in temp frames extracted. This has the disadvantage, however, that the final transcoding phase is more complex and involves O(n) inputs instead of O(1) inputs.
If we decide to merge this approach, it will necessitate a major version bump to
v2.0.0
.I would like to gather some performance numbers for speed and memory usage before committing to this approach. In my very preliminary tests, the speed has remained approximately the same with a significant reduction in temporary disk and memory usage, though I'm guessing that we should expect speed improvements from longer / larger input videos.
@BrandonCookeDev, @daniel-habib, I'm guessing these changes will interest you. Thoughts & feedback are more than welcome.