Add music video codec enums and FOURCC mapping

This commit is contained in:
Rafael Moraes
2025-10-21 15:19:33 -03:00
parent f98156401c
commit 54f13e2ea2
3 changed files with 26 additions and 2 deletions
+5
View File
@@ -15,3 +15,8 @@ class CoverFormat(Enum):
JPG = "jpg"
PNG = "png"
RAW = "raw"
class RemuxFormatMusicVideo(Enum):
M4V = "m4v"
MP4 = "mp4"
+6 -1
View File
@@ -29,7 +29,7 @@ DRM_DEFAULT_KEY_MAPPING = {
),
"com.apple.streamingkeydelivery": "skd://itunes.apple.com/P000000000/s1/e1",
}
MP4_FORMAT_CODECS = ["ec-3"]
MP4_FORMAT_CODECS = ["ec-3", "hvc1", "audio-atmos", "audio-ec3"]
SONG_CODEC_REGEX_MAP = {
"aac": r"audio-stereo-\d+",
"aac-he": r"audio-HE-stereo-\d+",
@@ -41,3 +41,8 @@ SONG_CODEC_REGEX_MAP = {
"ac3": r"audio-ac3-.*",
"alac": r"audio-alac-.*",
}
FOURCC_MAP = {
"h264": "avc1",
"h265": "hvc1",
}
+15 -1
View File
@@ -1,6 +1,11 @@
from enum import Enum
from .constants import MEDIA_RATING_STR_MAP, MEDIA_TYPE_STR_MAP, LEGACY_SONG_CODECS
from .constants import (
FOURCC_MAP,
LEGACY_SONG_CODECS,
MEDIA_RATING_STR_MAP,
MEDIA_TYPE_STR_MAP,
)
class SyncedLyricsFormat(Enum):
@@ -54,3 +59,12 @@ class SongCodec(Enum):
def is_legacy(self) -> bool:
return self.value in LEGACY_SONG_CODECS
class MusicVideoCodec(Enum):
H264 = "h264"
H265 = "h265"
ASK = "ask"
def fourcc(self) -> str:
return FOURCC_MAP[self.value]