-
Notifications
You must be signed in to change notification settings - Fork 5
fix: handle missing audio bitrate in some muxers #32
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
fix: handle missing audio bitrate in some muxers #32
Conversation
bajankristof
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @elthariel! Thanks for the opening up this PR!
I would handle this a little differently.
In the min_bit_rate method at the bottom of the changed file we have a values.compact. I would modify that method to use values.filter_map instead of values.compact and filter out nils and 0 values there (that way it applies to all adjusted_* methods.
Also can you please add at least one spec to back up this new functionality?
Finally please use all lowercase for the commit message.
Thanks again for opening the PR!
0ae7a7d to
80aa4aa
Compare
|
Thanks for the quick replay @bajankristof. I've updated my PR accordingly. If you allow me to abuse this PR chat space to ask you a question (feel free to ignore), I'm wondering how you'd recommend implementing two pass encoding using your lib. I'm specifically interested in webm 2-pass encoding. A naive approach could just be to call transcode twice with 2 different presets, but was wondering if you had any ideas or plan regarding this. |
@elthariel it looks like there are some linter errors to fix (weirdly enough some are for files you haven't even touched, but still) we currently don't have plans to extend the functionality with multi-pass specific transcoders, so for the moment being your best bet is to use presets like you said, I also don't see any straightforward API to back this up ATM (maybe a pass1_preset.transcode!(media, File::NULL)
pass2_preset.transcode!(media, 'actualoutput.mp4')this is already pretty easy on the eyes |
80aa4aa to
2c27266
Compare
2c27266 to
5bb8270
Compare
|
I was fixing the lint while you were answering me. It should be green now. As for two pass, I thank you for your feedback 💌 . I'll dabble with this soon-ish and report back (maybe with a doc PR) |
|
@elthariel thanks for the contribution! I'll have a github release soon (because of some other features that are still in beta, this will go into the |
|
No rush, I'm still pulling from my fork |
|
Thanks for your patience and reactivity ! 🙏 |
I don't know the precise conditions in which it happens, but I've multiple webm files where the audio bitrate isn't stored in the headers, in which case ffmpeg returns a bitrate of 0.
In that case, the bitrate used during transcode is set to 0, using the default for the codec instead of the user provided value.