Created
December 2, 2021 17:48
-
-
Save pinxau1000/655993039b1b960c84e2586545895de7 to your computer and use it in GitHub Desktop.
FFMPEG Pixel Formats Python Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PixelFormatsAsDict: | |
""" | |
Use this class to easily access pixel format properties. Also useful to use as an enumeration to PixelFormat class. | |
Each pixel format is a dictionary with the following keys: | |
>> name: The Name of the Pixel Format. | |
>> pixel_bits: The Number of Bits per Pixel. | |
>> components: The Number of Components. | |
>> is_input_format: Supported Input format for conversion. | |
>> is_output_format: Supported Output format for conversion. | |
>> is_hardware_accel_format: Hardware accelerated format. | |
>> is_paletted_format: Paletted format. | |
>> is_bitstream_format: Bitstream format. | |
""" | |
yuv420p = { | |
"name": "yuv420p", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuyv422 = { | |
"name": "yuyv422", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb24 = { | |
"name": "rgb24", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr24 = { | |
"name": "bgr24", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p = { | |
"name": "yuv422p", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p = { | |
"name": "yuv444p", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv410p = { | |
"name": "yuv410p", | |
"pixel_bits": 9, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv411p = { | |
"name": "yuv411p", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gray = { | |
"name": "gray", | |
"pixel_bits": 8, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
monow = { | |
"name": "monow", | |
"pixel_bits": 1, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": True | |
} | |
monob = { | |
"name": "monob", | |
"pixel_bits": 1, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": True | |
} | |
pal8 = { | |
"name": "pal8", | |
"pixel_bits": 8, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": True, | |
"is_bitstream_format": False | |
} | |
yuvj420p = { | |
"name": "yuvj420p", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuvj422p = { | |
"name": "yuvj422p", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuvj444p = { | |
"name": "yuvj444p", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
xvmcmc = { | |
"name": "xvmcmc", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
xvmcidct = { | |
"name": "xvmcidct", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
uyvy422 = { | |
"name": "uyvy422", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
uyyvyy411 = { | |
"name": "uyyvyy411", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr8 = { | |
"name": "bgr8", | |
"pixel_bits": 8, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr4 = { | |
"name": "bgr4", | |
"pixel_bits": 4, | |
"components": 3, | |
"is_input_format": False, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": True | |
} | |
bgr4_byte = { | |
"name": "bgr4_byte", | |
"pixel_bits": 4, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb8 = { | |
"name": "rgb8", | |
"pixel_bits": 8, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb4 = { | |
"name": "rgb4", | |
"pixel_bits": 4, | |
"components": 3, | |
"is_input_format": False, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": True | |
} | |
rgb4_byte = { | |
"name": "rgb4_byte", | |
"pixel_bits": 4, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
nv12 = { | |
"name": "nv12", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
nv21 = { | |
"name": "nv21", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
argb = { | |
"name": "argb", | |
"pixel_bits": 32, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgba = { | |
"name": "rgba", | |
"pixel_bits": 32, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
abgr = { | |
"name": "abgr", | |
"pixel_bits": 32, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgra = { | |
"name": "bgra", | |
"pixel_bits": 32, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gray16be = { | |
"name": "gray16be", | |
"pixel_bits": 16, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gray16le = { | |
"name": "gray16le", | |
"pixel_bits": 16, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv440p = { | |
"name": "yuv440p", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuvj440p = { | |
"name": "yuvj440p", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva420p = { | |
"name": "yuva420p", | |
"pixel_bits": 20, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vdpau_h264 = { | |
"name": "vdpau_h264", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vdpau_mpeg1 = { | |
"name": "vdpau_mpeg1", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vdpau_mpeg2 = { | |
"name": "vdpau_mpeg2", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vdpau_wmv3 = { | |
"name": "vdpau_wmv3", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vdpau_vc1 = { | |
"name": "vdpau_vc1", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb48be = { | |
"name": "rgb48be", | |
"pixel_bits": 48, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb48le = { | |
"name": "rgb48le", | |
"pixel_bits": 48, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb565be = { | |
"name": "rgb565be", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb565le = { | |
"name": "rgb565le", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb555be = { | |
"name": "rgb555be", | |
"pixel_bits": 15, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb555le = { | |
"name": "rgb555le", | |
"pixel_bits": 15, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr565be = { | |
"name": "bgr565be", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr565le = { | |
"name": "bgr565le", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr555be = { | |
"name": "bgr555be", | |
"pixel_bits": 15, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr555le = { | |
"name": "bgr555le", | |
"pixel_bits": 15, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vaapi_moco = { | |
"name": "vaapi_moco", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vaapi_idct = { | |
"name": "vaapi_idct", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vaapi_vld = { | |
"name": "vaapi_vld", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p16le = { | |
"name": "yuv420p16le", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p16be = { | |
"name": "yuv420p16be", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p16le = { | |
"name": "yuv422p16le", | |
"pixel_bits": 32, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p16be = { | |
"name": "yuv422p16be", | |
"pixel_bits": 32, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p16le = { | |
"name": "yuv444p16le", | |
"pixel_bits": 48, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p16be = { | |
"name": "yuv444p16be", | |
"pixel_bits": 48, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vdpau_mpeg4 = { | |
"name": "vdpau_mpeg4", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
dxva2_vld = { | |
"name": "dxva2_vld", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb444le = { | |
"name": "rgb444le", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb444be = { | |
"name": "rgb444be", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr444le = { | |
"name": "bgr444le", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr444be = { | |
"name": "bgr444be", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
ya8 = { | |
"name": "ya8", | |
"pixel_bits": 16, | |
"components": 2, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr48be = { | |
"name": "bgr48be", | |
"pixel_bits": 48, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr48le = { | |
"name": "bgr48le", | |
"pixel_bits": 48, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p9be = { | |
"name": "yuv420p9be", | |
"pixel_bits": 13, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p9le = { | |
"name": "yuv420p9le", | |
"pixel_bits": 13, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p10be = { | |
"name": "yuv420p10be", | |
"pixel_bits": 15, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p10le = { | |
"name": "yuv420p10le", | |
"pixel_bits": 15, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p10be = { | |
"name": "yuv422p10be", | |
"pixel_bits": 20, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p10le = { | |
"name": "yuv422p10le", | |
"pixel_bits": 20, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p9be = { | |
"name": "yuv444p9be", | |
"pixel_bits": 27, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p9le = { | |
"name": "yuv444p9le", | |
"pixel_bits": 27, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p10be = { | |
"name": "yuv444p10be", | |
"pixel_bits": 30, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p10le = { | |
"name": "yuv444p10le", | |
"pixel_bits": 30, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p9be = { | |
"name": "yuv422p9be", | |
"pixel_bits": 18, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p9le = { | |
"name": "yuv422p9le", | |
"pixel_bits": 18, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vda_vld = { | |
"name": "vda_vld", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp = { | |
"name": "gbrp", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp9be = { | |
"name": "gbrp9be", | |
"pixel_bits": 27, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp9le = { | |
"name": "gbrp9le", | |
"pixel_bits": 27, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp10be = { | |
"name": "gbrp10be", | |
"pixel_bits": 30, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp10le = { | |
"name": "gbrp10le", | |
"pixel_bits": 30, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp16be = { | |
"name": "gbrp16be", | |
"pixel_bits": 48, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp16le = { | |
"name": "gbrp16le", | |
"pixel_bits": 48, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva422p = { | |
"name": "yuva422p", | |
"pixel_bits": 24, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva444p = { | |
"name": "yuva444p", | |
"pixel_bits": 32, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva420p9be = { | |
"name": "yuva420p9be", | |
"pixel_bits": 22, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva420p9le = { | |
"name": "yuva420p9le", | |
"pixel_bits": 22, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva422p9be = { | |
"name": "yuva422p9be", | |
"pixel_bits": 27, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva422p9le = { | |
"name": "yuva422p9le", | |
"pixel_bits": 27, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva444p9be = { | |
"name": "yuva444p9be", | |
"pixel_bits": 36, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva444p9le = { | |
"name": "yuva444p9le", | |
"pixel_bits": 36, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva420p10be = { | |
"name": "yuva420p10be", | |
"pixel_bits": 25, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva420p10le = { | |
"name": "yuva420p10le", | |
"pixel_bits": 25, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva422p10be = { | |
"name": "yuva422p10be", | |
"pixel_bits": 30, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva422p10le = { | |
"name": "yuva422p10le", | |
"pixel_bits": 30, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva444p10be = { | |
"name": "yuva444p10be", | |
"pixel_bits": 40, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva444p10le = { | |
"name": "yuva444p10le", | |
"pixel_bits": 40, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva420p16be = { | |
"name": "yuva420p16be", | |
"pixel_bits": 40, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva420p16le = { | |
"name": "yuva420p16le", | |
"pixel_bits": 40, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva422p16be = { | |
"name": "yuva422p16be", | |
"pixel_bits": 48, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva422p16le = { | |
"name": "yuva422p16le", | |
"pixel_bits": 48, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva444p16be = { | |
"name": "yuva444p16be", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuva444p16le = { | |
"name": "yuva444p16le", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vdpau = { | |
"name": "vdpau", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
xyz12le = { | |
"name": "xyz12le", | |
"pixel_bits": 36, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
xyz12be = { | |
"name": "xyz12be", | |
"pixel_bits": 36, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
nv16 = { | |
"name": "nv16", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
nv20le = { | |
"name": "nv20le", | |
"pixel_bits": 20, | |
"components": 3, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
nv20be = { | |
"name": "nv20be", | |
"pixel_bits": 20, | |
"components": 3, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgba64be = { | |
"name": "rgba64be", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgba64le = { | |
"name": "rgba64le", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgra64be = { | |
"name": "bgra64be", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgra64le = { | |
"name": "bgra64le", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yvyu422 = { | |
"name": "yvyu422", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
vda = { | |
"name": "vda", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
ya16be = { | |
"name": "ya16be", | |
"pixel_bits": 32, | |
"components": 2, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
ya16le = { | |
"name": "ya16le", | |
"pixel_bits": 32, | |
"components": 2, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrap = { | |
"name": "gbrap", | |
"pixel_bits": 32, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrap16be = { | |
"name": "gbrap16be", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrap16le = { | |
"name": "gbrap16le", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
qsv = { | |
"name": "qsv", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
mmal = { | |
"name": "mmal", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
d3d11va_vld = { | |
"name": "d3d11va_vld", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
cuda = { | |
"name": "cuda", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb = { | |
"name": "0rgb", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
rgb0 = { | |
"name": "rgb0", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr = { | |
"name": "0bgr", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bgr0 = { | |
"name": "bgr0", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p12be = { | |
"name": "yuv420p12be", | |
"pixel_bits": 18, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p12le = { | |
"name": "yuv420p12le", | |
"pixel_bits": 18, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p14be = { | |
"name": "yuv420p14be", | |
"pixel_bits": 21, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv420p14le = { | |
"name": "yuv420p14le", | |
"pixel_bits": 21, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p12be = { | |
"name": "yuv422p12be", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p12le = { | |
"name": "yuv422p12le", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p14be = { | |
"name": "yuv422p14be", | |
"pixel_bits": 28, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv422p14le = { | |
"name": "yuv422p14le", | |
"pixel_bits": 28, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p12be = { | |
"name": "yuv444p12be", | |
"pixel_bits": 36, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p12le = { | |
"name": "yuv444p12le", | |
"pixel_bits": 36, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p14be = { | |
"name": "yuv444p14be", | |
"pixel_bits": 42, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv444p14le = { | |
"name": "yuv444p14le", | |
"pixel_bits": 42, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp12be = { | |
"name": "gbrp12be", | |
"pixel_bits": 36, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp12le = { | |
"name": "gbrp12le", | |
"pixel_bits": 36, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp14be = { | |
"name": "gbrp14be", | |
"pixel_bits": 42, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrp14le = { | |
"name": "gbrp14le", | |
"pixel_bits": 42, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuvj411p = { | |
"name": "yuvj411p", | |
"pixel_bits": 12, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_bggr8 = { | |
"name": "bayer_bggr8", | |
"pixel_bits": 8, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_rggb8 = { | |
"name": "bayer_rggb8", | |
"pixel_bits": 8, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_gbrg8 = { | |
"name": "bayer_gbrg8", | |
"pixel_bits": 8, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_grbg8 = { | |
"name": "bayer_grbg8", | |
"pixel_bits": 8, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_bggr16le = { | |
"name": "bayer_bggr16le", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_bggr16be = { | |
"name": "bayer_bggr16be", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_rggb16le = { | |
"name": "bayer_rggb16le", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_rggb16be = { | |
"name": "bayer_rggb16be", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_gbrg16le = { | |
"name": "bayer_gbrg16le", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_gbrg16be = { | |
"name": "bayer_gbrg16be", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_grbg16le = { | |
"name": "bayer_grbg16le", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
bayer_grbg16be = { | |
"name": "bayer_grbg16be", | |
"pixel_bits": 16, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv440p10le = { | |
"name": "yuv440p10le", | |
"pixel_bits": 20, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv440p10be = { | |
"name": "yuv440p10be", | |
"pixel_bits": 20, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv440p12le = { | |
"name": "yuv440p12le", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
yuv440p12be = { | |
"name": "yuv440p12be", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
ayuv64le = { | |
"name": "ayuv64le", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
ayuv64be = { | |
"name": "ayuv64be", | |
"pixel_bits": 64, | |
"components": 4, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
videotoolbox_vld = { | |
"name": "videotoolbox_vld", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
p010le = { | |
"name": "p010le", | |
"pixel_bits": 15, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
p010be = { | |
"name": "p010be", | |
"pixel_bits": 15, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrap12be = { | |
"name": "gbrap12be", | |
"pixel_bits": 48, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrap12le = { | |
"name": "gbrap12le", | |
"pixel_bits": 48, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrap10be = { | |
"name": "gbrap10be", | |
"pixel_bits": 40, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrap10le = { | |
"name": "gbrap10le", | |
"pixel_bits": 40, | |
"components": 4, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
mediacodec = { | |
"name": "mediacodec", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gray12be = { | |
"name": "gray12be", | |
"pixel_bits": 12, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gray12le = { | |
"name": "gray12le", | |
"pixel_bits": 12, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gray10be = { | |
"name": "gray10be", | |
"pixel_bits": 10, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gray10le = { | |
"name": "gray10le", | |
"pixel_bits": 10, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
p016le = { | |
"name": "p016le", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
p016be = { | |
"name": "p016be", | |
"pixel_bits": 24, | |
"components": 3, | |
"is_input_format": True, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
d3d11 = { | |
"name": "d3d11", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gray9be = { | |
"name": "gray9be", | |
"pixel_bits": 9, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gray9le = { | |
"name": "gray9le", | |
"pixel_bits": 9, | |
"components": 1, | |
"is_input_format": True, | |
"is_output_format": True, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrpf32be = { | |
"name": "gbrpf32be", | |
"pixel_bits": 96, | |
"components": 3, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrpf32le = { | |
"name": "gbrpf32le", | |
"pixel_bits": 96, | |
"components": 3, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrapf32be = { | |
"name": "gbrapf32be", | |
"pixel_bits": 128, | |
"components": 4, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
gbrapf32le = { | |
"name": "gbrapf32le", | |
"pixel_bits": 128, | |
"components": 4, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
drm_prime = { | |
"name": "drm_prime", | |
"pixel_bits": 0, | |
"components": 0, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": True, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
class PixelFormat: | |
name: str = None | |
pixel_bits: int = None | |
components: int = None | |
is_input_format: bool = None | |
is_output_format: bool = None | |
is_hardware_accel_format: bool = None | |
is_paletted_format: bool = None | |
is_bitstream_format: bool = None | |
def __init__(self, name: str = None, pixel_bits: int = None, components: int = None, is_input_format: bool = None, | |
is_output_format: bool = None, is_hardware_accel_format: bool = None, is_paletted_format: bool = None, | |
is_bitstream_format: bool = None): | |
""" | |
Easy instantiation is possible. Just pass a dict from PixelFormats class. e.g.: PixelFormat( | |
**PixelFormats.yuv420p) | |
@param name: The Name of the Pixel Format. | |
@param pixel_bits: The Number of Bits per Pixel. | |
@param components: The Number of Components. | |
@param is_input_format: Supported Input format for conversion. | |
@param is_output_format: Supported Output format for conversion. | |
@param is_hardware_accel_format: Hardware accelerated format. | |
@param is_paletted_format: Paletted format. | |
@param is_bitstream_format: Bitstream format. | |
""" | |
self.name = name | |
self.pixel_bits = pixel_bits | |
self.components = components | |
self.is_input_format = is_input_format | |
self.is_output_format = is_output_format | |
self.is_hardware_accel_format = is_hardware_accel_format | |
self.is_paletted_format = is_paletted_format | |
self.is_bitstream_format = is_bitstream_format | |
# noinspection PyArgumentList | |
class PixelFormats: | |
yuv420p = PixelFormat(**PixelFormatsAsDict.yuv420p) | |
yuyv422 = PixelFormat(**PixelFormatsAsDict.yuyv422) | |
rgb24 = PixelFormat(**PixelFormatsAsDict.rgb24) | |
bgr24 = PixelFormat(**PixelFormatsAsDict.bgr24) | |
yuv422p = PixelFormat(**PixelFormatsAsDict.yuv422p) | |
yuv444p = PixelFormat(**PixelFormatsAsDict.yuv444p) | |
yuv410p = PixelFormat(**PixelFormatsAsDict.yuv410p) | |
yuv411p = PixelFormat(**PixelFormatsAsDict.yuv411p) | |
gray = PixelFormat(**PixelFormatsAsDict.gray) | |
monow = PixelFormat(**PixelFormatsAsDict.monow) | |
monob = PixelFormat(**PixelFormatsAsDict.monob) | |
pal8 = PixelFormat(**PixelFormatsAsDict.pal8) | |
yuvj420p = PixelFormat(**PixelFormatsAsDict.yuvj420p) | |
yuvj422p = PixelFormat(**PixelFormatsAsDict.yuvj422p) | |
yuvj444p = PixelFormat(**PixelFormatsAsDict.yuvj444p) | |
xvmcmc = PixelFormat(**PixelFormatsAsDict.xvmcmc) | |
xvmcidct = PixelFormat(**PixelFormatsAsDict.xvmcidct) | |
uyvy422 = PixelFormat(**PixelFormatsAsDict.uyvy422) | |
uyyvyy411 = PixelFormat(**PixelFormatsAsDict.uyyvyy411) | |
bgr8 = PixelFormat(**PixelFormatsAsDict.bgr8) | |
bgr4 = PixelFormat(**PixelFormatsAsDict.bgr4) | |
bgr4_byte = PixelFormat(**PixelFormatsAsDict.bgr4_byte) | |
rgb8 = PixelFormat(**PixelFormatsAsDict.rgb8) | |
rgb4 = PixelFormat(**PixelFormatsAsDict.rgb4) | |
rgb4_byte = PixelFormat(**PixelFormatsAsDict.rgb4_byte) | |
nv12 = PixelFormat(**PixelFormatsAsDict.nv12) | |
nv21 = PixelFormat(**PixelFormatsAsDict.nv21) | |
argb = PixelFormat(**PixelFormatsAsDict.argb) | |
rgba = PixelFormat(**PixelFormatsAsDict.rgba) | |
abgr = PixelFormat(**PixelFormatsAsDict.abgr) | |
bgra = PixelFormat(**PixelFormatsAsDict.bgra) | |
gray16be = PixelFormat(**PixelFormatsAsDict.gray16be) | |
gray16le = PixelFormat(**PixelFormatsAsDict.gray16le) | |
yuv440p = PixelFormat(**PixelFormatsAsDict.yuv440p) | |
yuvj440p = PixelFormat(**PixelFormatsAsDict.yuvj440p) | |
yuva420p = PixelFormat(**PixelFormatsAsDict.yuva420p) | |
vdpau_h264 = PixelFormat(**PixelFormatsAsDict.vdpau_h264) | |
vdpau_mpeg1 = PixelFormat(**PixelFormatsAsDict.vdpau_mpeg1) | |
vdpau_mpeg2 = PixelFormat(**PixelFormatsAsDict.vdpau_mpeg2) | |
vdpau_wmv3 = PixelFormat(**PixelFormatsAsDict.vdpau_wmv3) | |
vdpau_vc1 = PixelFormat(**PixelFormatsAsDict.vdpau_vc1) | |
rgb48be = PixelFormat(**PixelFormatsAsDict.rgb48be) | |
rgb48le = PixelFormat(**PixelFormatsAsDict.rgb48le) | |
rgb565be = PixelFormat(**PixelFormatsAsDict.rgb565be) | |
rgb565le = PixelFormat(**PixelFormatsAsDict.rgb565le) | |
rgb555be = PixelFormat(**PixelFormatsAsDict.rgb555be) | |
rgb555le = PixelFormat(**PixelFormatsAsDict.rgb555le) | |
bgr565be = PixelFormat(**PixelFormatsAsDict.bgr565be) | |
bgr565le = PixelFormat(**PixelFormatsAsDict.bgr565le) | |
bgr555be = PixelFormat(**PixelFormatsAsDict.bgr555be) | |
bgr555le = PixelFormat(**PixelFormatsAsDict.bgr555le) | |
vaapi_moco = PixelFormat(**PixelFormatsAsDict.vaapi_moco) | |
vaapi_idct = PixelFormat(**PixelFormatsAsDict.vaapi_idct) | |
vaapi_vld = PixelFormat(**PixelFormatsAsDict.vaapi_vld) | |
yuv420p16le = PixelFormat(**PixelFormatsAsDict.yuv420p16le) | |
yuv420p16be = PixelFormat(**PixelFormatsAsDict.yuv420p16be) | |
yuv422p16le = PixelFormat(**PixelFormatsAsDict.yuv422p16le) | |
yuv422p16be = PixelFormat(**PixelFormatsAsDict.yuv422p16be) | |
yuv444p16le = PixelFormat(**PixelFormatsAsDict.yuv444p16le) | |
yuv444p16be = PixelFormat(**PixelFormatsAsDict.yuv444p16be) | |
vdpau_mpeg4 = PixelFormat(**PixelFormatsAsDict.vdpau_mpeg4) | |
dxva2_vld = PixelFormat(**PixelFormatsAsDict.dxva2_vld) | |
rgb444le = PixelFormat(**PixelFormatsAsDict.rgb444le) | |
rgb444be = PixelFormat(**PixelFormatsAsDict.rgb444be) | |
bgr444le = PixelFormat(**PixelFormatsAsDict.bgr444le) | |
bgr444be = PixelFormat(**PixelFormatsAsDict.bgr444be) | |
ya8 = PixelFormat(**PixelFormatsAsDict.ya8) | |
bgr48be = PixelFormat(**PixelFormatsAsDict.bgr48be) | |
bgr48le = PixelFormat(**PixelFormatsAsDict.bgr48le) | |
yuv420p9be = PixelFormat(**PixelFormatsAsDict.yuv420p9be) | |
yuv420p9le = PixelFormat(**PixelFormatsAsDict.yuv420p9le) | |
yuv420p10be = PixelFormat(**PixelFormatsAsDict.yuv420p10be) | |
yuv420p10le = PixelFormat(**PixelFormatsAsDict.yuv420p10le) | |
yuv422p10be = PixelFormat(**PixelFormatsAsDict.yuv422p10be) | |
yuv422p10le = PixelFormat(**PixelFormatsAsDict.yuv422p10le) | |
yuv444p9be = PixelFormat(**PixelFormatsAsDict.yuv444p9be) | |
yuv444p9le = PixelFormat(**PixelFormatsAsDict.yuv444p9le) | |
yuv444p10be = PixelFormat(**PixelFormatsAsDict.yuv444p10be) | |
yuv444p10le = PixelFormat(**PixelFormatsAsDict.yuv444p10le) | |
yuv422p9be = PixelFormat(**PixelFormatsAsDict.yuv422p9be) | |
yuv422p9le = PixelFormat(**PixelFormatsAsDict.yuv422p9le) | |
vda_vld = PixelFormat(**PixelFormatsAsDict.vda_vld) | |
gbrp = PixelFormat(**PixelFormatsAsDict.gbrp) | |
gbrp9be = PixelFormat(**PixelFormatsAsDict.gbrp9be) | |
gbrp9le = PixelFormat(**PixelFormatsAsDict.gbrp9le) | |
gbrp10be = PixelFormat(**PixelFormatsAsDict.gbrp10be) | |
gbrp10le = PixelFormat(**PixelFormatsAsDict.gbrp10le) | |
gbrp16be = PixelFormat(**PixelFormatsAsDict.gbrp16be) | |
gbrp16le = PixelFormat(**PixelFormatsAsDict.gbrp16le) | |
yuva422p = PixelFormat(**PixelFormatsAsDict.yuva422p) | |
yuva444p = PixelFormat(**PixelFormatsAsDict.yuva444p) | |
yuva420p9be = PixelFormat(**PixelFormatsAsDict.yuva420p9be) | |
yuva420p9le = PixelFormat(**PixelFormatsAsDict.yuva420p9le) | |
yuva422p9be = PixelFormat(**PixelFormatsAsDict.yuva422p9be) | |
yuva422p9le = PixelFormat(**PixelFormatsAsDict.yuva422p9le) | |
yuva444p9be = PixelFormat(**PixelFormatsAsDict.yuva444p9be) | |
yuva444p9le = PixelFormat(**PixelFormatsAsDict.yuva444p9le) | |
yuva420p10be = PixelFormat(**PixelFormatsAsDict.yuva420p10be) | |
yuva420p10le = PixelFormat(**PixelFormatsAsDict.yuva420p10le) | |
yuva422p10be = PixelFormat(**PixelFormatsAsDict.yuva422p10be) | |
yuva422p10le = PixelFormat(**PixelFormatsAsDict.yuva422p10le) | |
yuva444p10be = PixelFormat(**PixelFormatsAsDict.yuva444p10be) | |
yuva444p10le = PixelFormat(**PixelFormatsAsDict.yuva444p10le) | |
yuva420p16be = PixelFormat(**PixelFormatsAsDict.yuva420p16be) | |
yuva420p16le = PixelFormat(**PixelFormatsAsDict.yuva420p16le) | |
yuva422p16be = PixelFormat(**PixelFormatsAsDict.yuva422p16be) | |
yuva422p16le = PixelFormat(**PixelFormatsAsDict.yuva422p16le) | |
yuva444p16be = PixelFormat(**PixelFormatsAsDict.yuva444p16be) | |
yuva444p16le = PixelFormat(**PixelFormatsAsDict.yuva444p16le) | |
vdpau = PixelFormat(**PixelFormatsAsDict.vdpau) | |
xyz12le = PixelFormat(**PixelFormatsAsDict.xyz12le) | |
xyz12be = PixelFormat(**PixelFormatsAsDict.xyz12be) | |
nv16 = PixelFormat(**PixelFormatsAsDict.nv16) | |
nv20le = PixelFormat(**PixelFormatsAsDict.nv20le) | |
nv20be = PixelFormat(**PixelFormatsAsDict.nv20be) | |
rgba64be = PixelFormat(**PixelFormatsAsDict.rgba64be) | |
rgba64le = PixelFormat(**PixelFormatsAsDict.rgba64le) | |
bgra64be = PixelFormat(**PixelFormatsAsDict.bgra64be) | |
bgra64le = PixelFormat(**PixelFormatsAsDict.bgra64le) | |
yvyu422 = PixelFormat(**PixelFormatsAsDict.yvyu422) | |
vda = PixelFormat(**PixelFormatsAsDict.vda) | |
ya16be = PixelFormat(**PixelFormatsAsDict.ya16be) | |
ya16le = PixelFormat(**PixelFormatsAsDict.ya16le) | |
gbrap = PixelFormat(**PixelFormatsAsDict.gbrap) | |
gbrap16be = PixelFormat(**PixelFormatsAsDict.gbrap16be) | |
gbrap16le = PixelFormat(**PixelFormatsAsDict.gbrap16le) | |
qsv = PixelFormat(**PixelFormatsAsDict.qsv) | |
mmal = PixelFormat(**PixelFormatsAsDict.mmal) | |
d3d11va_vld = PixelFormat(**PixelFormatsAsDict.d3d11va_vld) | |
cuda = PixelFormat(**PixelFormatsAsDict.cuda) | |
rgb = PixelFormat(**PixelFormatsAsDict.rgb) | |
rgb0 = PixelFormat(**PixelFormatsAsDict.rgb0) | |
bgr = PixelFormat(**PixelFormatsAsDict.bgr) | |
bgr0 = PixelFormat(**PixelFormatsAsDict.bgr0) | |
yuv420p12be = PixelFormat(**PixelFormatsAsDict.yuv420p12be) | |
yuv420p12le = PixelFormat(**PixelFormatsAsDict.yuv420p12le) | |
yuv420p14be = PixelFormat(**PixelFormatsAsDict.yuv420p14be) | |
yuv420p14le = PixelFormat(**PixelFormatsAsDict.yuv420p14le) | |
yuv422p12be = PixelFormat(**PixelFormatsAsDict.yuv422p12be) | |
yuv422p12le = PixelFormat(**PixelFormatsAsDict.yuv422p12le) | |
yuv422p14be = PixelFormat(**PixelFormatsAsDict.yuv422p14be) | |
yuv422p14le = PixelFormat(**PixelFormatsAsDict.yuv422p14le) | |
yuv444p12be = PixelFormat(**PixelFormatsAsDict.yuv444p12be) | |
yuv444p12le = PixelFormat(**PixelFormatsAsDict.yuv444p12le) | |
yuv444p14be = PixelFormat(**PixelFormatsAsDict.yuv444p14be) | |
yuv444p14le = PixelFormat(**PixelFormatsAsDict.yuv444p14le) | |
gbrp12be = PixelFormat(**PixelFormatsAsDict.gbrp12be) | |
gbrp12le = PixelFormat(**PixelFormatsAsDict.gbrp12le) | |
gbrp14be = PixelFormat(**PixelFormatsAsDict.gbrp14be) | |
gbrp14le = PixelFormat(**PixelFormatsAsDict.gbrp14le) | |
yuvj411p = PixelFormat(**PixelFormatsAsDict.yuvj411p) | |
bayer_bggr8 = PixelFormat(**PixelFormatsAsDict.bayer_bggr8) | |
bayer_rggb8 = PixelFormat(**PixelFormatsAsDict.bayer_rggb8) | |
bayer_gbrg8 = PixelFormat(**PixelFormatsAsDict.bayer_gbrg8) | |
bayer_grbg8 = PixelFormat(**PixelFormatsAsDict.bayer_grbg8) | |
bayer_bggr16le = PixelFormat(**PixelFormatsAsDict.bayer_bggr16le) | |
bayer_bggr16be = PixelFormat(**PixelFormatsAsDict.bayer_bggr16be) | |
bayer_rggb16le = PixelFormat(**PixelFormatsAsDict.bayer_rggb16le) | |
bayer_rggb16be = PixelFormat(**PixelFormatsAsDict.bayer_rggb16be) | |
bayer_gbrg16le = PixelFormat(**PixelFormatsAsDict.bayer_gbrg16le) | |
bayer_gbrg16be = PixelFormat(**PixelFormatsAsDict.bayer_gbrg16be) | |
bayer_grbg16le = PixelFormat(**PixelFormatsAsDict.bayer_grbg16le) | |
bayer_grbg16be = PixelFormat(**PixelFormatsAsDict.bayer_grbg16be) | |
yuv440p10le = PixelFormat(**PixelFormatsAsDict.yuv440p10le) | |
yuv440p10be = PixelFormat(**PixelFormatsAsDict.yuv440p10be) | |
yuv440p12le = PixelFormat(**PixelFormatsAsDict.yuv440p12le) | |
yuv440p12be = PixelFormat(**PixelFormatsAsDict.yuv440p12be) | |
ayuv64le = PixelFormat(**PixelFormatsAsDict.ayuv64le) | |
ayuv64be = PixelFormat(**PixelFormatsAsDict.ayuv64be) | |
videotoolbox_vld = PixelFormat(**PixelFormatsAsDict.videotoolbox_vld) | |
p010le = PixelFormat(**PixelFormatsAsDict.p010le) | |
p010be = PixelFormat(**PixelFormatsAsDict.p010be) | |
gbrap12be = PixelFormat(**PixelFormatsAsDict.gbrap12be) | |
gbrap12le = PixelFormat(**PixelFormatsAsDict.gbrap12le) | |
gbrap10be = PixelFormat(**PixelFormatsAsDict.gbrap10be) | |
gbrap10le = PixelFormat(**PixelFormatsAsDict.gbrap10le) | |
mediacodec = PixelFormat(**PixelFormatsAsDict.mediacodec) | |
gray12be = PixelFormat(**PixelFormatsAsDict.gray12be) | |
gray12le = PixelFormat(**PixelFormatsAsDict.gray12le) | |
gray10be = PixelFormat(**PixelFormatsAsDict.gray10be) | |
gray10le = PixelFormat(**PixelFormatsAsDict.gray10le) | |
p016le = PixelFormat(**PixelFormatsAsDict.p016le) | |
p016be = PixelFormat(**PixelFormatsAsDict.p016be) | |
d3d11 = PixelFormat(**PixelFormatsAsDict.d3d11) | |
gray9be = PixelFormat(**PixelFormatsAsDict.gray9be) | |
gray9le = PixelFormat(**PixelFormatsAsDict.gray9le) | |
gbrpf32be = PixelFormat(**PixelFormatsAsDict.gbrpf32be) | |
gbrpf32le = PixelFormat(**PixelFormatsAsDict.gbrpf32le) | |
gbrapf32be = PixelFormat(**PixelFormatsAsDict.gbrapf32be) | |
gbrapf32le = PixelFormat(**PixelFormatsAsDict.gbrapf32le) | |
drm_prime = PixelFormat(**PixelFormatsAsDict.drm_prime) | |
# noinspection PyTypeChecker | |
def all_input_formats() -> dict: | |
return_dict = {} | |
for key, val in PixelFormatsAsDict.__dict__.items(): | |
if key.startswith("__") and key.endswith("__"): | |
continue | |
if "is_input_format" in val: | |
if val["is_input_format"]: | |
return_dict[key] = val | |
return return_dict | |
# noinspection PyTypeChecker | |
def all_output_formats() -> dict: | |
return_dict = {} | |
for key, val in PixelFormatsAsDict.__dict__.items(): | |
if key.startswith("__") and key.endswith("__"): | |
continue | |
if "is_output_format" in val: | |
if val["is_output_format"]: | |
return_dict[key] = val | |
return return_dict | |
# noinspection PyTypeChecker | |
def all_hardware_accel_formats() -> dict: | |
return_dict = {} | |
for key, val in PixelFormatsAsDict.__dict__.items(): | |
if key.startswith("__") and key.endswith("__"): | |
continue | |
if "is_hardware_accel_format" in val: | |
if val["is_hardware_accel_format"]: | |
return_dict[key] = val | |
return return_dict | |
# noinspection PyTypeChecker | |
def all_paletted_formats() -> dict: | |
return_dict = {} | |
for key, val in PixelFormatsAsDict.__dict__.items(): | |
if key.startswith("__") and key.endswith("__"): | |
continue | |
if "is_paletted_format" in val: | |
if val["is_paletted_format"]: | |
return_dict[key] = val | |
return return_dict | |
# noinspection PyTypeChecker | |
def all_bitstream_formats() -> dict: | |
return_dict = {} | |
for key, val in PixelFormatsAsDict.__dict__.items(): | |
if key.startswith("__") and key.endswith("__"): | |
continue | |
if "is_bitstream_format" in val: | |
if val["is_bitstream_format"]: | |
return_dict[key] = val | |
return return_dict | |
def __parse_formats__(ffmpeg_pix_fmts_output: bytes): | |
all_formats_dict = {} | |
start = False | |
for idx, line in enumerate(ffmpeg_pix_fmts_output.split(b"\n")): | |
line = line.decode("utf-8").strip() | |
if start: | |
try: | |
formats, name, components, bit_width = line.split() | |
components = int(components) | |
bit_width = int(bit_width) | |
except ValueError: | |
print(f"Ignoring line {idx + 1}: {line}") | |
continue | |
format_dict = { | |
"name": name, | |
"pixel_bits": bit_width, | |
"components": components, | |
"is_input_format": False, | |
"is_output_format": False, | |
"is_hardware_accel_format": False, | |
"is_paletted_format": False, | |
"is_bitstream_format": False | |
} | |
for letter in formats: | |
if letter == "I": | |
format_dict["is_input_format"] = True | |
if letter == "O": | |
format_dict["is_output_format"] = True | |
if letter == "H": | |
format_dict["is_hardware_accel_format"] = True | |
if letter == "P": | |
format_dict["is_paletted_format"] = True | |
if letter == "B": | |
format_dict["is_bitstream_format"] = True | |
all_formats_dict[name] = format_dict | |
if line == "-----": | |
start = True | |
return all_formats_dict | |
if __name__ == "__main__": | |
""" | |
import json | |
import subprocess | |
all_formats_dict = __parse_formats__( | |
subprocess.check_output( | |
["ffmpeg", "-pix_fmts"] | |
) | |
) | |
# Used to generate the PixelFormats class (dicts) | |
with open('pixel_formats.json', 'w') as fwriter: | |
json.dump(all_formats_dict, fp=fwriter, indent=4) | |
with open('pixel_formats_enum.txt', 'a') as fwriter: | |
for key, value in all_formats_dict.items(): | |
fwriter.write(f"{key} = {json.dumps(value, indent=4)}\n") | |
# """ | |
print("\nExample") | |
print( | |
f"PixelFormats.yuv420p:" | |
f"{PixelFormats.yuv420p}" | |
) | |
print( | |
f"PixelFormat(**PixelFormats.yuv420p): " | |
f"{PixelFormat(**PixelFormatsAsDict.yuv420p)}" | |
) | |
print( | |
f"PixelFormat(**PixelFormats.yuv420p).name: " | |
f"{PixelFormat(**PixelFormatsAsDict.yuv420p).name}" | |
) | |
print( | |
f"PixelFormat(**PixelFormats.yuv420p).pixel_bits: " | |
f"{PixelFormat(**PixelFormatsAsDict.yuv420p).pixel_bits}" | |
) | |
print( | |
f"PixelFormat(**PixelFormats.yuv420p).components: " | |
f"{PixelFormat(**PixelFormatsAsDict.yuv420p).components}" | |
) | |
print( | |
f"PixelFormat(**PixelFormats.yuv420p).is_input_format: " | |
f"{PixelFormat(**PixelFormatsAsDict.yuv420p).is_input_format}" | |
) | |
print( | |
f"PixelFormat(**PixelFormats.yuv420p).is_output_format: " | |
f"{PixelFormat(**PixelFormatsAsDict.yuv420p).is_output_format}" | |
) | |
print( | |
f"PixelFormat(**PixelFormats.yuv420p).is_hardware_accel_format: " | |
f"{PixelFormat(**PixelFormatsAsDict.yuv420p).is_hardware_accel_format}" | |
) | |
print( | |
f"PixelFormat(**PixelFormats.yuv420p).is_paletted_format: " | |
f"{PixelFormat(**PixelFormatsAsDict.yuv420p).is_paletted_format}" | |
) | |
print( | |
f"PixelFormat(**PixelFormats.yuv420p).is_bitstream_format: " | |
f"{PixelFormat(**PixelFormatsAsDict.yuv420p).is_bitstream_format}" | |
) | |
print( | |
f"PixelFormats.yuv420p: " | |
f"{PixelFormats.yuv420p}" | |
) | |
print( | |
f"PixelFormats.yuv420p.name: " | |
f"{PixelFormats.yuv420p.name}" | |
) | |
print( | |
f"PixelFormat.yuv420p.pixel_bits: " | |
f"{PixelFormats.yuv420p.pixel_bits}" | |
) | |
print( | |
f"PixelFormat.yuv420p.components: " | |
f"{PixelFormats.yuv420p.components}" | |
) | |
print( | |
f"PixelFormat.yuv420p.is_input_format: " | |
f"{PixelFormats.yuv420p.is_input_format}" | |
) | |
print( | |
f"PixelFormat.yuv420p.is_output_format: " | |
f"{PixelFormats.yuv420p.is_output_format}" | |
) | |
print( | |
f"PixelFormat.yuv420p.is_hardware_accel_format: " | |
f"{PixelFormats.yuv420p.is_hardware_accel_format}" | |
) | |
print( | |
f"PixelFormat.yuv420p.is_paletted_format: " | |
f"{PixelFormats.yuv420p.is_paletted_format}" | |
) | |
print( | |
f"PixelFormat.yuv420p.is_bitstream_format: " | |
f"{PixelFormats.yuv420p.is_bitstream_format}" | |
) | |
print( | |
f"all_input_formats(): " | |
f"{all_input_formats()}" | |
) | |
print( | |
f"all_output_formats(): " | |
f"{all_output_formats()}" | |
) | |
print( | |
f"all_hardware_accel_formats(): " | |
f"{all_hardware_accel_formats()}" | |
) | |
print( | |
f"all_paletted_formats(): " | |
f"{all_paletted_formats()}" | |
) | |
print( | |
f"all_bitstream_formats(): " | |
f"{all_bitstream_formats()}" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment