之前下载通过youtube-dl命令下载了几个视频,一直没空看,今天播放的时候,才发现没声音 -_-!!!

搜索了下,基本下载1080P的视频才会没声音,看了下之前下载的视频,确实都是1080P。

解决方案

所有可能的下载码率

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
>>> youtube-dl -F youtube_url
[youtube] GZU7-u6xJuQ: Downloading webpage
[info] Available formats for GZU7-u6xJuQ:
format code  extension  resolution note
249          webm       audio only tiny   62k , opus @ 50k (48000Hz), 1.58MiB
250          webm       audio only tiny   80k , opus @ 70k (48000Hz), 2.09MiB
140          m4a        audio only tiny  130k , m4a_dash container, mp4a.40.2@128k (44100Hz), 3.64MiB
251          webm       audio only tiny  153k , opus @160k (48000Hz), 4.05MiB
278          webm       256x142    144p   96k , webm container, vp9, 30fps, video only, 2.61MiB
160          mp4        256x142    144p  110k , avc1.4d400c, 30fps, video only, 2.79MiB
242          webm       426x238    240p  226k , vp9, 30fps, video only, 5.96MiB
133          mp4        426x238    240p  282k , avc1.4d4015, 30fps, video only, 5.64MiB
243          webm       640x358    360p  406k , vp9, 30fps, video only, 10.82MiB
134          mp4        640x358    360p  606k , avc1.4d401e, 30fps, video only, 12.31MiB
244          webm       854x476    480p  752k , vp9, 30fps, video only, 18.39MiB
135          mp4        854x476    480p  953k , avc1.4d401f, 30fps, video only, 20.06MiB
247          webm       1280x714   720p 1537k , vp9, 30fps, video only, 34.65MiB
136          mp4        1280x714   720p 1959k , avc1.4d401f, 30fps, video only, 32.74MiB
248          webm       1920x1072  1080p 2650k , vp9, 30fps, video only, 72.41MiB
137          mp4        1920x1072  1080p 4476k , avc1.640028, 30fps, video only, 102.01MiB
18           mp4        640x356    360p  738k , avc1.42001E, 30fps, mp4a.40.2@ 96k (44100Hz), 20.77MiB
22           mp4        1280x714   720p 1293k , avc1.64001F, 30fps, mp4a.40.2@192k (44100Hz) (best)

format列,即第一列为码率。

根据码率下载视频

我用的是137这个format。

1
youtube-dl -f 137 youtube_url

然后下载的视频就没声音了。

码率导入音频合成

将你要的码率导入音频合成mkv,命令如下:

1
youtube-dl -f 137+bestaudio --merge-output-format mkv youtube_url

Done.