如何使用 youtube-dl 下载 1080p + 最佳音频? [英] How to download 1080p + best audio using youtube-dl?

查看:52
本文介绍了如何使用 youtube-dl 下载 1080p + 最佳音频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试下载 1920x1080 视频和 192kb/s 音频,但我无法同时提取两者.例如:

I'm trying to download 1920x1080 video with 192kb/s audio but I'm unable to extract both. For example:

        format code  extension  resolution note
    249          webm       audio only DASH audio   51k , opus @ 50k, 600.56KiB
    250          webm       audio only DASH audio   67k , opus @ 70k, 788.31KiB
    251          webm       audio only DASH audio  132k , opus @160k, 1.53MiB
    140          m4a        audio only DASH audio  134k , m4a_dash container, mp4a.40.2@128k, 1.52MiB
    171          webm       audio only DASH audio  135k , vorbis@128k, 1.53MiB
    160          mp4        256x144    144p  110k , avc1.42c00c, 12fps, video only, 1.30MiB
    278          webm       256x144    144p  134k , webm container, vp9, 12fps, video only, 1.18MiB
    133          mp4        426x240    240p  248k , avc1.4d4015, 24fps, video only, 2.91MiB
    242          webm       426x240    240p  254k , vp9, 24fps, video only, 2.30MiB
    243          webm       640x360    360p  475k , vp9, 24fps, video only, 4.17MiB
    134          mp4        640x360    360p  617k , avc1.4d401e, 24fps, video only, 5.00MiB
    244          webm       854x480    480p  861k , vp9, 24fps, video only, 7.31MiB
    135          mp4        854x480    480p 1110k , avc1.4d401e, 24fps, video only, 9.33MiB
    247          webm       1280x720   720p 1691k , vp9, 24fps, video only, 13.90MiB
    136          mp4        1280x720   720p 2220k , avc1.4d401f, 24fps, video only, 17.41MiB
    248          webm       1920x1080  1080p 3044k , vp9, 24fps, video only, 24.43MiB
    137          mp4        1920x1080  1080p 4160k , avc1.640028, 24fps, video only, 31.42MiB
    17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k
    36           3gp        320x180    small , mp4v.20.3, mp4a.40.2
    43           webm       640x360    medium , vp8.0, vorbis@128k
    18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k
    22           mp4        1280x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)

我正在尝试合并来自 137 的 1920x1080 视频和来自 22 的 192kb/s 音频(因为它是最好的).

I'm trying to merge the 1920x1080 video from 137 and 192kb/s audio from 22 (as it's the best available).

-f 'bestvideo[height<=1080]+bestaudio/best[height<=1080]' --merge-output-format mp4

但输出文件的音频比特率为 125kb/s.如何下载所需的规格?

But the audio bitrate of output file was 125kb/s. How can I download the required specifications?

编辑 1:示例视频的链接:https://www.youtube.com/watch?v=ic-K3pNtj4

EDIT 1: Link for the example video: https://www.youtube.com/watch?v=i-c-K3pNtj4

注意:我对音频编解码器了解不多,但我想选择最好的编解码器,因此如果可能,请提供可用于确定最佳音频(如果它超过比特率)的事实.

NOTE: I don't know too much about audio codecs but I want to select the best one so if possible, please provide the facts that can be used to identify the best audio if it outfactors the bitrate.

推荐答案

首先说一下音质:作为 在我们的姊妹网站中描述,mp3 与无损 CD 质量(透明)在大约 192kb/s 和恒定比特率下变得无法区分.但是,任何现代编码器都使用可变比特率 (VBR),在某些部分中比其他部分具有更高的质量.使用 VBR,截止值可能会低一点.用专业的耳朵和设备,可能会高一点.

First of all, a word about audio quality: As described on our sister site, mp3 becomes indistinguishable from lossless CD quality (transparent) at about 192kb/s with a constant bitrate. However, any modern encoder is using a variable bitrate (VBR), putting more quality in some sections than others. With VBR, the cutoff is likely a bit lower. With professional ears and equipment, it may be a little bit higher.

AAC 和 Vorbis 比 MP3 更远一代.这似乎是最全面的质量测试 - 至少是我能找到的.AACVorbis 据称在 128kb/s 时是透明的,尽管我猜 160kb/s 是一个更现实的阈值.Opus 是另一项重大改进,对于 64kb/s 和 可能在 128kb/s 时透明.

AAC and Vorbis are one generation farther than MP3. This seems to be the most comprehensive quality test - at least the one I could find. AAC and Vorbis have been claimed to be transparent at 128kb/s, although I'd guess 160kb/s is a more realistic threshold. Opus is yet another significant improvement, being reasonably good for music at 64kb/s and probably transparent at 128kb/s.

当 youtube-dl 列出 YouTube 的格式质量时,它列出的质量是硬编码的.其他支持的网站有时会提前转发质量信息,但对于 YouTube,我们会至少下载每个文件的标题.

When youtube-dl lists the format quality for YouTube, the quality it lists is hardcoded. Other websites supported sometimes relay quality information in advance, but for YouTube we'd have to download at least the headers of each file.

我得到了一个坏消息,因为您声称能够在此视频中听到 192kb/s 和 128kb/s 之间的差异:所有为此视频提供的音频格式(即 251、140、171 和 22) 以 128KB/s VBR 编码.您可以通过下载它们来检查(对于 22,您需要分离音频)并比较文件大小:它们全部为 1.6MB = 12.8 Mb(方便的是,视频时长为 100 秒).

I got bad news for your claim to be able to hear the difference between 192kb/s and 128kb/s on this video: All the audio formats offered for this video (namely, 251, 140, 171 and 22) are encoded with 128KB/s VBR. You can check so by downloading them (for 22, you need to split off the audio) and comparing file sizes: They're all 1.6MB = 12.8 Mb (conveniently, the video is 100 seconds long).

特别是,编解码器是 opus(251)、Vorbis(171)、AAC(140 和 22).其中,Opus 绝对提供最高质量.那么为什么 youtube-dl 选择 V​​orbis with bestaudio 呢?按照我最初设计 youtube-dl 格式选择的方式,它确实会选择 Opus.但有大量用户反馈称,某些格式可能质量较差,但支持范围更广.

In particular, the codecs are opus(251), Vorbis(171), AAC(140 and 22). Of these, Opus definitely offers the highest quality. So why does youtube-dl pick Vorbis with bestaudio? The way I originally designed the youtube-dl format selection, it would have picked the Opus indeed. But there was significant user feedback that some formats may be of worse quality, but supported more broadly.

即使在今天,许多应用程序也无法处理 Opus,甚至 Vorbis 或 AAC 及其容器.诸如 VLC 之类的高品质音乐播放器将支持所有内容,但开箱即用,许多笔记本电脑将受到限制;智能手机更是如此,智能手表或智能耳机更是如此.这就是为什么大多数播客仍将提供 mp3 文件的原因 - 与音频质量和/或文件大小的轻微下降相比,根本无法播放文件是一种更糟糕的用户体验.此外,其中一些格式也是免费的,而另一些则不是,这给配置为仅使用免费软件的系统带来了进一步的问题.

Even today, lots of applications are unable to handle Opus, or even Vorbis or AAC and their container. A high-quality music player such as VLC will support everything, but out of the box, many laptops will be limited; smartphones more so, and smartwatches or smart headphones even more so. This is why most podcasts will still serve mp3 files - it is a much worse user experience to be unable to play a file at all, than a slight degradation in audio quality and/or file size. In addition, some of these formats are also free, while others are not, bringing further problems on systems configured to use only free software.

如果您最看重音频质量,则应在此处选择 251 格式.将您的首选项存储在配置文件中以使其永久化.

If you value audio quality above all, you should pick format 251 here. Store your preferences in a configuration file to make them permanent.

请注意,所有这些讨论都假定原始音频源是高保真的,如果可能的话是无损的.由于该视频的上传者名为MikeTheAnimeRunnerX2,所以我不会假设专业的录音技巧-尽管有原歌手的功劳,因此他可能私下获得了高质量的文件.如果上传到 YouTube 的音频是有损格式(尤其是处于透明度边缘或更低的音频),YouTube 进一步重新编码所能做的就是尽量减少更多的伪影.

Note that all of this discussion presumes that the original audio source is high-fidelity, if possible lossless. Since the uploader of that video is called MikeTheAnimeRunnerX2, I would not presume expert audio recording skills - although there is credit of the original singer, so he may have gotten a high-quality file in private. If the audio that was uploaded to YouTube was in a lossy format (especially one at the edge of transparency or lower), all the further reencoding by YouTube can do is minimize further artifacts.

请注意,对于非专家来说,更差的压缩有时听起来更好,尤其是当原始源不是那么好、嘈杂或因有损重新编码而降级时.这是因为更差的压缩会消除一些不准确,并可能使声音更平滑".

Note that to non-experts, worse compression can sometimes sound better, especially when the original source is not that good, noisy, or has been degraded by lossy reencodings. This is because worse compression will remove some inaccuracies and may make the sound more "smooth".

幸运的是,youtube-dl 为您提供了测试多种格式的选项.只需下载所有候选文件(例如使用 youtube-dl -f 251 ic-K3pNtj4-f bestvideo+251 获取视频文件)并选择您最喜欢的一个.

Fortunately, youtube-dl gives you the option to test multiple formats. Just download all candidates (e.g. with youtube-dl -f 251 i-c-K3pNtj4, or -f bestvideo+251 to get a video file) and pick the one you like most.

这篇关于如何使用 youtube-dl 下载 1080p + 最佳音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