RTMPDumpによるNHKラジオ放送の録音(現状メモ)

October 29, 2011 – 12:31 pm

多少前になってしまったが、9月1日からNHKラジオもインターネット経由で楽しめるようになった。NHKによるサービスも民放の場合(radiko)と同様にflashで配信されている。従って、基本的には、RTMPDumpにより録音することができる。
NHKラジオ放送の録音について、私の利用している範囲で、現状をメモしておいた。

NHKのラジオ番組の録音: NHKのラジオ番組の録音に必要な情報をまとめるとつぎのようになる:

  • RTMPDump v.2.4(現状の最新版)が必要
  • NHKラジオ録音に必要な諸パラメータ:
    • NHK第一放送
      rtmp: rtmpe://netradio-r1-flash.nhk.jp
      playpath: NetRadio_R1_flash@63346
      swfUrl: http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf
    • NHK第二放送
      rtmp: rtmpe://netradio-r2-flash.nhk.jp
      playpath: NetRadio_R2_flash@63342
      swfUrl: http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf
    • NHK FM
      rtmp: rtmpe://netradio-fm-flash.nhk.jp
      playpath: NetRadio_FM_flash@63343
      swfUrl: http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf

参考にしたサイト:
https://gist.github.com/1185755

RTMPDumpの最新版( v.2.4 ) は、そのダウンロードサイトから取得することができる。
現状では、この最新版はソースのみの提供であり、バイナリは自らコンパイルしなければならない。

ソースの最新版のダウンロードは、次からおこなうことができる。
git clone git://git.ffmpeg.org/rtmpdump

因みに、Git(ギット)は、「プログラムなどのソースコード管理を行う分散型バージョン管理システム」である。

RTMPdump v.2.4を動作させるために行った一連の作業について、以下、記述する。なお、以下のインストール作業では、RTMPdmpのパッケージを /opt 配下に展開している。なお、OSは Scientific Linux 6.1である。

git の yum install:

