zimscraperlib.video.config
Classes:
-
Config–
Config
Config(**kwargs: Any)
Methods:
-
build_from–build a Config easily via shortcut params
-
to_ffmpeg_args–Convert the options dict to list of ffmpeg arguments
-
update_from–Updates Config object based on shortcut params as given in build_from()
Attributes:
-
VERSION– -
audio_codec– -
audio_sampling_rate– -
buffersize– -
defaults(dict[str, str | None]) – -
ext– -
mapping(dict[str, str]) – -
max_video_bitrate– -
mimetype– -
min_video_bitrate– -
options(dict[str, str | None]) – -
quantizer_scale_range– -
target_audio_bitrate– -
target_video_bitrate– -
video_codec– -
video_scale(str | None) –
Source code in src/zimscraperlib/video/config.py
21 22 23 24 | |
VERSION
class-attribute
instance-attribute
VERSION = 1
audio_codec
property
writable
audio_codec
audio_sampling_rate
property
writable
audio_sampling_rate
buffersize
property
writable
buffersize
ext
class-attribute
instance-attribute
ext = 'dat'
mapping
class-attribute
mapping: dict[str, str] = {
"video_codec": "-codec:v",
"audio_codec": "-codec:a",
"max_video_bitrate": "-maxrate",
"min_video_bitrate": "-minrate",
"target_video_bitrate": "-b:v",
"buffersize": "-bufsize",
"audio_sampling_rate": "-ar",
"target_audio_bitrate": "-b:a",
}
max_video_bitrate
property
writable
max_video_bitrate
mimetype
class-attribute
instance-attribute
mimetype = 'application/data'
min_video_bitrate
property
writable
min_video_bitrate
quantizer_scale_range
property
writable
quantizer_scale_range
target_audio_bitrate
property
writable
target_audio_bitrate
target_video_bitrate
property
writable
target_video_bitrate
video_codec
property
writable
video_codec
build_from
classmethod
build_from(**params: Any)
build a Config easily via shortcut params
video_codec: codec for output audio stream. more info https://ffmpeg.org/ffmpeg-codecs.html#Video-Encoders values: h264 | libvpx | libx264 | libx265 | xxx audio_codec: codec for output audio stream. more info https://ffmpeg.org/ffmpeg-codecs.html#Audio-Encoders values: aac | mp3 | flac | opus | libvorbis | xxx max_video_bitrate: maximum size per second for video stream values: 128k | 1m min_video_bitrate: minimum size per second for video stream values: 128k | 1m target_video_bitrate: tentative size per second for video stream values: 384k | 1m target_audio_bitrate: tentative size per second for audio stream values: 48k | 128k buffersize: decoder buffer size values: 1000k | 1m audio_sampling_rate: number of audio samples per second values: 44100 | 48000 quantizer_scale_range: tuple of min / max values of video quantizer scale (VBR) values: (21, 35) | (68, 97) | (x, y) video_scale: video frame scale. more info - https://trac.ffmpeg.org/wiki/Scaling values: 480:320 | 320:240 | width:height
Source code in src/zimscraperlib/video/config.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
to_ffmpeg_args
Convert the options dict to list of ffmpeg arguments
Source code in src/zimscraperlib/video/config.py
32 33 34 35 36 37 38 39 40 41 42 43 | |
update_from
update_from(**kwargs: Any)
Updates Config object based on shortcut params as given in build_from()
Source code in src/zimscraperlib/video/config.py
26 27 28 29 30 | |