youtube-dl 如何转换视频格式质量我还没有找到解决方案

youtube-dl 如何转换视频格式质量我还没有找到解决方案

我有youtube dl视频质量问题。我试过了,youtube-dlodysee问题是视频只有一种格式,使用最佳格式选项时我无法将视频质量改为最低...我尝试在互联网上搜索解决方案,但一无所获。我试过使用选项max-file大小,但也没有用。它告诉我文件大于我要求的大小(文件大于最大文件大小)。

所以我在想,是否可以正常下载视频,然后将视频转换为较低质量?因为我已经看到,您显然可以将格式从 mp4 更改为 avi,但是否可以下载视频,然后自动将其从 mp4 1080p 转换为 mp4 480p?这样它占用的硬盘空间就更少了。

答案1

youtube-dl不再受支持,其最新版本来自17 December 2021

一个很好的选择是一个名为yt-dlp

以下是一些可能对您有用的选项:

# Download the best video available but no better than 480p,
# or the worst video if there is no video under 480p
$ yt-dlp -f "bv*[height<=480]+ba/b[height<=480] / wv*+ba/w"

# Download the best video available with the largest height but no better than 480p,
# or the best video with the smallest resolution if there is no video under 480p
$ yt-dlp -S "height:480"

# Download the best video available with the largest resolution but no better than 480p,
# or the best video with the smallest resolution if there is no video under 480p
# Resolution is determined by using the smallest dimension.
# So this works correctly for vertical videos as well
$ yt-dlp -S "res:480"

# Download the best video (that also has audio) but no bigger than 50 MB,
# or the worst video (that also has audio) if there is no video under 50 MB
$ yt-dlp -f "b[filesize<50M] / w"

# Download largest video (that also has audio) but no bigger than 50 MB,
# or the smallest video (that also has audio) if there is no video under 50 MB
$ yt-dlp -f "b" -S "filesize:50M"

# Download best video (that also has audio) that is closest in size to 50 MB
$ yt-dlp -f "b" -S "filesize~50M"

如果问题在于源中只有高质量视频,则下载后必须进行一些转换。您还可以检查这个问题:如何使用 ffmpeg 减小视频尺寸?

相关内容