5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ffmpegで、ストリーミングビデオをダウンロードする

Posted at

はじめに

YouTubeのビデオは、youtube-dlでダウンロードすればよい。
そのほかのストリーミングビデオを、どうやってDLすればいいかわからなかった。

ffmpegを使うとかんたんらしい。URLを拾うのが(ウェブサイトのソースコードを読んでも)わからないことがあって、Chrome拡張のVideo Downloadhelperを使った。

環境

ここで書いていることは、下記のバージョンで実施しました。

  • Video DownloadHelper バージョン 7.5.0.3
  • Google Chrome バージョン: 89.0.4389.114(Official Build)
  • macOS BigSur 11.1

手順

インストール(詳細略)

  • ffmpeg
  • Video DownloadHelper

ストリーミングビデオのダウンロード

  • Google Chromeで、DLしたい動画のURLを開く
  • Video DownloadHelperで「URLのコピー」

SS 2021-04-12 16.37.14.png

  • コピーしたURLを下記に入れる
$ ffmpeg -i "<ここにコピーしたURL>" -c copy -bsf:a aac_adtstoasc rec.mp4

rec.mp4は適当に。拡張子を見て変換は自動的にやってくれる(らしい)。-bsf:aのところは、参考にしたサイトのパクリで、考えはじゅうぶんでない。

リソース

ffmpeg を使い、HTTP Live Streaming(HLS)をファイルに保存し、保存したファイルからストリーミングを行う方法について

を参考にした。理解不足かもしれないが、URLのところは""で括らないとうまく動かなかった。

5
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?