1. Problem description
- When using ffmpeg to download video through url, the following error occurs:
os.system("ffmpeg -i \"{}\" -q 2 {}".format(cur_url, sv_path)) # 下载视频 -q2为原始
2. Problem Analysis
- It can be judged from the prompt information that the download failure is related to openssl, so related configuration is required;
- At the same time, ffmpeg needs to be reinstalled;
3. Problem solving
2.1 Install and open openssl
apt install openssh-server
server ssh start
server ssh status
2.2 ffmpeg for openssl related configuration and installation
1. When specifying the ffmpeg installation path, bring –enable-openssl
cd ffmpeg-3.4.9
./configure --enable-shared --enable-openssl --prefix=/usr/local/ffmpeg
2. If you are ubuntu, please make sure libssl-dev is installed
sudo apt-get install libssl-dev
3. Installation
make
make install
4. Dynamic link library
Open the configuration file with vi
vi /etc/ld.so.conf
Add the following:
/usr/local/ffmpeg/lib
Save and exit vim, then execute:
ldconfig
5. Add environment variables for ffmpeg
First open the configuration file:
vi /etc/profile
Add the environment variable PATH at the end of the file:
export PATH=$PATH:/usr/local/ffmpeg/bin
save and exit vim
Note; if you already have export PATH=$PATH:/usr/local/ffmpeg/bin, you don’t need to add it repeatedly.
6. Make the modification take effect immediately
source /etc/profile
7. Check version
ffmpeg -version
The version shows:
references
- https://blog.csdn.net/wjinjie/article/details/125876247
- http://cn.voidcc.com/question/p-wleojnwt-ph.html