jer*_*nws 9 youtube audio youtube-dl
我刚刚下载youtube-dl,所以我可以从youtube下载视频和音频文件.
我想从以下视频下载最佳音频:https://www.youtube.com/watch?v = uWusmdmc0to
当我使用youtube-dl搜索所有格式时,我得到以下结果:
format code extension resolution note 249 webm audio only DASH audio 58k , opus @ 50k, 18.99MiB 250 webm audio only DASH audio 75k , opus @ 70k, 25.20MiB 140 m4a audio only DASH audio 131k , m4a_dash container, mp4a.40.2@128k, 52.40MiB 251 webm audio only DASH audio 147k , opus @160k, 50.95MiB 171 webm audio only DASH audio 149k , vorbis@128k, 52.64MiB 278 webm 256x144 144p 109k , webm container, vp9, 25fps, video only, 34.62MiB 160 mp4 256x144 144p 117k , avc1.4d400c, 25fps, video only, 37.86MiB 242 webm 426x240 240p 245k , vp9, 25fps, video only, 75.13MiB 133 mp4 426x240 240p 258k , avc1.4d4015, 25fps, video only, 81.39MiB 243 webm 640x360 360p 492k , vp9, 25fps, video only, 142.99MiB 134 mp4 640x360 360p 673k , avc1.4d401e, 25fps, video only, 215.29MiB 244 webm 854x480 480p 828k , vp9, 25fps, video only, 256.58MiB 135 mp4 854x480 480p 1516k , avc1.4d401e, 25fps, video only, 408.56MiB 247 webm 1280x720 720p 1882k , vp9, 25fps, video only, 526.18MiB 136 mp4 1280x720 720p 3012k , avc1.4d401f, 25fps, video only, 803.36MiB 248 webm 1920x1080 1080p 3622k , vp9, 25fps, video only, 938.81MiB 137 mp4 1920x1080 1080p 4724k , avc1.640028, 25fps, video only, 1.44GiB 271 webm 2560x1440 1440p 9253k , vp9, 25fps, video only, 2.86GiB 313 webm 3840x2160 2160p 18685k , vp9, 25fps, video only, 6.33GiB 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)
获得最佳音频文件的最佳选择是什么?前五个只是音频.我需要在这里选一个吗?或者是最后一款MP4 HD720的最佳选择,然后将其转换为MP3?
谢谢!
phi*_*hag 19
如果你想要mp3,只需告诉youtube-dl:
youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=uWusmdmc0to
Run Code Online (Sandbox Code Playgroud)
将为您提供音频版本(-x,简称--extract-audio)或转换为mp3(这是--audio-format选项).youtube-dl将自动选择最佳质量和最合适的格式.
请注意,列出的品质只是猜测.在实践中,opus优于其他任何东西,但选择vorbis是为了兼容性(请参阅我的相关答案以获取更多详细信息),以便选择.
虽然您可以使用-f选择特定格式,但这适用于因带宽或存储空间有限而需要较低质量或调试的用户.默认情况下,youtube-dl已经下载了最高质量的内容.
luk*_*uke 18
要执行此命令,您需要ffmpeg安装(youtube-dl 用于转换的音频和视频转换器)
youtube-dl -f "bestaudio/best" -ciw -o "%(title)s.%(ext)s" -v --extract-audio --audio-quality 0 --audio-format mp3 https://www.youtube.com/watch?v=c29tZVZpZGVvUGxheWxpc3RQYXJ0
Run Code Online (Sandbox Code Playgroud)
它仅下载音频(不含视频)并将其转换为mp3.
选项--audio-quality 0在那里很重要!
如果没有这个选项,你会在mp3压缩过程中损失一些音质。
--audio-quality 0告诉 youtube-dl 以最佳质量保存音频文件(转换为 时mp3)。
如果没有这个选项mp3的音频质量默认设置为5在0-9 scale这里0是最好的质量和9品质最差。所以默认情况下质量更差。的Youtube流与可变比特率可达非优质用户160kbps的opus格式。Opus格式mp3比mp3保持相同质量更新并且具有更好的压缩率。所以160kbpsopus = ~256kbpsmp3。
当音频质量为默认值 ( 5in 0-9 scale) 时,mp3 比特率被限制为160kbps这意味着在压缩过程中会丢失一些音质。当音频质量设置为0mp3 时300kbps 保持原始质量。
命令是一样的,但你应该把链接放到频道而不是单个视频的链接:
youtube-dl -f "bestaudio/best" -ciw -o "%(title)s.%(ext)s" -v --extract-audio --audio-quality 0 --audio-format mp3 https://www.youtube.com/c/someChannelName1232143/videos
Run Code Online (Sandbox Code Playgroud)
您必须添加--yes-playlist选项。
您可以放置一个播放列表的链接(带有playlist单词的链接):
youtube-dl -f "bestaudio/best" -ciw -o "%(title)s.%(ext)s" -v --extract-audio --audio-format mp3 --audio-quality 0 --yes-playlist https://www.youtube.com/playlist?list=c29tZVZpZGVvVVJMUGFy
Run Code Online (Sandbox Code Playgroud)
或者在播放播放列表时链接到播放列表中的一首歌曲(与list单词链接):
youtube-dl -f "bestaudio/best" -ciw -o "%(title)s.%(ext)s" -v --extract-audio --audio-format mp3 --audio-quality 0 --yes-playlist "https://www.youtube.com/watch?v=c29tZVZpZGVvUGxheWxpc3RQYXJ0&list=c29tZVZpZGVvTGlzdFBhcnRzc29tZVZpZGVvTGlzdFBhcnRz&index=4"
Run Code Online (Sandbox Code Playgroud)
-f "bestaudio/best" <- Choose the best audio format.
As there is only audio format listed only the audio is downloaded.
-c <- (--continue) Force resume of partially downloaded files.
By default, youtube-dl will resume downloads if possible.
As docs state maybe it is default, but I put it to make sure it is set.
-i <- (--ignore-errors) Continue on download errors,
for example to skip unavailable videos in a playlist.
-w <- (--no-overtwrites) Do not overwrite files
(If something was already downloaded
and is present in the directory then continue with the next video)
-o "%(title)s.%(ext)s" <- (--output) Output filename template,
in this case it gives you file named movieTitle.mp3
where movieTitle is the title of the video on youtube.
-v <- (--verbose) Print various debugging information
--extract-audio <- (-x) Convert video files to audio-only files
(requires ffmpeg or avconv and ffprobe or avprobe)
--audio-quality 0 <- Specify ffmpeg/avconv audio quality,
insert a value between 0 (better) and 9 (worse) for VBR or a specific
bitrate like 128K (default 5).
Youtube streams for nonpremium users with variable bitrate up to 160kbps in opus format.
Opus format is newer than mp3 and has better compression than mp3
preserving the same quality. So 160kbps opus = ~ 256kbps mp3.
When audio-quality is default (5 in 0-9 scale) mp3 bitrate
is limited to 160kbps which means that some sound quality is lost during compression.
When audio-quality is set to 0 mp3 goes up to 300kbps preserving original quality.
--audio-format mp3 <- Specify audio format: "best", "aac", "flac", "mp3", "m4a",
"opus", "vorbis", or "wav"; "best" by default; No effect without -x (--extract-audio).
In this case we choose mp3.
Alternatively you could choose for example opus which
is oryginally provided by youtube and is newer and better than mp3
or flac which is loseless codec.
Run Code Online (Sandbox Code Playgroud)
我在那里提供的所有链接都是假的。我只是在其中放了一些由 base64 编码的随机单词。所以你必须用你自己的链接替换它们才能让它工作。
Youtube-dl gives you opportunity to use your own youtube account to download stuff.
If your account is a premium account you can get
higher 320kbps opus bitrate which is equivalent of ~512kbps mp3.
Using your own account might be possible by setting --username and --pasword
(See Authentication Options in --help)
Run Code Online (Sandbox Code Playgroud)
Wol*_*ang 13
这应该会给你最好的音质:
youtube-dl --extract-audio "https://www.youtube.com/watch?v=uWusmdmc0to"
Run Code Online (Sandbox Code Playgroud)
我建议不要指定任何音频格式。如果您指定音频格式,那么它可能与原始编码不同,并且您将损失音质。
mrg*_*oom 10
下载最佳音频:
youtube-dl -f bestaudio https://www.youtube.com/watch?v=3_y2jVPmPBw --output "out.%(ext)s"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18618 次 |
| 最近记录: |