diff --git a/backend/core/download/video_conversion.py b/backend/core/download/video_conversion.py index 51dd59d..92b4674 100644 --- a/backend/core/download/video_conversion.py +++ b/backend/core/download/video_conversion.py @@ -36,6 +36,8 @@ "vp8": "libvpx", "vp9": "libvpx-vp9", # "av1": "libaom-av1", + # if av1 is selected and downloaded video is not in av1 codec, then convert to vp9 + "av1": "libvpx-vp9", } _VIDEO_CODECS_NVIDIA = { diff --git a/backend/core/download/video_v2.py b/backend/core/download/video_v2.py index ff6c624..2e72ef0 100644 --- a/backend/core/download/video_v2.py +++ b/backend/core/download/video_v2.py @@ -76,6 +76,10 @@ def _get_ytdl_options() -> list[str]: _options.append("-f") _vres = f"[height<=?{app_settings.trailer_resolution}]" _vcodec = f"[vcodec={app_settings.trailer_video_format}]" + # Most of the current hardware struggles with av1 conversion + # So, we will try and download from YT in av1 format directly if available + if app_settings.trailer_video_format == "av1": + _vcodec = "[vcodec^=av]" _acodec = f"[acodec={app_settings.trailer_audio_format}]" # Format 1: Best video and audio with the given resolution and codecs _format = f"bestvideo{_vres}{_vcodec}+bestaudio{_acodec}"