Containers¶
-
class
av.container.
Container
¶ Bases:
object
-
container_options
¶
-
dumps_format
()¶
-
file
¶
-
format
¶
-
metadata
¶
-
metadata_encoding
¶
-
metadata_errors
¶
-
name
¶
-
options
¶
-
stream_options
¶
-
streams
¶
-
writeable
¶
-
Input Containers¶
-
class
av.container.
InputContainer
¶ Bases:
av.container.core.Container
-
bit_rate
¶
-
close
()¶
-
decode
(streams=None, video=None, audio=None, subtitles=None, data=None)¶ Yields a series of
Frame
from the given set of streams:for frame in container.decode(): # Do something with `frame`.
See also
StreamContainer.get()
for the interpretation of the arguments.
-
demux
(streams=None, video=None, audio=None, subtitles=None, data=None)¶ Yields a series of
Packet
from the given set ofStream
:for packet in container.demux(): # Do something with `packet`, often: for frame in packet.decode(): # Do something with `frame`.
See also
StreamContainer.get()
for the interpretation of the arguments.Note
The last packets are dummy packets that when decoded will flush the buffers.
-
duration
¶
-
seek
(offset, str whence='time', bool backward=True, bool any_frame=False, Stream stream=None)¶ Seek to a (key)frame nearsest to the given timestamp.
- Parameters
offset (int) – Location to seek to. Interpretation depends on
whence
.whence (str) – One of
'time'
,'frame'
, or'byte'
backward (bool) – If there is not a (key)frame at the given offset, look backwards for it.
any_frame (bool) – Seek to any frame, not just a keyframe.
stream (Stream) – The stream who’s
time_base
theoffset
is in.
whence
has the following meanings:'time'
:offset
is instream.time_base
ifstream
elseav.time_base
.'frame'
:offset
is a frame index'byte'
:offset
is the byte location in the file to seek to.
Warning
Not all formats support all options, and may fail silently.
-
size
¶
-
start_time
¶
-