Skip to content

Commit

Permalink
UPD: av1 - either download directly or convert to vp9
Browse files Browse the repository at this point in the history
  • Loading branch information
nandyalu committed Jan 23, 2025
1 parent e3d7c57 commit 67b953f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/core/download/video_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 4 additions & 0 deletions backend/core/download/video_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 67b953f

Please sign in to comment.