Skip to content

VP9 Encoding support and feature gating#69

Open
netshade wants to merge 8 commits intooddity-ai:mainfrom
netshade:vp9-encoding-and-feature-gating
Open

VP9 Encoding support and feature gating#69
netshade wants to merge 8 commits intooddity-ai:mainfrom
netshade:vp9-encoding-and-feature-gating

Conversation

@netshade
Copy link
Copy Markdown

@netshade netshade commented Nov 2, 2025

Adds presets to support encoding videos via VP9 ( a friendlier / cheaper licensing situation for FFMPEG distributions ), and puts the availability of H264 and VP9 behind crate features. Also exposes a .set method on Options to allow more easily mutating an Options dictionary, and allows the AvCodec to be provided in the Settings struct rather than being calculated, so that callers can have more freedom in encoding settings.

Also adds a runnable example that exercises the encoding pipeline, with configurable parameters.

@netshade
Copy link
Copy Markdown
Author

netshade commented Nov 2, 2025

The runnable example can be invoked via cargo run --example encode -- --help to see the parameters supported. A simple run to produce an H264 video ( as per the original README example ) would be cargo run --example encode -- rainbow.mp4.

…nsure that threading config is permissive to larger core counts
@netshade
Copy link
Copy Markdown
Author

netshade commented Nov 2, 2025

Apologies for the post PR change, but added some additional behaviors to:

  • Allow RUST_LOG to be used when invoking the encode example, so that FFMPEG library outputs can be analyzed
  • By default set a permissive threading config, such that FFMPEG will attempt to auto detect optimal thread usage during the encode process

@netshade
Copy link
Copy Markdown
Author

netshade commented Nov 4, 2025

After using this branch as a consumer in a separate lib, came across a few things I missed including re-exporting constants to allow for codec selection, and not selecting the right libvpx derivative for VP9 encoding.

@gerwin3
Copy link
Copy Markdown
Contributor

gerwin3 commented Nov 25, 2025

I like these changes but I'm a bit short on time. Would you be able to separate the different improvements in this PR into separate PRs? That allows me to at least merge the smaller ones (such as feature gating h264) and I can look at the VP9 support later. Also the example in a separate PR would be great.

@netshade
Copy link
Copy Markdown
Author

Yeah I can break it out, though I'd also add that after some usage of my own fork of this lib, I think the feature gating stuff might be overkill. I believe? that might be more or less accomplished by fetching codecs via AvCodecId, so no additional gating necessary. If that sounds right to you, I could strip that from this and remove the example, so it'd just be VP9 here then.

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.

2 participants