Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Loosely based on #565
Additional discussion in #489
This adds bindings for AVBSFContext (BitStreamFilterContext)
I decided against adding binding for AVBitStreamFilter, because it seems like a little bit useless API. You can't do anything with such object besides creating a new BSF context. (except checking which codecs are supported for that BSF, I guess)
It makes the code simpler and imo easier to maintain. Let me know if this is a mistake and those bindings should be added as well.
I think it makes sense to force BitstreamFilterContext creation through the string parsing API, since that's the only way I can see how to set filter options and also allows things like filter chains, etc.
Adds tests for 'chomp', 'setts' and 'h264_mp4toannexb' filters. We could also test that filter chains work.
h264_mp4toannexb requires that AVCodecParameters *par_in is set correctly. To that end BitStreamFilterContext takes a Stream as an argument and copies the codec parameters from there.
There are also attributes
time_base_in
,time_base_out
which are probably required for 100% support of setts option constraints. Let me know if those should be hooked up as well. I guess it would require that BitStreamFilterContext takes separate in_stream, out_stream arguments instead of single stream.