ralfbiedert / openh264-rs

Idiomatic Rust wrappers around OpenH264.
69 stars 35 forks source link

Allow dynamic resolution changes. #45

Closed algesten closed 6 months ago

algesten commented 7 months ago

If a frame size differs from the previous, reinitialize the openh264 encoder instance with the new parameters.

Close #44

algesten commented 7 months ago

Here's my first stab at this which can be changed and discussed. This change is a breaking change (removing the width/height from config).

I need to do some additional testing in our project to see if this works as intended.

ralfbiedert commented 7 months ago

Will try to look at this a bit later tonight; breaking change is not an issue, will just bump version once merged.

algesten commented 7 months ago

This is a bit wrong. I'm revising it now.

algesten commented 7 months ago

There is still some problem the way we use it that I don't see with our equivalent C-code, however my brain power is over for the week. The general structure is there if you want to check.

I'll pick this up on Monday.

ralfbiedert commented 7 months ago

Just had a quick look, no complaints from my side so far.

lolgesten commented 6 months ago

Cool. I just realised I booked PTO this week and next. I have not forgotten this PR, but I will pick it up in a couple of weeks time.

algesten commented 6 months ago

@ralfbiedert thanks for being patient. This is now working in my tests. I ran into the issue of max resolution, which gave an opaque error.

ralfbiedert commented 6 months ago

Thanks for the PR!

ralfbiedert commented 6 months ago

Just to confirm, was there any other PR you'd like to get into before 0.6?

ralfbiedert commented 6 months ago

Version 0.6 has been released. It contains this PR, and some moderate API changes. It should not take more than a few minutes to upgrade to the new API surface. Feel free to file a follow-up PR / bug report if there are issues.