Bitstream Filters

class av.bitstream.BitStreamFilterContext

Bases: object

Initializes a bitstream filter: a way to directly modify packet data.

Wraps AVBSFContext

  • in_stream (Stream) – A stream that defines the input codec for the bitfilter.

  • out_stream (Stream) – A stream whose codec is overwritten using the output parameters from the bitfilter.

filter(Packet packet=None)

Processes a packet based on the filter_description set during initialization. Multiple packets may be created.




Reset the internal state of the filter. Should be called e.g. when seeking. Can be used to make the filter usable again after draining it with EOF marker packet.