Implementation method of installing python librtmp package under linux system

  • 2021-07-24 11:11:41
  • OfStack

There are many dependencies to install librtmp package. python version 2.7 has been installed on the machine, and the dependencies need to be installed before installing librtmp package.

1. Install gcc and dependency packages


 yum install gcc* python-devel libffi-dev* -y 

2. Install librtmp

Download the source code from git:


git clone git://git.ffmpeg.org/rtmpdump

cd rtmpdump/librtmp/

make && make install

3. Install setuptools


wget -S https://pypi.python.org/packages/f7/83/2865ee5727b46234c68efb833363dbce1922a191dd46e246853246a46182/setuptools-24.0.2.zip#md5=b7e888eb6867d94ecaf1af7a26a56c72

unzip setuptools-24.0.2.zip

cd setuptools-24.0.2

python setup.py install

4. Install cffi


wget -S https://pypi.python.org/packages/83/3c/00b553fd05ae32f27b3637f705c413c4ce71290aa9b4c4764df694e906d9/cffi-1.7.0.tar.gz#md5=34122a545060cee58bab88feab57006d

tar -zxvf cffi-1.7.0.tar.gz

git clone git://git.ffmpeg.org/rtmpdump
0

git clone git://git.ffmpeg.org/rtmpdump
1

5. Install librtmp


git clone git://git.ffmpeg.org/rtmpdump
2

tar -zxvf python-librtmp-0.3.0.tar.gz

git clone git://git.ffmpeg.org/rtmpdump
4

git clone git://git.ffmpeg.org/rtmpdump
5

6. Verify that the installation is successful

Enter the python command character, import librtmp, and report an error:


git clone git://git.ffmpeg.org/rtmpdump
6

Solution: Find the path of librtmp. so.1 and copy it to the directory of lib64;


git clone git://git.ffmpeg.org/rtmpdump
7

cp /usr/local/lib/librtmp.so.1 /usr/lib64/

Enter python command character again, import librtmp, no error reported, librtmp package installed successfully!


Related articles: