BasswoodAV Documentation¶
BasswoodAV provides Pythonic bindings 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.
BasswoodAV provides direct and precise access to your media via containers, streams, packets, codecs, and frames. It exposes a few transformations of that data, and helps you get your data to/from other packages, such as Numpy.
This power does come with some responsibility as working with media is complicated and BasswoodAV can’t abstract it away or make all the best decisions for you. But where you can’t work without it, BasswoodAV is a critical tool.
Currently we provide:
libavformat
:containers
, audio/video/subtitlestreams
,packets
;libavdevice
(by specifying a format to containers);libavcodec
:Codec
,CodecContext
,BitStreamFilterContext
, audio/videoframes
,data planes
,subtitles
;libswscale
:VideoReformatter
;libswresample
:AudioResampler
;and a few more utilities.
Basic Demo¶
import av
av.logging.set_level(av.logging.VERBOSE)
container = av.open(path_to_video)
for index, frame in enumerate(container.decode(video=0)):
frame.save(f"frame-{index:04d}.jpg")