PyAV Documentation¶
PyAV is a Pythonic binding for FFmpeg. We aim to provide all of the power and control of the underlying library, but manage the gritty details as much as possible.
Currently we provide the basics of:
libavformat
:containers
, audio/video/subtitlestreams
,packets
;libavdevice
(by specifying a format to containers);libavcodec
:Codec
,CodecContext
, audio/videoframes
,data planes
,subtitles
;libavfilter
:Filter
,Graph
;libswscale
:VideoReformatter
;libswresample
:AudioResampler
;- and a few more utilities.
Basic Demo¶
import av
container = av.open(path_to_video)
for frame in container.decode(video=0):
frame.to_image().save('frame-%04d.jpg' % frame.index)