Source code for asyncyt.enums
from enum import StrEnum
__all__ = [
"AudioFormat",
"VideoFormat",
"Quality",
"VideoCodec",
"AudioCodec",
"Preset",
"InputType",
"ProgressStatus",
"TuneOption",
"PixelFormat",
"AudioChannels",
"SubtitleFormat",
"PlaylistStatus",
]
[docs]
class Quality(StrEnum):
BEST = "best"
WORST = "worst"
AUDIO_ONLY = "bestaudio"
VIDEO_ONLY = "bestvideo"
LOW_144P = "144p"
LOW_240P = "240p"
SD_480P = "480p"
HD_720P = "720p"
HD_1080P = "1080p"
HD_1440P = "1440p"
UHD_4K = "2160p"
UHD_8K = "4320p"
[docs]
class VideoCodec(StrEnum):
"""Video codec options"""
# Software codecs
H264 = "libx264"
H265 = "libx265"
VP9 = "libvpx-vp9"
VP8 = "libvpx"
AV1 = "libaom-av1"
AV1_SVT = "libsvtav1"
AV1_RAV1E = "librav1e"
# Hardware accelerated (NVIDIA)
H264_NVENC = "h264_nvenc"
HEVC_NVENC = "hevc_nvenc"
AV1_NVENC = "av1_nvenc"
# Hardware accelerated (Intel QSV)
H264_QSV = "h264_qsv"
HEVC_QSV = "hevc_qsv"
AV1_QSV = "av1_qsv"
# Hardware accelerated (AMD AMF)
H264_AMF = "h264_amf"
HEVC_AMF = "hevc_amf"
# Hardware accelerated (Apple VideoToolbox)
H264_VIDEOTOOLBOX = "h264_videotoolbox"
HEVC_VIDEOTOOLBOX = "hevc_videotoolbox"
# Vulkan
H264_VULKAN = "h264_vulkan"
HEVC_VULKAN = "hevc_vulkan"
# Other
MJPEG = "mjpeg"
PRORES = "prores"
DNXHD = "dnxhd"
THEORA = "libtheora"
H263 = "h263"
H261 = "h261"
CINEFORM = "cineform"
COPY = "copy"
[docs]
class AudioCodec(StrEnum):
"""Audio codec options"""
AAC = "aac"
MP3 = "libmp3lame"
OPUS = "libopus"
VORBIS = "libvorbis"
FLAC = "flac"
ALAC = "alac"
AC3 = "ac3"
EAC3 = "eac3"
DTS = "dca"
PCM_S16LE = "pcm_s16le"
PCM_S24LE = "pcm_s24le"
PCM_S32LE = "pcm_s32le"
PCM_F32LE = "pcm_f32le"
AMR_NB = "libopencore_amrnb"
AMR_WB = "libopencore_amrwb"
WAVPACK = "wavpack"
COPY = "copy"
[docs]
class Preset(StrEnum):
"""Encoding presets for speed vs quality (x264/x265/NVENC)"""
ULTRAFAST = "ultrafast"
SUPERFAST = "superfast"
VERYFAST = "veryfast"
FASTER = "faster"
FAST = "fast"
MEDIUM = "medium"
SLOW = "slow"
SLOWER = "slower"
VERYSLOW = "veryslow"
PLACEBO = "placebo"
[docs]
class TuneOption(StrEnum):
"""x264/x265 tune options"""
FILM = "film"
ANIMATION = "animation"
GRAIN = "grain"
STILLIMAGE = "stillimage"
FASTDECODE = "fastdecode"
ZEROLATENCY = "zerolatency"
PSNR = "psnr"
SSIM = "ssim"
[docs]
class AudioChannels(StrEnum):
"""Common audio channel layout presets"""
MONO = "1"
STEREO = "2"
SURROUND_5_1 = "6"
SURROUND_7_1 = "8"
[docs]
class ProgressStatus(StrEnum):
"""Progress Status types"""
DOWNLOADING = "downloading"
DOWNLOADED = "downloaded"
ENCODING = "encoding"
COMPLETED = "completed"
UPDATING = "updating"
EXTRACTING = "extracting"
REMUXING = "remuxing"
MERGING = "merging"
[docs]
class PlaylistStatus(StrEnum):
"""Status of a playlist download operation"""
PENDING = "pending"
FETCHING_INFO = "fetching_info"
DOWNLOADING = "downloading"
COMPLETED = "completed"
FAILED = "failed"
CANCELLED = "cancelled"
PARTIAL = "partial"