When you use the following command to push a stream:
Ffmpeg-re-i a.mp4-vcodec libx264-acodec aac-f flv rtmp://172.31.102.165:1935/myapp
The following error may occur:
Unknown encoder ' libx264 '
That is, the library needs to be installed if the libx264 library is missing:
1. Git clone git://git.videolan.org/x264.git
2. CD x264
3../configure--enable-static--enable-share
4. Make
5. Sudo make install
Need to recompile installation FFmpeg
1. When configuring FFmpeg, add x264, such as:
./configure--ENABLE-GPL--enable-libx264
2. Make clean
3. Make
4. Make install
At this point, an error may occur when you enter FFmpeg:
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. Making it effective
$ sudo ldconfig
*****************************************
Adding environment variables for Ffmpeg
Vi/etc/profile
Add the following content:
Export path= "/usr/local/ffmpeg/bin: $PATH"
Then save and run Source/etc/profile
FFmpeg push Stream, error may occur: Unknown encoder ' libx264 '