end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

RTMPDump ver.2.4をソースからイントール

radiko.jp等でたまにRTMP(Real Time Messaging Protocol)に出くわすので、RTMPDumpをイントールしてみました。
http://rtmpdump.mplayerhq.hu/

win版やandroid版もあるらしい
http://rtmpdump.mplayerhq.hu/download/

前準備 openssl-develのinstall

opensslはインストールしなかったかなぁ...と思いつつ、「make SYS=posix」でエラーとなるので、yumでinstall (opensslへのpath指定も面倒ですし)

$ su - 
# yum install openssl-devel

「make SYS=posix」時のエラー

[endo@colinux rtmpdump]$ make SYS=posix
make[1]: Entering directory `/home/endo/tmp/rtmpdump/librtmp'
gcc -Wall   -DRTMPDUMP_VERSION=\"v2.4\" -DUSE_OPENSSL  -O2 -fPIC   -c -o rtmp.o rtmp.c
rtmp.c:40:25: error: openssl/ssl.h: No such file or directory
rtmp.c:41:25: error: openssl/rc4.h: No such file or directory
rtmp.c:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
In file included from rtmp.c:127:
handshake.h:66:25: error: openssl/sha.h: No such file or directory
handshake.h:67:26: error: openssl/hmac.h: No such file or directory
handshake.h:70:2: error: #error Your OpenSSL is too old, need 0.9.8 or newer with SHA256
In file included from rtmp.c:127:
handshake.h:76: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
In file included from handshake.h:86,
                 from rtmp.c:127:
dh.h:125:24: error: openssl/bn.h: No such file or directory
dh.h:126:24: error: openssl/dh.h: No such file or directory
In file included from handshake.h:86,
                 from rtmp.c:127:
dh.h:128: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
In file included from handshake.h:86,
                 from rtmp.c:127:
dh.h:155: error: expected ')' before 'y'
dh.h:205: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
dh.h:238: error: expected ')' before '*' token
dh.h:272: error: expected ')' before '*' token
dh.h:308: error: expected ')' before '*' token
In file included from rtmp.c:127:
handshake.h:116: error: expected declaration specifiers or '...' before 'RC4_handle'
handshake.h:116: error: expected declaration specifiers or '...' before 'RC4_handle'
handshake.h: In function 'InitRC4Encryption':
handshake.h:118: error: 'SHA256_DIGEST_LENGTH' undeclared (first use in this function)
handshake.h:118: error: (Each undeclared identifier is reported only once
handshake.h:118: error: for each function it appears in.)
handshake.h:120: error: 'HMAC_CTX' undeclared (first use in this function)
handshake.h:120: error: expected ';' before 'ctx'
handshake.h:122: error: 'rc4keyIn' undeclared (first use in this function)
handshake.h:122: error: 'RC4_KEY' undeclared (first use in this function)
handshake.h:123: error: 'rc4keyOut' undeclared (first use in this function)
handshake.h:125: warning: implicit declaration of function 'HMAC_CTX_init'
handshake.h:125: error: 'ctx' undeclared (first use in this function)
handshake.h:125: warning: implicit declaration of function 'HMAC_Init_ex'
handshake.h:125: warning: implicit declaration of function 'EVP_sha256'
handshake.h:126: warning: implicit declaration of function 'HMAC_Update'
handshake.h:127: warning: implicit declaration of function 'HMAC_Final'
handshake.h:127: warning: implicit declaration of function 'HMAC_CTX_cleanup'
handshake.h:132: warning: implicit declaration of function 'RC4_set_key'
handshake.h:118: warning: unused variable 'digest'
handshake.h: In function 'HMACsha256':
handshake.h:269: error: 'HMAC_CTX' undeclared (first use in this function)
handshake.h:269: error: expected ';' before 'ctx'
handshake.h:271: error: 'ctx' undeclared (first use in this function)
handshake.h: In function 'CalculateDigest':
handshake.h:282: error: 'SHA256_DIGEST_LENGTH' undeclared (first use in this function)
handshake.h:283: warning: unused variable 'message'
handshake.h: In function 'VerifyDigest':
handshake.h:297: error: 'SHA256_DIGEST_LENGTH' undeclared (first use in this function)
handshake.h:297: warning: unused variable 'calcDigest'
handshake.h: In function 'HandShake':
handshake.h:703: error: 'RC4_handle' undeclared (first use in this function)
handshake.h:703: error: expected ';' before 'keyIn'
handshake.h:704: error: expected ';' before 'keyOut'
handshake.h:772: warning: implicit declaration of function 'DHInit'
handshake.h:772: warning: assignment makes pointer from integer without a cast
handshake.h:783: warning: implicit declaration of function 'DHGenerateKey'
handshake.h:790: warning: implicit declaration of function 'DHGetPublicKey'
handshake.h:806: error: 'SHA256_DIGEST_LENGTH' undeclared (first use in this function)
handshake.h:893: warning: implicit declaration of function 'DHComputeSharedSecretKey'
handshake.h:907: error: 'keyIn' undeclared (first use in this function)
handshake.h:907: error: 'keyOut' undeclared (first use in this function)
handshake.h:907: error: too many arguments to function 'InitRC4Encryption'
handshake.h:847: warning: unused variable 'digestResp'
handshake.h:1049: warning: implicit declaration of function 'RC4'
handshake.h:983: warning: unused variable 'digest'
handshake.h:982: warning: unused variable 'signature'
handshake.h: In function 'SHandShake':
handshake.h:1077: error: 'RC4_handle' undeclared (first use in this function)
handshake.h:1077: error: expected ';' before 'keyIn'
handshake.h:1078: error: expected ';' before 'keyOut'
handshake.h:1160: warning: assignment makes pointer from integer without a cast
handshake.h:1195: error: 'SHA256_DIGEST_LENGTH' undeclared (first use in this function)
handshake.h:1277: error: 'keyIn' undeclared (first use in this function)
handshake.h:1277: error: 'keyOut' undeclared (first use in this function)
handshake.h:1277: error: too many arguments to function 'InitRC4Encryption'
handshake.h:1214: warning: unused variable 'digestResp'
handshake.h:1341: warning: unused variable 'digest'
handshake.h:1340: warning: unused variable 'signature'
rtmp.c: In function 'RTMP_TLS_Init':
rtmp.c:220: warning: implicit declaration of function 'SSL_load_error_strings'
rtmp.c:221: warning: implicit declaration of function 'SSL_library_init'
rtmp.c:222: warning: implicit declaration of function 'OpenSSL_add_all_digests'
rtmp.c:223: error: 'RTMP_TLS_ctx' undeclared (first use in this function)
rtmp.c:223: warning: implicit declaration of function 'SSL_CTX_new'
rtmp.c:223: warning: implicit declaration of function 'SSLv23_method'
rtmp.c:224: warning: implicit declaration of function 'SSL_CTX_set_options'
rtmp.c:224: error: 'SSL_OP_ALL' undeclared (first use in this function)
rtmp.c:225: warning: implicit declaration of function 'SSL_CTX_set_default_verify_paths'
rtmp.c: In function 'RTMP_Init':
rtmp.c:246: error: 'RTMP_TLS_ctx' undeclared (first use in this function)
rtmp.c: In function 'RTMP_Connect1':
rtmp.c:867: warning: implicit declaration of function 'SSL_new'
rtmp.c:867: error: 'RTMP_TLS_ctx' undeclared (first use in this function)
rtmp.c:867: warning: assignment makes pointer from integer without a cast
rtmp.c:868: warning: implicit declaration of function 'SSL_set_fd'
rtmp.c:869: warning: implicit declaration of function 'SSL_connect'
rtmp.c: In function 'RTMP_Close':
rtmp.c:3535: warning: implicit declaration of function 'DH_free'
rtmp.c: In function 'RTMPSockBuf_Fill':
rtmp.c:3565: warning: implicit declaration of function 'SSL_read'
rtmp.c: In function 'RTMPSockBuf_Send':
rtmp.c:3608: warning: implicit declaration of function 'SSL_write'
rtmp.c: In function 'RTMPSockBuf_Close':
rtmp.c:3624: warning: implicit declaration of function 'SSL_shutdown'
rtmp.c:3625: warning: implicit declaration of function 'SSL_free'
make[1]: *** [rtmp.o] Error 1
make[1]: Leaving directory `/home/endo/tmp/rtmpdump/librtmp'
make: *** [librtmp/librtmp.a] Error 2
[endo@colinux rtmpdump]$ 

RTMPDumpをsrcからinstall

## ver.2.4は http://rtmpdump.mplayerhq.hu/download/ にありませんでした
$ git clone git://git.ffmpeg.org/rtmpdump 
## refer to README file
$ make SYS=posix
$ su -
# make install

flvstreamerは、プロジェクト継続してる?

http://savannah.nongnu.org/projects/flvstreamer/