When using the following command to push the stream:
ffmpeg -re -i a.mp4 -vcodec libx264 -acodec aac -f flv rtmp://172.31.102.165:1935/myapp
The following errors may occur:
Unknown encoder 'libx264'
The libx264 library is missing and needs to be installed.
1. gitclonegit://git.videolan.org/x264.git
2. cdx264
3. ./configure –enable-static –enable-share
4. make
5. sudo make install
Need to recompile and install ffmpeg
1. When configuring ffmpeg, add x264, e.g.
./configure –enable-gpl –enable-libx264
2. make clean
3. make
4. make install
At this point, when entering ffmpeg, an error may occur:.
ffmpeg: error while loading shared libraries: libavdevice.so.57: cannot open shared object file: No such file or directory
*****************************************
Modify the ld.so.conf file
1. $ sudo vi /etc/ld.so.conf
2. Modify the following
include ld.so.conf.d/*.conf
/usr/local/ffmpeg/lib ///usr/local/ffmpeg directory is my ffmpeg installation directory, change it according to your installation directory
3. make it work
$ sudo ldconfig
*****************************************
Add environment variables for Ffmpeg
vi /etc/profile
Add:
export PATH=”/usr/local/ffmpeg/bin:$PATH”
Then save and run source /etc/profile
If you are still prompted for missing libx264, you need to go into the compile ffmpeg directory and use the following command to push the stream.
./ffmpeg -re -i a.mp4 -vcodec libx264 -acodec aac -f flv rtmp://172.31.102.165:1935/myapp
Similar Posts:
- No module named _tkinter, please install the python-tk package solution summary
- Basic Xlib functionality test failed [How to Solve]
- zlib.h:no such file or directory
- [How to Solve] gcc-4.7.2 cannot compute suffix of object fil…
- [Solved] python AudioSegment Read mp3 files Error: Python AudioSegment winError 2 The system cannot find the file specified
- Ubuntu Error: libcublas.so.8.0 [How to Solve]
- [Solved] php -v Error: error while loading shared libraries: libonig.so.5:cannot open share directory
- About configure error APR not found. And exports. C: error_ hack_ apu_ Solution to the problem of redefining version ‘
- [Solved] Autosub error: ffmpeg: Executable not found on machine.
- [Solved] libgtk-3.so.0 or libXt.so.6: cannot open shared object file: No such file or directory