[root@yamasserver01 work]# yum install git\*
Loaded plugins: refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: perl-Git = 1.7.1-2.el6_0.1 for package: git-1.7.1-2.el6_0.1.x86_64
--> Processing Dependency: perl(Git) for package: git-1.7.1-2.el6_0.1.x86_64
--> Processing Dependency: perl(Error) for package: git-1.7.1-2.el6_0.1.x86_64
---> Package git-all.noarch 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: emacs-git = 1.7.1-2.el6_0.1 for package: git-all-1.7.1-2.el6_0.1.noarch
---> Package git-cvs.noarch 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: cvs for package: git-cvs-1.7.1-2.el6_0.1.noarch
--> Processing Dependency: cvsps for package: git-cvs-1.7.1-2.el6_0.1.noarch
---> Package git-daemon.x86_64 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: xinetd for package: git-daemon-1.7.1-2.el6_0.1.x86_64
---> Package git-email.noarch 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: perl(Authen::SASL) for package: git-email-1.7.1-2.el6_0.1.noarch
--> Processing Dependency: perl(Net::SMTP::SSL) for package: git-email-1.7.1-2.el6_0.1.noarch
---> Package git-gui.noarch 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: tk >= 8.4 for package: git-gui-1.7.1-2.el6_0.1.noarch
---> Package git-svn.noarch 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: perl(Term::ReadKey) for package: git-svn-1.7.1-2.el6_0.1.noarch
--> Processing Dependency: perl(SVN::Core) for package: git-svn-1.7.1-2.el6_0.1.noarch
--> Processing Dependency: subversion for package: git-svn-1.7.1-2.el6_0.1.noarch
---> Package gitk.noarch 0:1.7.1-2.el6_0.1 will be installed
---> Package gitweb.noarch 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: perl(CGI) for package: gitweb-1.7.1-2.el6_0.1.noarch
--> Processing Dependency: perl(CGI::Util) for package: gitweb-1.7.1-2.el6_0.1.noarch
--> Processing Dependency: perl(CGI::Carp) for package: gitweb-1.7.1-2.el6_0.1.noarch
--> Running transaction check
---> Package cvs.x86_64 0:1.11.23-11.el6_0.1 will be installed
---> Package cvsps.x86_64 0:2.2-0.6.b1.el6 will be installed
---> Package emacs-git.noarch 0:1.7.1-2.el6_0.1 will be installed
--> Processing Dependency: emacs(bin) >= 23.1 for package: emacs-git-1.7.1-2.el6_0.1.noarch
---> Package perl-Authen-SASL.noarch 0:2.13-2.el6 will be installed
--> Processing Dependency: perl(Digest::HMAC_MD5) for package: perl-Authen-SASL-2.13-2.el6.noarch
--> Processing Dependency: perl(GSSAPI) for package: perl-Authen-SASL-2.13-2.el6.noarch
---> Package perl-CGI.x86_64 0:3.51-119.el6 will be installed
---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed
---> Package perl-Git.noarch 0:1.7.1-2.el6_0.1 will be installed
---> Package perl-Net-SMTP-SSL.noarch 0:1.01-4.el6 will be installed
--> Processing Dependency: perl(IO::Socket::SSL) for package: perl-Net-SMTP-SSL-1.01-4.el6.noarch
---> Package perl-TermReadKey.x86_64 0:2.30-13.el6 will be installed
---> Package subversion.x86_64 0:1.6.11-2.el6_1.4 will be installed
--> Processing Dependency: perl(URI) >= 1.17 for package: subversion-1.6.11-2.el6_1.4.x86_64
--> Processing Dependency: libneon.so.27()(64bit) for package: subversion-1.6.11-2.el6_1.4.x86_64
---> Package subversion-perl.x86_64 0:1.6.11-2.el6_1.4 will be installed
---> Package tk.x86_64 1:8.5.7-5.el6 will be installed
--> Processing Dependency: tcl = 1:8.5.7 for package: 1:tk-8.5.7-5.el6.x86_64
--> Processing Dependency: libtcl8.5.so()(64bit) for package: 1:tk-8.5.7-5.el6.x86_64
---> Package xinetd.x86_64 2:2.3.14-31.el6 will be installed
--> Running transaction check
---> Package emacs-nox.x86_64 1:23.1-21.el6 will be installed
--> Processing Dependency: emacs-common = 1:23.1-21.el6 for package: 1:emacs-nox-23.1-21.el6.x86_64
---> Package neon.x86_64 0:0.29.3-1.2.el6 will be installed
--> Processing Dependency: libpakchois.so.0()(64bit) for package: neon-0.29.3-1.2.el6.x86_64
---> Package perl-Digest-HMAC.noarch 0:1.01-22.el6 will be installed
--> Processing Dependency: perl(Digest::SHA1) for package: perl-Digest-HMAC-1.01-22.el6.noarch
---> Package perl-GSSAPI.x86_64 0:0.26-5.el6 will be installed
---> Package perl-IO-Socket-SSL.noarch 0:1.31-2.el6 will be installed
--> Processing Dependency: perl(Net::SSLeay) >= 1.21 for package: perl-IO-Socket-SSL-1.31-2.el6.noarch
--> Processing Dependency: perl(Net::LibIDN) for package: perl-IO-Socket-SSL-1.31-2.el6.noarch
---> Package perl-URI.noarch 0:1.40-2.el6 will be installed
---> Package tcl.x86_64 1:8.5.7-6.el6 will be installed
--> Running transaction check
---> Package emacs-common.x86_64 1:23.1-21.el6 will be installed
---> Package pakchois.x86_64 0:0.4-3.2.el6 will be installed
---> Package perl-Digest-SHA1.x86_64 0:2.12-2.el6 will be installed
---> Package perl-Net-LibIDN.x86_64 0:0.12-3.el6 will be installed
---> Package perl-Net-SSLeay.x86_64 0:1.35-9.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================
 Package                    Arch           Version                    Repository           Size
================================================================================================
Installing:
 git                        x86_64         1.7.1-2.el6_0.1            sl                  4.6 M
 git-all                    noarch         1.7.1-2.el6_0.1            sl                   15 k
 git-cvs                    noarch         1.7.1-2.el6_0.1            sl                   83 k
 git-daemon                 x86_64         1.7.1-2.el6_0.1            sl                  248 k
 git-email                  noarch         1.7.1-2.el6_0.1            sl                   40 k
 git-gui                    noarch         1.7.1-2.el6_0.1            sl                  215 k
 git-svn                    noarch         1.7.1-2.el6_0.1            sl                   94 k
 gitk                       noarch         1.7.1-2.el6_0.1            sl                  131 k
 gitweb                     noarch         1.7.1-2.el6_0.1            sl                   86 k
