From 7c79f530a53e9ff4a9fc61d6b7adde6e9c241c62 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Tue, 31 Aug 2021 13:38:28 -0700 Subject: Support more audio and video qualities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds support for AV1-encoded videos, which includes any videos above 1080p. These weren't getting included because they did not have a quality entry in the format table at the top of watch_extraction.py. So get the quality from the quality labels of the format if it's not there. Because YouTube often includes BOTH AV1 and H.264 (AVC) for each quality, after these are included, there will be way too many quality options and the code needs to choose which one to use. The choice is somewhat hard: AV1 is encoded in fewer bytes than H.264 and is patent-free, however, it has less hardware support, so might be more difficult to play. For instance, on my system, AV1 does not work on 1080p, but H.264 does. Adds a setting about which to prefer, set to H.264 as the default. Also adds support for the lower quality mp4 audio quality, which now gets used at 144p to save network bandwidth. For similar reasons, this was not getting included because it did not have an audio_bitrate entry in the table. Prefer bitrate instead for the quality. Signed-off-by: Jesús --- settings.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'settings.py') diff --git a/settings.py b/settings.py index c97e3d8..fdaebc7 100644 --- a/settings.py +++ b/settings.py @@ -168,6 +168,17 @@ For security reasons, enabling this is not recommended.''', 'category': 'playback', }), + ('preferred_video_codec', { + 'type': int, + 'default': 0, + 'comment': '', + 'options': [ + (0, 'h.264'), + (1, 'AV1'), + ], + 'category': 'playback', + }), + ('prefer_uni_sources', { 'label': 'Prefer integrated sources', 'type': bool, -- cgit v1.2.3