6
4

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 5 years have passed since last update.

[obsolate]「らじるらじる」のエアチェックを rtmpdump(1) じゃなく、ffmpeg(1) でやってみる。

Last updated at Posted at 2017-03-02

ネット上で rtmpdump コマンドを用いて録音するコマンドが、彼方此方で公開されている。
例では国営放送の FM で大阪放送局を、約五秒間録音出来るコマンドだ。

% rtmpdump -r 'rtmpe://netradio-bkfm-flash.nhk.jp/live/NetRadio_BKFM_flash@108233' -W http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf -B 5 -o HOGEHOGE.flv

出来上がった録音ファイルは、flv コンテナに格納されるため、特定の音楽再生ブログラムでファイルを認識しない。
なので mp4 の書式に変換する手間を、省こうと思い実験してみる。

ffmpeg にも rtmp の各種プロトコルに対応しているので、rtmpdump に与えているスイッチを、ffmpeg に対応させてみる。
この ffmpeg には特に codec のライブラリはマージさせて無くても、録音ダケなら上手くいくはず。

% ffmpeg -i 'rtmpe://netradio-bkfm-flash.nhk.jp/live/NetRadio_BKFM_flash@108233' -rtmp_swfurl http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf -t 5 HOGEHOGE.flv

各コマンドのスイッチに対応する表

rtmpdump ffmpeg
-r -i
-W -rtmp_swfurl
-B -t

これで、一発録音と変換が出来る。

2017/09/02 以降 rtmpe プロトコルでの配信が停止した模様で、url 一覧のアドレスも変更になった模様。

http://www.nhk.or.jp/radio/config/config_web.xml

故に、rtmpdump が利用できなくなり、以下のコマンドに差し替えを要する。
例では国営放送の FM で福岡放送局を、約五秒間録音出来るコマンドだ。

% ffmpeg -i 'https://nhkradiolkfm-i.akamaihd.net/hls/live/512097/1-fm/1-fm-01.m3u8' -t 5 -codec copy HOGEHOGE.m4a
6
4
2

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
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?