Installing for dependencies:
 cvs                        x86_64         1.11.23-11.el6_0.1         sl                  712 k
 cvsps                      x86_64         2.2-0.6.b1.el6             sl                   55 k
 emacs-common               x86_64         1:23.1-21.el6              sl                   18 M
 emacs-git                  noarch         1.7.1-2.el6_0.1            sl                   39 k
 emacs-nox                  x86_64         1:23.1-21.el6              sl                  1.9 M
 neon                       x86_64         0.29.3-1.2.el6             sl                  118 k
 pakchois                   x86_64         0.4-3.2.el6                sl                   20 k
 perl-Authen-SASL           noarch         2.13-2.el6                 sl                   50 k
 perl-CGI                   x86_64         3.51-119.el6               sl                  205 k
 perl-Digest-HMAC           noarch         1.01-22.el6                sl                   21 k
 perl-Digest-SHA1           x86_64         2.12-2.el6                 sl                   48 k
 perl-Error                 noarch         1:0.17015-4.el6            sl                   28 k
 perl-GSSAPI                x86_64         0.26-5.el6                 sl                   63 k
 perl-Git                   noarch         1.7.1-2.el6_0.1            sl                   27 k
 perl-IO-Socket-SSL         noarch         1.31-2.el6                 sl                   68 k
 perl-Net-LibIDN            x86_64         0.12-3.el6                 sl                   34 k
 perl-Net-SMTP-SSL          noarch         1.01-4.el6                 sl                  7.1 k
 perl-Net-SSLeay            x86_64         1.35-9.el6                 sl                  172 k
 perl-TermReadKey           x86_64         2.30-13.el6                sl                   30 k
 perl-URI                   noarch         1.40-2.el6                 sl                  116 k
 subversion                 x86_64         1.6.11-2.el6_1.4           sl-security         2.3 M
 subversion-perl            x86_64         1.6.11-2.el6_1.4           sl-security         795 k
 tcl                        x86_64         1:8.5.7-6.el6              sl                  1.9 M
 tk                         x86_64         1:8.5.7-5.el6              sl                  1.4 M
 xinetd                     x86_64         2:2.3.14-31.el6            sl                  119 k

Transaction Summary
================================================================================================
Install      34 Package(s)

Total download size: 34 M
Installed size: 112 M
Is this ok [y/N]: y
Downloading Packages:
(1/34): cvs-1.11.23-11.el6_0.1.x86_64.rpm                                | 712 kB     00:02     
(2/34): cvsps-2.2-0.6.b1.el6.x86_64.rpm                                  |  55 kB     00:00     
(3/34): emacs-common-23.1-21.el6.x86_64.rpm                              |  18 MB     00:19     
(4/34): emacs-git-1.7.1-2.el6_0.1.noarch.rpm                             |  39 kB     00:00     
(5/34): emacs-nox-23.1-21.el6.x86_64.rpm                                 | 1.9 MB     00:03     
(6/34): git-1.7.1-2.el6_0.1.x86_64.rpm                                   | 4.6 MB     00:08     
(7/34): git-all-1.7.1-2.el6_0.1.noarch.rpm                               |  15 kB     00:00     
(8/34): git-cvs-1.7.1-2.el6_0.1.noarch.rpm                               |  83 kB     00:01     
(9/34): git-daemon-1.7.1-2.el6_0.1.x86_64.rpm                            | 248 kB     00:01     
(10/34): git-email-1.7.1-2.el6_0.1.noarch.rpm                            |  40 kB     00:01     
(11/34): git-gui-1.7.1-2.el6_0.1.noarch.rpm                              | 215 kB     00:01     
(12/34): git-svn-1.7.1-2.el6_0.1.noarch.rpm                              |  94 kB     00:00     
(13/34): gitk-1.7.1-2.el6_0.1.noarch.rpm                                 | 131 kB     00:01     
(14/34): gitweb-1.7.1-2.el6_0.1.noarch.rpm                               |  86 kB     00:00     
(15/34): neon-0.29.3-1.2.el6.x86_64.rpm                                  | 118 kB     00:00     
(16/34): pakchois-0.4-3.2.el6.x86_64.rpm                                 |  20 kB     00:00     
(17/34): perl-Authen-SASL-2.13-2.el6.noarch.rpm                          |  50 kB     00:01     
(18/34): perl-CGI-3.51-119.el6.x86_64.rpm                                | 205 kB     00:01     
(19/34): perl-Digest-HMAC-1.01-22.el6.noarch.rpm                         |  21 kB     00:00     
(20/34): perl-Digest-SHA1-2.12-2.el6.x86_64.rpm                          |  48 kB     00:00     
(21/34): perl-Error-0.17015-4.el6.noarch.rpm                             |  28 kB     00:00     
(22/34): perl-GSSAPI-0.26-5.el6.x86_64.rpm                               |  63 kB     00:00     
(23/34): perl-Git-1.7.1-2.el6_0.1.noarch.rpm                             |  27 kB     00:00     
(24/34): perl-IO-Socket-SSL-1.31-2.el6.noarch.rpm                        |  68 kB     00:00     
(25/34): perl-Net-LibIDN-0.12-3.el6.x86_64.rpm                           |  34 kB     00:00     
(26/34): perl-Net-SMTP-SSL-1.01-4.el6.noarch.rpm                         | 7.1 kB     00:00     
(27/34): perl-Net-SSLeay-1.35-9.el6.x86_64.rpm                           | 172 kB     00:00     
(28/34): perl-TermReadKey-2.30-13.el6.x86_64.rpm                         |  30 kB     00:00     
(29/34): perl-URI-1.40-2.el6.noarch.rpm                                  | 116 kB     00:01     
(30/34): subversion-1.6.11-2.el6_1.4.x86_64.rpm                          | 2.3 MB     00:07     
(31/34): subversion-perl-1.6.11-2.el6_1.4.x86_64.rpm                     | 795 kB     00:01     
(32/34): tcl-8.5.7-6.el6.x86_64.rpm                                      | 1.9 MB     00:03     
(33/34): tk-8.5.7-5.el6.x86_64.rpm                                       | 1.4 MB     00:02     
(34/34): xinetd-2.3.14-31.el6.x86_64.rpm                                 | 119 kB     00:00     
------------------------------------------------------------------------------------------------
Total                                                           470 kB/s |  34 MB     01:13     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:perl-Error-0.17015-4.el6.noarch                                           1/34 
  Installing : git-1.7.1-2.el6_0.1.x86_64                                                  2/34 
  Installing : perl-Git-1.7.1-2.el6_0.1.noarch                                             3/34 
  Installing : cvs-1.11.23-11.el6_0.1.x86_64                                               4/34 
  Installing : cvsps-2.2-0.6.b1.el6.x86_64                                                 5/34 
  Installing : git-cvs-1.7.1-2.el6_0.1.noarch                                              6/34 
  Installing : perl-Net-SSLeay-1.35-9.el6.x86_64                                           7/34 
  Installing : perl-CGI-3.51-119.el6.x86_64                                                8/34 
  Installing : 2:xinetd-2.3.14-31.el6.x86_64                                               9/34 
  Installing : perl-TermReadKey-2.30-13.el6.x86_64                                        10/34 
  Installing : perl-URI-1.40-2.el6.noarch                                                 11/34 
  Installing : perl-Digest-SHA1-2.12-2.el6.x86_64                                         12/34 
  Installing : perl-Digest-HMAC-1.01-22.el6.noarch                                        13/34 
  Installing : perl-GSSAPI-0.26-5.el6.x86_64                                              14/34 
  Installing : perl-Authen-SASL-2.13-2.el6.noarch                                         15/34 
  Installing : perl-Net-LibIDN-0.12-3.el6.x86_64                                          16/34 
  Installing : perl-IO-Socket-SSL-1.31-2.el6.noarch                                       17/34 
  Installing : perl-Net-SMTP-SSL-1.01-4.el6.noarch                                        18/34 
  Installing : git-email-1.7.1-2.el6_0.1.noarch                                           19/34 
  Installing : 1:tcl-8.5.7-6.el6.x86_64                                                   20/34 
  Installing : 1:tk-8.5.7-5.el6.x86_64                                                    21/34 
  Installing : gitk-1.7.1-2.el6_0.1.noarch                                                22/34 
  Installing : git-gui-1.7.1-2.el6_0.1.noarch                                             23/34 
  Installing : 1:emacs-common-23.1-21.el6.x86_64                                          24/34 
  Installing : 1:emacs-nox-23.1-21.el6.x86_64                                             25/34 
  Installing : emacs-git-1.7.1-2.el6_0.1.noarch                                           26/34 
  Installing : pakchois-0.4-3.2.el6.x86_64                                                27/34 
  Installing : neon-0.29.3-1.2.el6.x86_64                                                 28/34 
  Installing : subversion-1.6.11-2.el6_1.4.x86_64                                         29/34 
  Installing : subversion-perl-1.6.11-2.el6_1.4.x86_64                                    30/34 
  Installing : git-svn-1.7.1-2.el6_0.1.noarch                                             31/34 
  Installing : git-all-1.7.1-2.el6_0.1.noarch                                             32/34 
  Installing : git-daemon-1.7.1-2.el6_0.1.x86_64                                          33/34 
  Installing : gitweb-1.7.1-2.el6_0.1.noarch                                              34/34 

