1.执行
git clone git://git.ffmpeg.org/rtmpdump
2.make
3.执行rtmpdump -v
rtmpdump: error while loading shared libraries: librtmp.so.1: cannot open shared object file: No such file or directory
缺少库librtmp.so.1
执行make install
如下
make[1]: Entering directory `/home/vagrant/rtmpdump/librtmp'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/vagrant/rtmpdump/librtmp'
mkdir -p /usr/local/bin /usr/local/sbin /usr/local/man/man1 /usr/local/man/man8
cp rtmpdump /usr/local/bin
cp rtmpgw rtmpsrv rtmpsuck /usr/local/sbin
cp rtmpdump.1 /usr/local/man/man1
cp rtmpgw.8 /usr/local/man/man8
make[1]: Entering directory `/home/vagrant/rtmpdump/librtmp'
sed -e "s;@prefix@;/usr/local;" -e "s;@libdir@;/usr/local/lib;" \
-e "s;@VERSION@;v2.4;" \
-e "s;@CRYPTO_REQ@;libssl,libcrypto;" \
-e "s;@PUBLIC_LIBS@;;" \
-e "s;@PRIVATE_LIBS@;;" librtmp.pc.in > librtmp.pc
mkdir -p /usr/local/include/librtmp /usr/local/lib/pkgconfig /usr/local/man/man3 /usr/local/lib
cp amf.h http.h log.h rtmp.h /usr/local/include/librtmp
cp librtmp.a /usr/local/lib
cp librtmp.pc /usr/local/lib/pkgconfig
cp librtmp.3 /usr/local/man/man3
cp librtmp.so.1 /usr/local/lib 库安装到这个目录
cd /usr/local/lib; ln -sf librtmp.so.1 librtmp.so
解决办法:
cd /etc/ld.so.conf.d 增加rtmpdump的依赖lib库的路径
执行
echo "/usr/local/lib/" > rtmpdump-x86_64.conf
执行 ldconfig
再执行
ldd `which rtmpdump`
linux-vdso.so.1 => (0x00007ffd74df5000)
librtmp.so.1 => /usr/local/lib/librtmp.so.1 (0x00007fd3eb6e1000) 有了
libssl.so.10 => /lib64/libssl.so.10 (0x00007fd3eb46f000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007fd3eb00c000)
libz.so.1 => /lib64/libz.so.1 (0x00007fd3eadf6000)
libc.so.6 => /lib64/libc.so.6 (0x00007fd3eaa28000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007fd3ea7db000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007fd3ea4f2000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fd3ea2ee000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007fd3ea0bb000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fd3e9eb7000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd3eb8fd000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007fd3e9ca7000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fd3e9aa3000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fd3e9889000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd3e966d000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fd3e9446000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fd3e91e4000)
再验证
rtmpdump -v
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
ERROR: You must specify a hostname (--host) or url (-r "rtmp://host[:port]/playpath") containing a hostname
ok,解决
阅读(1556) | 评论(0) | 转发(0) |