Presets¶
Predefined output format presets for common use cases.
Preset¶
- class avblocks.Preset¶
Bases:
objectDefines output presets supported by AVBlocks.
Each preset represents a collection of audio and video properties and parameters. It can be used as an easy way to specify the required output of the transcoder.
```python # Access presets using dot notation preset = Preset.Video.Generic.MP4.H264_720p print(preset) # Output: “generic.mp4.h264.720p”
# Audio presets audio_preset = Preset.Audio.Generic.MP3.CD print(audio_preset) # Output: “mp3.audiocd.192kbps”
# Device-specific presets ipad_preset = Preset.Video.iPad.H264_720p print(ipad_preset) # Output: “ipad.mp4.h264.720p”
# Apple Live Streaming streaming_preset = Preset.Video.AppleLiveStreaming.H264_720p print(streaming_preset) # Output: “wifi.wide.h264.1280x720.30p.4500k.aac.128k” ```
- class Audio¶
Bases:
objectDescribes output audio presets structured by codec and device type.
- class AudioCD¶
Bases:
objectPresets for audio compatible with AudioCD (LPCM, 44100 Hz, stereo, 16-bit)
- class DVD¶
Bases:
objectPresets for audio compatible with DVD-Video
- MP2 = 'mp2.dvd'¶
MPEG-1 Layer 2 audio, 48000Hz (suitable for DVD)
- class Generic¶
Bases:
objectGeneric audio presets (unrelated to specific devices)
- AAC = 'aac'¶
AAC stream in ADTS format, stereo, 128 kbps
- class M4A¶
Bases:
objectM4A presets (AAC audio in MP4 container)
- CBR_128kbps = 'mp4.aac.44100hz.128kbps'¶
AAC audio stream in MP4 format, 44100 Hz, stereo, 128 kbps
- CBR_256kbps = 'mp4.aac.44100hz.256kbps'¶
AAC audio stream in MP4 format, 44100 Hz, stereo, 256 kbps, CBR
- GoodQuality = 'mp4.aac.good.quality'¶
AAC stream in MP4 container, stereo, 128 kbps, CBR
- HighQuality = 'mp4.aac.high.quality'¶
AAC stream in MP4 container, stereo, 160 kbps, CBR
- LowQuality = 'mp4.aac.low.quality'¶
AAC stream in MP4 container, stereo, 96 kbps, CBR
- class MP3¶
Bases:
objectMP3 presets (MPEG-1 Layer 3)
- AMRadio = 'mp3.am.radio.32kbps'¶
MPEG-1 Layer 3 audio, 44100 Hz, 32 kbps, mono
- CBR_128kbps = 'mp3.44100hz.128kbps'¶
MPEG-1 Layer 3 audio, 44100Hz, stereo, 128 kbps
- CBR_256kbps = 'mp3.44100hz.256kbps'¶
MPEG-1 Layer 3 audio, 44100Hz, stereo, 256 kbps
- CD = 'mp3.audiocd.192kbps'¶
MPEG-1 Layer 3 audio, 44100 Hz, 192 kbps, stereo
- FMRadio = 'mp3.fm.radio.32kbps'¶
MPEG-1 Layer 3 audio, 44100 Hz, 96 kbps, stereo
- HiFi = 'mp3.hi.fi.160kbps'¶
MPEG-1 Layer 3 audio, 44100 Hz, 160 kbps, stereo
- Radio = 'mp3.radio.112kbps'¶
MPEG-1 Layer 3 audio, 44100 Hz, 112 kbps, stereo
- Studio = 'mp3.studio.256kbps'¶
MPEG-1 Layer 3 audio, 44100 Hz, 256 kbps, stereo
- Tape = 'mp3.tape.128kbps'¶
MPEG-1 Layer 3 audio, 44100 Hz, 128 kbps, stereo
- Voice = 'mp3.voice.64kbps'¶
MPEG-1 Layer 3 audio, 44100 Hz, 64 kbps, mono
- class OggVorbis¶
Bases:
objectPresets for Vorbis audio in Ogg container
- class WMA¶
Bases:
objectPresets for Windows Media Audio
- class Lossless¶
Bases:
objectPresets for the WMA Lossless codec
- class Professional¶
Bases:
objectPresets for the WMA Pro codec
- VBR_Q100 = 'wma.pro.q100'¶
Windows Media Audio Professional, VBR, 44100 Hz, stereo, Quality 100 (0-100)
- Type:
- VBR_Q75 = 'wma.pro.q75'¶
Windows Media Audio Professional, VBR, 44100 Hz, stereo, Quality 75 (0-100)
- Type:
- class Standard¶
Bases:
objectPresets for the WMA standard codec
- CBR_128kbps = 'wma.cbr.128kbps'¶
Windows Media Audio Standard, CBR, 44100 Hz, stereo, 128 kbps
- Type:
- CBR_160kbps = 'wma.cbr.160kbps'¶
Windows Media Audio Standard, CBR, 44100 Hz, stereo, 160 kbps
- Type:
- CBR_64kbps = 'wma.cbr.64kbps'¶
Windows Media Audio Standard, CBR, 44100 Hz, stereo, 64 kbps
- Type:
- class Video¶
Bases:
objectDescribes output video presets structured by codec and device type.
- class AndroidPhone¶
Bases:
objectPresets for Android phones
- H264_360p = 'android-phone.mp4.h264.360p'¶
H264 Baseline Profile, 30 fps, 480 x 360, 800 kbps
- Type:
- class AndroidTablet¶
Bases:
objectPresets for Android tablets
- H264_720p = 'android-tablet.mp4.h264.720p'¶
H264 Baseline Profile, 30 fps, 1280 x 720, 4000 kbps
- Type:
- class AppleLiveStreaming¶
Bases:
objectPresets for Apple Live Streaming
- Cellular_H264_400x300_30p_400K_AAC_40K = 'cellular.h264.400x300.30p.400k.aac.40k'¶
440 Kbit
- Type:
Apple HTTP Streaming
- Cellular_Wide_H264_400x224_30p_400K_AAC_40K = 'cellular.wide.h264.400x224.30p.400k.aac.40k'¶
440 Kbit
- Type:
Apple HTTP Streaming
- H264_480p = 'wifi.h264.640x480.30p.1200k.aac.96k'¶
Alias for WiFi_H264_640x480_30p_1200K_AAC_96K
- H264_720p = 'wifi.wide.h264.1280x720.30p.4500k.aac.128k'¶
Alias for WiFi_Wide_H264_1280x720_30p_4500K_AAC_128K
- WiFi_H264_1280x960_30p_4500K_AAC_128K = 'wifi.h264.1280x960.30p.4500k.aac.128k'¶
4628 Kbit
- Type:
Apple Live Streaming
- WiFi_H264_640x480_30p_1200K_AAC_96K = 'wifi.h264.640x480.30p.1200k.aac.96k'¶
1296 Kbit
- Type:
Apple Live Streaming
- WiFi_H264_640x480_30p_600K_AAC_96K = 'wifi.h264.640x480.30p.600k.aac.96k'¶
696 Kbit
- Type:
Apple Live Streaming
- WiFi_H264_640x480_30p_800K_AAC_96K = 'wifi.h264.640x480.30p.800k.aac.96k'¶
896 Kbit
- Type:
Apple Live Streaming
- WiFi_H264_960x720_30p_1200K_AAC_96K = 'wifi.h264.960x720.30p.1200k.aac.96k'¶
1296 Kbit
- Type:
Apple Live Streaming
- WiFi_H264_960x720_30p_2500K_AAC_128K = 'wifi.h264.960x720.30p.2500k.aac.128k'¶
2628 Kbit
- Type:
Apple Live Streaming
- WiFi_Wide_H264_1280x720_30p_2500K_AAC_128K = 'wifi.wide.h264.1280x720.30p.2500k.aac.128k'¶
2628 Kbit
- Type:
Apple Live Streaming
- WiFi_Wide_H264_1280x720_30p_4500K_AAC_128K = 'wifi.wide.h264.1280x720.30p.4500k.aac.128k'¶
4628 Kbit
- Type:
Apple Live Streaming
- WiFi_Wide_H264_1920x1080_30p_11000K_AAC_128K = 'wifi.wide.h264.1920x1080.30p.11000k.aac.128k'¶
11128 Kbit
- Type:
Apple Live Streaming
- WiFi_Wide_H264_640x360_30p_1200K_AAC_96K = 'wifi.wide.h264.640x360.30p.1200k.aac.96k'¶
1296 Kbit
- Type:
Apple Live Streaming
- WiFi_Wide_H264_640x360_30p_600K_AAC_96K = 'wifi.wide.h264.640x360.30p.600k.aac.96k'¶
696 Kbit
- Type:
Apple Live Streaming
- WiFi_Wide_H264_960x540_30p_1800K_AAC_128K = 'wifi.wide.h264.960x540.30p.1800k.aac.128k'¶
1928 Kbit
- Type:
Apple Live Streaming
- class AppleTV¶
Bases:
objectPresets for AppleTV devices
- AppleTV2G_MP4_H264_720p = 'appleTV2g.mp4.h264.720p'¶
9, Level 3.1
- Type:
- Type:
H.264, 30 fps, 1280x720, bitrate 5000 kbps, profile Main, aspect 16
- AppleTV3G_MP4_H264_1080p = 'appleTV3g.mp4.h264.1080p'¶
9, Level 4
- Type:
- Type:
H.264, 30 fps, 1920x1080, bitrate 5000 kbps, profile High, aspect 16
- class BDAV¶
Bases:
objectPresets for Blu-ray Disc Audio-Visual MPEG-2 Transport Stream
- H264_1280x720_2398p_PCM = 'bdav-h264-1280x720-23.976p-pcm'¶
9, 15000 kbps
- Type:
- Type:
H.264, 1280 x 720, 23.976 fps progressive, aspect ratio 16
- H264_1280x720_24p_PCM = 'bdav-h264-1280x720-24p-pcm'¶
9, 15000 kbps
- Type:
- Type:
H.264, 1280 x 720, 24 fps progressive, aspect ratio 16
- H264_1280x720_50p_PCM = 'bdav-h264-1280x720-50p-pcm'¶
9, 15000 kbps
- Type:
- Type:
H.264, 1280 x 720, 50 fps progressive, aspect ratio 16
- H264_1280x720_5994p_PCM = 'bdav-h264-1280x720-59.94p-pcm'¶
9, 15000 kbps
- Type:
- Type:
H.264, 1280 x 720, 59.94 fps progressive, aspect ratio 16
- H264_1440x1080_2398p_PCM = 'bdav-h264-1440x1080-23.976p-pcm'¶
9, 25000 kbps
- Type:
- Type:
H.264, 1440 x 1080, 23.976 fps progressive, aspect ratio 16
- H264_1440x1080_24p_PCM = 'bdav-h264-1440x1080-24p-pcm'¶
9, 25000 kbps
- Type:
- Type:
H.264, 1440 x 1080, 24 fps progressive, aspect ratio 16
- H264_1440x1080_50i_PCM = 'bdav-h264-1440x1080-50i-pcm'¶
9, 25000 kbps
- Type:
- Type:
H.264, 1440 x 1080, 50 fps interlaced, aspect ratio 16
- H264_1440x1080_5994i_PCM = 'bdav-h264-1440x1080-59.94i-pcm'¶
9, 25000 kbps
- Type:
- Type:
H.264, 1440 x 1080, 59.94 fps interlaced, aspect ratio 16
- H264_1920x1080_2398p_PCM = 'bdav-h264-1920x1080-23.976p-pcm'¶
9, 25000 kbps
- Type:
- Type:
H.264, 1980 x 1080, 23.976 fps progressive, aspect ratio 16
- H264_1920x1080_24p_PCM = 'bdav-h264-1920x1080-24p-pcm'¶
9, 25000 kbps
- Type:
- Type:
H.264, 1980 x 1080, 24 fps progressive, aspect ratio 16
- H264_1920x1080_50i_PCM = 'bdav-h264-1920x1080-50i-pcm'¶
9, 25000 kbps
- Type:
- Type:
H.264, 1980 x 1080, 50 fps interlaced, aspect ratio 16
- class DVD¶
Bases:
objectPresets for DVD-Video
- class Fast¶
Bases:
objectPresets for fastest possible encoding
- class Generic¶
Bases:
objectGeneric video presets. These presets are not related to any specific device.
- class MP4¶
Bases:
objectGeneric MP4 presets (audio and video streams in MP4 container)
- Base_H264_AAC = 'mp4.h264.aac'¶
AAC, Container: MP4. Does not enforce specific audio and video properties.
- H264_1080p = 'generic.mp4.h264.1080p'¶
9, Level 4
- Type:
- Type:
H.264, 29.97 fps, 1920x1080, bitrate 5400 kbps, profile Baseline, aspect 16
- H264_240p = 'generic.mp4.h264.240p'¶
3, Level 1.3
- Type:
- Type:
H.264, 15 fps, 320x240, bitrate 300 kbps, profile Baseline, aspect 4
- H264_360p = 'generic.mp4.h264.360p'¶
3, Level 3
- Type:
- Type:
H.264, 29.97 fps, 480x360, bitrate 600 kbps, profile Baseline, aspect 4
- H264_480p = 'generic.mp4.h264.480p'¶
3, Level 3
- Type:
- Type:
H.264, 29.97 fps, 640x480, bitrate 900 kbps, profile Baseline, aspect 4
- H264_720p = 'generic.mp4.h264.720p'¶
9, Level 3.1
- Type:
- Type:
H.264, 29.97 fps, 1280x720, bitrate 2400 kbps, profile Baseline, aspect 16
- H264_Wide_360p = 'generic.mp4.h264.wide.360p'¶
9, Level 3
- Type:
- Type:
H.264, 29.97 fps, 640x360, bitrate 720 kbps, profile Baseline, aspect 16
- class WebM¶
Bases:
objectWebM presets
- VP8_3G_240p_350K_Vorbis_64K = 'webm.vp8.3g.240p.350k.vorbis.64k'¶
VP8, 24 fps, 320x240, bitrate 350 kbps, VBR, keyframe distance 120
- Type:
- VP8_4G_360p_700K_Vorbis_64K = 'webm.vp8.4g.360p.700k.vorbis.64k'¶
VP8, 30 fps, 480x360, bitrate 700 kbps, VBR, keyframe distance 150
- Type:
- VP8_SD_480p_1200K_Vorbis_128K = 'webm.vp8.sd.480p.1200k.vorbis.128k'¶
VP8, 30 fps, 640x480, bitrate 1200 kbps, VBR, keyframe distance 300
- Type:
- VP8_SD_576p_1600K_Vorbis_128K = 'webm.vp8.sd.576p.1600k.vorbis.128k'¶
VP8, 25 fps, 720x576, bitrate 1600 kbps, VBR, keyframe distance 250
- Type:
- VP8_Wide_3G_240p_350K_Vorbis_64K = 'webm.vp8.wide.3g.240p.350k.vorbis.64k'¶
VP8, 24 fps, 426x240, bitrate 350 kbps, VBR, keyframe distance 120
- Type:
- VP8_Wide_4G_360p_700K_Vorbis_64K = 'webm.vp8.wide.4g.360p.700k.vorbis.64k'¶
VP8, 30 fps, 640x360, bitrate 700 kbps, VBR, keyframe distance 150
- Type:
- VP8_Wide_HD_1080p_5000K_Vorbis_192K = 'webm.vp8.wide.hd.1080p.5000k.vorbis.192k'¶
VP8, 30 fps, 1920x1080, bitrate 5000 kbps, VBR, keyframe distance 300
- Type:
- VP8_Wide_HD_720p_2500K_Vorbis_192K = 'webm.vp8.wide.hd.720p.2500k.vorbis.192k'¶
VP8, 30 fps, 1280x720, bitrate 2500 kbps, VBR, keyframe distance 300
- Type:
- VP8_Wide_SD_480p_1200K_Vorbis_128K = 'webm.vp8.wide.sd.480p.1200k.vorbis.128k'¶
VP8, 30 fps, 854x480, bitrate 1200 kbps, VBR, keyframe distance 300
- Type:
- class HDV¶
Bases:
objectPresets for High-definition video MPEG-2 Transport Stream
- MPEG_1080i_25p = 'hdv.m2t.1080i.25p'¶
9
- Type:
- Type:
MPEG-2, 25 fps, 1440x1080, aspect ratio 16
- MPEG_1080i_30p = 'hdv.m2t.1080i.30p'¶
9
- Type:
- Type:
MPEG-2, 29.97 fps, 1440x1080, aspect ratio 16
- MPEG_1080p_24p = 'hdv.m2t.1080p.24p'¶
9
- Type:
- Type:
MPEG-2, 23.976 fps, 1440x1080, aspect ratio 16
- MPEG_1080p_25p = 'hdv.m2t.1080p.25p'¶
9
- Type:
- Type:
MPEG-2, 25 fps, 1440x1080, aspect ratio 16
- MPEG_1080p_30p = 'hdv.m2t.1080p.30p'¶
9
- Type:
- Type:
MPEG-2, 29.97 fps, 1440x1080, aspect ratio 16
- class Kindle¶
Bases:
objectPresets for Kindle
- KindleFireHD_8_9_MP4_H264_1080p = 'KindleFireHD8.9.mp4.h264.1080p'¶
9, Level 4
- Type:
- Type:
H.264, 30 fps, 1920x1080, bitrate 5400 kbps, profile Main, aspect 16
- KindleFireHD_MP4_H264_720p = 'KindleFireHD.mp4.h264.720p'¶
9, Level 4
- Type:
- Type:
H.264, 30 fps, 1280x720, bitrate 2200 kbps, profile Main, aspect 16
- class VCD¶
Bases:
objectPresets for Video CD
- class Web¶
Bases:
objectPresets for Facebook, SmugMug, Vimeo, YouTube
- class iPad¶
Bases:
objectPresets for iPad devices
- class iPhone¶
Bases:
objectPresets for iPhone devices
- iPhone3GS_MP4_H264_480 = 'iPhone3gs.mp4.h264.480p'¶
3, Level 3
- Type:
- Type:
H.264, 30 fps, 640x480, bitrate 600 kbps, profile Baseline, aspect 4
- iPhone4S_MP4_H264_1080p = 'iPhone4s.mp4.h264.1080p'¶
9, Level 4.1
- Type:
- Type:
H.264, 30 fps, 1920x1080, bitrate 5000 kbps, profile High, aspect 16
- class iPod¶
Bases:
objectPresets for iPod devices