Installed:
  git.x86_64 0:1.7.1-2.el6_0.1                   git-all.noarch 0:1.7.1-2.el6_0.1               
  git-cvs.noarch 0:1.7.1-2.el6_0.1               git-daemon.x86_64 0:1.7.1-2.el6_0.1            
  git-email.noarch 0:1.7.1-2.el6_0.1             git-gui.noarch 0:1.7.1-2.el6_0.1               
  git-svn.noarch 0:1.7.1-2.el6_0.1               gitk.noarch 0:1.7.1-2.el6_0.1                  
  gitweb.noarch 0:1.7.1-2.el6_0.1               

Dependency Installed:
  cvs.x86_64 0:1.11.23-11.el6_0.1               cvsps.x86_64 0:2.2-0.6.b1.el6                   
  emacs-common.x86_64 1:23.1-21.el6             emacs-git.noarch 0:1.7.1-2.el6_0.1              
  emacs-nox.x86_64 1:23.1-21.el6                neon.x86_64 0:0.29.3-1.2.el6                    
  pakchois.x86_64 0:0.4-3.2.el6                 perl-Authen-SASL.noarch 0:2.13-2.el6            
  perl-CGI.x86_64 0:3.51-119.el6                perl-Digest-HMAC.noarch 0:1.01-22.el6           
  perl-Digest-SHA1.x86_64 0:2.12-2.el6          perl-Error.noarch 1:0.17015-4.el6               
  perl-GSSAPI.x86_64 0:0.26-5.el6               perl-Git.noarch 0:1.7.1-2.el6_0.1               
  perl-IO-Socket-SSL.noarch 0:1.31-2.el6        perl-Net-LibIDN.x86_64 0:0.12-3.el6             
  perl-Net-SMTP-SSL.noarch 0:1.01-4.el6         perl-Net-SSLeay.x86_64 0:1.35-9.el6             
  perl-TermReadKey.x86_64 0:2.30-13.el6         perl-URI.noarch 0:1.40-2.el6                    
  subversion.x86_64 0:1.6.11-2.el6_1.4          subversion-perl.x86_64 0:1.6.11-2.el6_1.4       
  tcl.x86_64 1:8.5.7-6.el6                      tk.x86_64 1:8.5.7-5.el6                         
  xinetd.x86_64 2:2.3.14-31.el6                

Complete!

RTMPdumpソースコードをダウンロード:

[root@yamasserver01 opt]# git clone git://git.ffmpeg.org/rtmpdump
Initialized empty Git repository in /opt/rtmpdump/.git/
remote: Counting objects: 2282, done.
remote: Compressing objects: 100% (643/643), done.
remote: Total 2282 (delta 1720), reused 2160 (delta 1638)
Receiving objects: 100% (2282/2282), 737.94 KiB | 175 KiB/s, done.
Resolving deltas: 100% (1720/1720), done.

