PyAV-Org / PyAV

Pythonic bindings for FFmpeg's libraries.
https://pyav.basswood-io.com/
BSD 3-Clause "New" or "Revised" License
2.51k stars 365 forks source link

Allow passing "protocol_options" to avio_open2 #1322

Closed WyattBlue closed 3 months ago

WyattBlue commented 8 months ago

Originally posted by @rawler in https://github.com/PyAV-Org/PyAV/issues/704#issuecomment-1320310595

What I really need is a way to pass options to avio_open2. Note that this is already done internally by avformat_open_input, so can already be done for input-containers, but I need a way to do it for output as well.

I can see a few different ways to achieve that;

At this point, I assume the reason we're passing self.options | self.container_options for InputContainer is basic case of backwards compatibility, while enabling/encouraging applications to start passing options separately? I'm guessing we'll at some point want to break that, but make it possible for applications to be rewritten first? (Otherwise, I've misunderstood the intention with container_options.)

Given the above assumption what this PR is trying to do is; Add separate options for the 3d layer of the stack (Codecs, Containers, I/O Protocols), while not breaking backwards compatibility, and ensuring that the API remains consistent across InputContainer and OutputContainer.

On the flip-side; if we don't want to enable applications to pass protocol-options separately and explicitly, why do we want it for container-options?

WyattBlue commented 3 months ago

I don't need this.