如何才能获得 MP4 格式的最佳视频(带音频)?

如何才能获得 MP4 格式的最佳视频(带音频)?

我正在尝试使用 youtube dl 命令行从流媒体 URL 下载最佳视频和音频,以下是响应。了解这一点后,我如何才能获得 MP4 格式的最佳视频(带音频)?

hls-audio-0-en__Main_-0                      mp4        audio only [en]
hls-audio-0-en__Main_-1                      mp4        audio only [en]
dash-6f83f6b4-5475-475f-8955-b2aca8bd9b54-0  m4a        audio only [en] DASH audio   96k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-6f83f6b4-5475-475f-8955-b2aca8bd9b54-1  m4a        audio only [en] DASH audio   96k , m4a_dash container, mp4a.40.2 (48000Hz)
dash-b90bf8a1-4681-438b-80f9-17ccbfd52366-0  mp4        480x270    DASH video   96k , mp4_dash container, avc1.420015, video only
dash-b90bf8a1-4681-438b-80f9-17ccbfd52366-1  mp4        480x270    DASH video   96k , mp4_dash container, avc1.420015, video only
dash-bc267a90-3ac3-4eed-a4b9-73bd6b94bec7-0  mp4        480x270    DASH video  149k , mp4_dash container, avc1.420015, video only
dash-bc267a90-3ac3-4eed-a4b9-73bd6b94bec7-1  mp4        480x270    DASH video  149k , mp4_dash container, avc1.420015, video only
hls-211-0                                    mp4        480x270     211k , avc1.420015, video only
hls-211-1                                    mp4        480x270     211k , avc1.420015, video only
hls-269-0                                    mp4        480x270     269k , avc1.420015, video only
hls-269-1                                    mp4        480x270     269k , avc1.420015, video only
dash-da90237b-f0a3-4f51-8962-d41cb1d9babe-0  mp4        640x360    DASH video  298k , mp4_dash container, avc1.42001e, video only
dash-da90237b-f0a3-4f51-8962-d41cb1d9babe-1  mp4        640x360    DASH video  298k , mp4_dash container, avc1.42001e, video only
hls-433-0                                    mp4        640x360     433k , avc1.42001e, video only
hls-433-1                                    mp4        640x360     433k , avc1.42001e, video only
dash-fcf57c07-c6e3-4761-8793-d2722f438deb-0  mp4        480x270    DASH video  449k , mp4_dash container, avc1.420015, video only
dash-fcf57c07-c6e3-4761-8793-d2722f438deb-1  mp4        480x270    DASH video  449k , mp4_dash container, avc1.420015, video only
hls-599-0                                    mp4        480x270     599k , avc1.420015, video only
hls-599-1                                    mp4        480x270     599k , avc1.420015, video only
dash-f1e7f24b-d987-42c0-a361-8aca5ed5b332-0  mp4        640x360    DASH video  600k , mp4_dash container, avc1.4d001e, video only
dash-f1e7f24b-d987-42c0-a361-8aca5ed5b332-1  mp4        640x360    DASH video  600k , mp4_dash container, avc1.4d001e, video only
hls-765-0                                    mp4        640x360     765k , avc1.4d001e, video only
hls-765-1                                    mp4        640x360     765k , avc1.4d001e, video only
dash-1374be5e-cf80-4070-908f-30072d7ac63c-0  mp4        960x540    DASH video  897k , mp4_dash container, avc1.4d001f, video only
dash-1374be5e-cf80-4070-908f-30072d7ac63c-1  mp4        960x540    DASH video  897k , mp4_dash container, avc1.4d001f, video only
dash-92c6d340-b465-4dac-8d90-b778ab129c3b-0  mp4        640x360    DASH video  902k , mp4_dash container, avc1.4d001e, video only
dash-92c6d340-b465-4dac-8d90-b778ab129c3b-1  mp4        640x360    DASH video  902k , mp4_dash container, avc1.4d001e, video only
hls-1092-0                                   mp4        960x540    1092k , avc1.4d001f, video only
hls-1092-1                                   mp4        960x540    1092k , avc1.4d001f, video only
hls-1097-0                                   mp4        640x360    1097k , avc1.4d001e, video only
hls-1097-1                                   mp4        640x360    1097k , avc1.4d001e, video only
dash-db8ce174-87d5-4a7c-ad82-339f0762ac13-0  mp4        1024x576   DASH video 1198k , mp4_dash container, avc1.4d001f, video only
dash-db8ce174-87d5-4a7c-ad82-339f0762ac13-1  mp4        1024x576   DASH video 1198k , mp4_dash container, avc1.4d001f, video only
hls-1423-0                                   mp4        1024x576   1423k , avc1.4d001f, video only
hls-1423-1                                   mp4        1024x576   1423k , avc1.4d001f, video only
dash-20e55c72-e12b-4b9c-9e6c-b0e2beb1b4dc-0  mp4        1280x720   DASH video 1501k , mp4_dash container, avc1.4d001f, video only
dash-20e55c72-e12b-4b9c-9e6c-b0e2beb1b4dc-1  mp4        1280x720   DASH video 1501k , mp4_dash container, avc1.4d001f, video only
hls-1756-0                                   mp4        1280x720   1756k , avc1.4d001f, video only
hls-1756-1                                   mp4        1280x720   1756k , avc1.4d001f, video only (best)

答案1

这将选择最佳的视频和音频质量:

youtube-dl -f bestvideo+bestaudio youtube.com/watch?v=videocode

然后,如果最佳视频和音频流不是该mp4格式,您也可以传递一个--recode-video mp4选项。

您在问题中显示的输出没有显示任何其他视频格式,因此mp4在这种情况下您不需要添加额外的选项。

答案2

您可以使用yt-dlp(它是 youtube-dl 的分支)在选择格式和发布下载选项方面有更多选项。而且它更新得更快

相关内容