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

Troy/ffmpeg bindings #180

Merged
merged 12 commits into from
Jan 9, 2024
Merged

Troy/ffmpeg bindings #180

merged 12 commits into from
Jan 9, 2024

Conversation

TroyKomodo
Copy link
Member

Proposed changes

Describe the big picture of what you want to change here, to help the maintainers understand why we should accept this pull request. Be sure to link to the issue if it fixes a bug or resolves a feature request.

Types of changes

What types of changes does your code introduce to Scuffle?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, you may want to start the discussion by explaining why you chose the solution you did, what alternatives you considered, etc.

@TroyKomodo TroyKomodo marked this pull request as ready for review January 9, 2024 23:00
@TroyKomodo TroyKomodo requested review from a team as code owners January 9, 2024 23:00
ffmpeg-next-io is a set of io utils for ffmpeg-next which allow for
in-memory buffers to be used with ffmpeg-next.
With the new addition of the `ffmpeg-next-io` crate we can now do
in-memory io with `ffmpeg-next`. Previously we needed to write the file
to a temporary location and then clean it up after the job was complete.
Now we can just buffer the entire file in memory and process it in
place.
In this commit I removed the previous "safe" bindings `ffmpeg-next`.
These bindings were riddled with errors and issues around memory safety
and ownership. I have now manually rewritten the bindings for some of
the functions we need. We still however use the `ffmpeg-sys-next`
library. This library contains no user code but rather is entirely
generated by `rust-bindgen`.
Add the ffmpeg bindings to the transcoder.
Also refactor the transcoder main loop.
Add some helper utils to set a ffmpeg logging callback
@TroyKomodo TroyKomodo requested a review from a team January 9, 2024 23:01
@TroyKomodo TroyKomodo merged commit f4c2577 into feature/website Jan 9, 2024
4 checks passed
@TroyKomodo TroyKomodo deleted the troy/ffmpeg-bindings branch January 9, 2024 23:33
TroyKomodo added a commit that referenced this pull request Jan 9, 2024
*switch transcoder to use ffmpeg-c bindings
- all operations are in-memory
- fine grain control over the threads
- fine grain control of memory usage

all of this allows us to reduce the resource usage of encoding.

*redesign transcoder internals
allowing for a better scalable approach

*fix bug in h265 sps, with calculating width and height

*move away from ffmpeg-next "safe" bindings
The bindings are riddled with mistakes
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

Successfully merging this pull request may close these issues.

1 participant