class av.buffer.Buffer

Bases: object

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


The memory address of the buffer.


The size of the buffer in 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).


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..