Buffers

class av.buffer.Buffer

Bases: av.buffer._Buffer

A base class for PyAV objects which support the buffer protocol, such as Packet and Plane.

buffer_ptr

The memory address of the buffer.

buffer_size

The size of the buffer in bytes.

to_bytes()

Return the contents of this buffer as bytes.

This copies the entire contents; consider using something that uses the buffer protocol as that will be more efficient.

This is largely for Python2, as Python 3 can do the same via bytes(the_buffer).

update(input)

Replace the data in this object with the given buffer.

Accepts anything that supports the buffer protocol, e.g. bytes, Numpy arrays, other Buffer objects, etc..