コンパイル(make)

[root@yamasserver01 opt]# cd rtmpdump
[root@yamasserver01 rtmpdump]# ls
ChangeLog  librtmp   README      rtmpdump.1.html  rtmpgw.8       rtmpgw.c   rtmpsuck.c  thread.h
COPYING    Makefile  rtmpdump.1  rtmpdump.c       rtmpgw.8.html  rtmpsrv.c  thread.c
[root@yamasserver01 rtmpdump]# make SYS=posix
make[1]: Entering directory `/opt/rtmpdump/librtmp'
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_OPENSSL  -O2 -fPIC   -c -o rtmp.o rtmp.c
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_OPENSSL  -O2 -fPIC   -c -o log.o log.c
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_OPENSSL  -O2 -fPIC   -c -o amf.o amf.c
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_OPENSSL  -O2 -fPIC   -c -o hashswf.o hashswf.c
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_OPENSSL  -O2 -fPIC   -c -o parseurl.o parseurl.c
ar rs librtmp.a rtmp.o log.o amf.o hashswf.o parseurl.o
ar: creating librtmp.a
gcc -shared -Wl,-soname,librtmp.so.0  -o librtmp.so.0 rtmp.o log.o amf.o hashswf.o parseurl.o  -lssl -lcrypto -lz 
ln -sf librtmp.so.0 librtmp.so
make[1]: Leaving directory `/opt/rtmpdump/librtmp'
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\"   -O2   -c -o rtmpdump.o rtmpdump.c
gcc -Wall  -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lssl -lcrypto -lz  
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\"   -O2   -c -o rtmpgw.o rtmpgw.c
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\"   -O2   -c -o thread.o thread.c
gcc -Wall  -o rtmpgw rtmpgw.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz  
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\"   -O2   -c -o rtmpsrv.o rtmpsrv.c
gcc -Wall  -o rtmpsrv rtmpsrv.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz  
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\"   -O2   -c -o rtmpsuck.o rtmpsuck.c
gcc -Wall  -o rtmpsuck rtmpsuck.o thread.o -lpthread -Llibrtmp -lrtmp -lssl -lcrypto -lz 

ここで、コンパイル結果を確認し、rtmpdumpを実行してみると

[root@yamasserver01 rtmpdump]# ls
ChangeLog  README           rtmpdump.c  rtmpgw.8.html  rtmpsrv.c   rtmpsuck.o
COPYING    rtmpdump         rtmpdump.o  rtmpgw.c       rtmpsrv.o   thread.c
librtmp    rtmpdump.1       rtmpgw      rtmpgw.o       rtmpsuck    thread.h
Makefile   rtmpdump.1.html  rtmpgw.8    rtmpsrv        rtmpsuck.c  thread.o
[root@yamasserver01 rtmpdump]# ./rtmpdump
./rtmpdump: error while loading shared libraries: librtmp.so.0: cannot open shared object file: No such file or directory

librtmp.so.0 が共有ライブラリとして登録されてないため、エラーになっている。以下の要領で、これを共有ライブラリに登録

まず、/etc/ld.so.conf を以下のように修正。

/etc/ld.so.conf:

include ld.so.conf.d/*.conf
/opt/rtmpdump/librtmp          <=== 追加

共有ライブラリをエフェクティブにする。

[root@yamasserver01 rtmpdump]# ldconfig

NHK第一放送を試しに録音してみる:

[root@yamasserver01 rtmpdump]# ./rtmpdump --rtmp "rtmpe://netradio-r1-flash.nhk.jp" \
> --playpath 'NetRadio_R1_flash@63346' \
> --app "live" \
> -W http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf \
> --live \
> -o r1.m4a
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
WARNING: No application or playpath in URL!
Connecting ...
WARNING: HandShake: Type mismatch: client sent 6, server answered 9
INFO: Connected...
Starting Live Stream
INFO: Metadata:
INFO:   audiodatarate         48.00
INFO:   audiocodecid          mp4a
79.040 kB / 12.59 sec

  1. 1 Trackback(s)

  2. Dec 13, 2015: Linux Mint でrtmpdumpをソースビルド – Raspi-Linux ガジェットベース

Post a Comment