Skip to content

Instantly share code, notes, and snippets.

@yhstvhd
Last active November 6, 2022 14:37
Show Gist options
  • Save yhstvhd/7f91352700d6407f2c2a75a8469dad82 to your computer and use it in GitHub Desktop.
Save yhstvhd/7f91352700d6407f2c2a75a8469dad82 to your computer and use it in GitHub Desktop.
YoutubeDL動画無劣化ダウンロード

youtube-dl -f bestvideo+bestaudio[ext=m4a] --merge-output-format mp4 [URLまたは動画ID][出力ファイル名]

解説

ffmpegがあればmp4で書き出しされる。

bestvideo+bestaudio 動画音声最高品質

[ext=m4a] 音声はm4a(AAC)で、これがそのあとの結合作業で重要になってくる

--merge-output-format mp4 mp4で書き出し

youtube-dl -f bestvideo+bestaudio --merge-output-format mp4 [URLまたは動画ID]

がもともとネットに転がっていたが、音声がwebM形式で落とされてしまう。

この場合、結合作業の時にAAC形式にエンコードが必要で、無劣化でエンコードすることは不可能に近いためもともとAACでダウンロードする指定にした。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment