Codecs

class av.codec.codec.Codec

Bases: object

A single encoding or decoding codec.

This object exposes information about an availible codec, and an avenue to create a CodecContext to encode/decode directly.

>>> codec = Codec('mpeg4', 'r')
>>> codec.name
'mpeg4'
>>> codec.type
'video'
>>> codec.is_encoder
False
audio_formats

A list of supported audio formats, or None.

Type:list of AudioFormat
audio_rates

A list of supported audio sample rates, or None.

Type:list of int
auto_threads
bitmap_sub
channel_conf
create()
delay
descriptor
dr1
draw_horiz_band
experimental
frame_rates

A list of supported frame rates, or None.

Type:list of fractions.Fraction
frame_threads
hwaccel
hwaccel_vdpau
id
intra_only
is_decoder
is_encoder
long_name
lossless
lossy
name
neg_linesizes
param_change
reorder
slice_threads
small_last_frame
subframes
text_sub
truncated
type

The media type of this codec.

Examples: ‘audio’, ‘video’, ‘subtitle’.

Type:str
variable_frame_size
video_formats

A list of supported video formats, or None.

Type:list of VideoFormat
class av.codec.context.CodecContext

Bases: object

bit_rate
bit_rate_tolerance
close(bool strict=True)
codec
static create(codec, mode=None)
decode(Packet packet=None, unsigned int count=0, bool prefer_send_recv=True)

Decode a list of Frame from the given Packet.

If the packet is None, the buffers will be flushed. This is useful if you do not want the library to automatically re-order frames for you (if they are encoded with a codec that has B-frames).

encode(Frame frame=None, unsigned int count=0, bool prefer_send_recv=True)

Encode a list of Packet from the given Frame.

extradata
extradata_size
is_decoder
is_encoder
is_open
max_bit_rate
name
open(bool strict=True)
options

options: dict

parse(str input_, allow_stream=False)
profile
skip_frame
thread_count
thread_type
ticks_per_frame
time_base
type