Bitstream Filters¶
- class av.bitstream.BitStreamFilterContext¶
Bases:
objectInitializes a bitstream filter: a way to directly modify packet data.
Wraps AVBSFContext
- Parameters:
in_stream (
Stream,Codec, str, or None) – Defines the input codec for the bitfilter. AStreamcopies the full input codec parameters, while aCodecor a codec-namestronly pins the input codec, which is all a codec-specific filter (such ash264_mp4toannexb) needs to initialize.out_stream (Stream) – A stream whose codec is overwritten using the output parameters from the bitfilter.
- filter(Packet packet: Packet | None = None)¶
Processes a packet based on the filter_description set during initialization. Multiple packets may be created.
- flush()¶
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.