问题现象:
making all mod_av
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av'
CC libavmod_la-mod_av.lo
CC libavmod_la-avformat.lo
avformat.c:42:32: fatal error: libswscale/swscale.h: No such file or directory
#include
^
compilation terminated.
解决方法:
apt-get install libswscale-dev
# 重新检测、编译、安装
问题现象:
making all mod_av
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av'
CC libavmod_la-avformat.lo
avformat.c:44:38: fatal error: libavresample/avresample.h: No such file or directory
#include
^
compilation terminated.
解决方法:
apt-get install libavresample-dev
# 重新检测、编译、安装
问题现象:
making all mod_av
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av'
CC libavmod_la-mod_av.lo
CC libavmod_la-avformat.lo
avformat.c: In function 'write_frame':
avformat.c:403:2: error: implicit declaration of function 'av_packet_rescale_ts' [-Werror=implicit-function-declaration]
av_packet_rescale_ts(pkt, *time_base, st->time_base);
^
avformat.c: In function 'alloc_picture':
avformat.c:617:2: error: implicit declaration of function 'av_frame_alloc' [-Werror=implicit-function-declaration]
picture = av_frame_alloc();
^
avformat.c:617:10: error: assignment makes pointer from integer without a cast [-Werror]
picture = av_frame_alloc();
^
avformat.c:625:2: error: implicit declaration of function 'av_frame_get_buffer' [-Werror=implicit-function-declaration]
ret = av_frame_get_buffer(picture, 32);
^
avformat.c: In function 'open_audio':
avformat.c:689:13: error: assignment makes pointer from integer without a cast [-Werror]
mst->frame = av_frame_alloc();
^
avformat.c:740:18: error: assignment makes pointer from integer without a cast [-Werror]
mst->tmp_frame = av_frame_alloc();
^
avformat.c: In function 'video_thread_run':
avformat.c:848:4: error: implicit declaration of function 'av_frame_make_writable' [-Werror=implicit-function-declaration]
ret = av_frame_make_writable(context->eh.video_st->frame);
^
avformat.c:925:4: error: implicit declaration of function 'av_packet_unref' [-Werror=implicit-function-declaration]
av_packet_unref(&pkt);
^
avformat.c: In function 'close_stream':
avformat.c:978:2: error: implicit declaration of function 'av_frame_free' [-Werror=implicit-function-declaration]
if (mst->frame) av_frame_free(&mst->frame);
^
avformat.c: In function 'show_formats':
avformat.c:1030:3: error: passing argument 1 of 'av_oformat_next' discards 'const' qualifier from pointer target type [-Werror]
while ((ofmt = av_oformat_next(ofmt))) {
^
In file included from avformat.c:37:0:
/usr/include/libavformat/avformat.h:1118:17: note: expected 'struct AVOutputFormat *' but argument is of type 'const struct AVOutputFormat *'
AVOutputFormat *av_oformat_next(AVOutputFormat *f);
^
avformat.c:1048:3: error: passing argument 1 of 'av_iformat_next' discards 'const' qualifier from pointer target type [-Werror]
while ((ifmt = av_iformat_next(ifmt))) {
^
In file included from avformat.c:37:0:
/usr/include/libavformat/avformat.h:1111:17: note: expected 'struct AVInputFormat *' but argument is of type 'const struct AVInputFormat *'
AVInputFormat *av_iformat_next(AVInputFormat *f);
^
avformat.c: In function 'open_input_file':
avformat.c:1145:5: error: implicit declaration of function 'av_rescale_q' [-Werror=implicit-function-declaration]
handle->duration = av_rescale_q(context->video_st.st->duration != AV_NOPTS_VALUE ? context->video_st.st->duration : context->fc->duration / AV_TIME_BASE * 1000,
^
avformat.c:1212:30: error: assignment makes pointer from integer without a cast [-Werror]
context->audio_st[0].frame = av_frame_alloc();
^
avformat.c:1218:31: error: assignment makes pointer from integer without a cast [-Werror]
context->audio_st[1].frame = av_frame_alloc();
^
avformat.c: In function 'file_read_thread_run':
avformat.c:1396:11: error: assignment makes pointer from integer without a cast [-Werror]
vframe = av_frame_alloc();
^
avformat.c:1445:13: error: assignment makes pointer from integer without a cast [-Werror]
vframe = av_frame_alloc();
^
avformat.c:1538:6: error: implicit declaration of function 'avresample_get_out_samples' [-Werror=implicit-function-declaration]
int out_samples = swr_get_out_samples(context->audio_st[0].resample_ctx, in_frame.nb_samples);
^
cc1: all warnings being treated as errors
make[4]: *** [libavmod_la-avformat.lo] Error 1
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av'
make[3]: *** [mod_av-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解决方法:
vim /usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_av/Makefile
# 修改该行,删掉“-Werror”即可
661 SWITCH_AM_CFLAGS = -I/usr/include/uuid -I/usr/local/src/freeswitch-1.10-git/freeswitch/src/include -I/usr/local/src/freeswitch-1.10-git/freeswitch/src/include - I/usr/local/src/freeswitch-1.10-git/freeswitch/libs/libteletone/src -fPIC -ffast-math -Werror -Wno-unused-result -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DC JSON_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb -DHAVE_OPENSSL
# 如下所示
661 SWITCH_AM_CFLAGS = -I/usr/include/uuid -I/usr/local/src/freeswitch-1.10-git/freeswitch/src/include -I/usr/local/src/freeswitch-1.10-git/freeswitch/src/include - I/usr/local/src/freeswitch-1.10-git/freeswitch/libs/libteletone/src -fPIC -ffast-math -Wno-unused-result -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DCJSON_AP I_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb -DHAVE_OPENSSL
# 重新检测、编译、安装
参考资料:
https://blog.csdn.net/zhou_qiao62/article/details/80449478
问题现象:
making all mod_lua
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/languages/mod_lua'
Making all in .
make[5]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/languages/mod_lua'
CXX mod_lua_la-mod_lua.lo
mod_lua.cpp:37:17: fatal error: lua.h: No such file or directory
#include "lua.h"
^
compilation terminated.
解决方法:
apt-get install libreadline-dev
# 此处需要源码安装,apt-get 安装的不知道为什么不能解决问题
tar -xf lua-5.3.0a.tar.gz
cd lua-5.3.0/
make linux test
make install
# 重新检测、编译、安装
参考资料:
https://www.cnblogs.com/softidea/archive/2016/03/02/5236498.html
问题现象:
making all mod_opus
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/codecs/mod_opus'
Makefile:924: *** You must install libopus-dev to build mod_opus. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/codecs/mod_opus'
make[3]: *** [mod_opus-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解决方法:
apt-get install libopus-dev
问题现象:
making all mod_pgsql
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/databases/mod_pgsql'
Makefile:922: *** You must install libpq-dev to build mod_pgsql. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/databases/mod_pgsql'
make[3]: *** [mod_pgsql-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解决方法:
apt-get install libpq-dev
问题现象:
making all mod_signalwire
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_signalwire'
Makefile:932: *** You must install libks to build mod_signalwire. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_signalwire'
make[3]: *** [mod_signalwire-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解决方法:
tar -xf cmake-3.17.2.tar.gz
cd cmake-3.17.2
./configure
make && make install
cp bin/cmake /usr/bin/
cmake --version
cd ../
git clone https://github.com/signalwire/libks.git
cd libks/
cmake .
make && make install
root@bjphp2:/usr/local/src/libks#
问题现象:
making all mod_signalwire
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_signalwire'
Makefile:927: *** You must install signalwire-client-c to build mod_signalwire. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/applications/mod_signalwire'
make[3]: *** [mod_signalwire-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch'
make: *** [all] Error 2
解决方法:
git clone https://github.com/signalwire/signalwire-c.git
cd signalwire-c/
cmake .
make && make install
问题现象:
making all mod_sndfile
make[4]: Entering directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/formats/mod_sndfile'
Makefile:926: *** You must install libsndfile-dev to build mod_sndfile. Stop.
make[4]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod/formats/mod_sndfile'
make[3]: *** [mod_sndfile-all] Error 1
make[3]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src/mod'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/freeswitch-1.10-git/freeswitch/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving director
解决方法:
apt-get install libsndfile1-dev libpq-dev libreadline-dev lua5.2 lua5.2-doc liblua5.2-dev libtiff5 libtiff5-dev
问题现象:
load mod_av
+OK Reloading XML
-ERR [module load file routine returned an error]
2020-05-09 10:28:49.199849 [CRIT] switch_loadable_module.c:1786 Error Loading module /usr/lib/freeswitch/mod/mod_av.so
**/usr/lib/freeswitch/mod/mod_av.so: undefined symbol: sws_getContext**
解决方法:
wget https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20170217-2245-stable.tar.bz2
tar -jxvf x264-snapshot-20170217-2245-stable.tar.bz2
cd x264-snapshot-20170217-2245-stable
./configure --prefix=/usr --enable-debug --enable-pic --enable-shared
make -j4
make install
git clone https://freeswitch.org/stash/scm/sd/libav.git
cd libav
patch -p1 < 0001-Fix-linking-errors-when-VC1-parser-is-enabled-and-VC.patch
PKG_CONFIG_PATH="/usr/lib/pkgconfig" ./configure --prefix=/usr --extra-libs=-lpthread --extra-libs=-lm --enable-shared --enable-gpl --enable-libx264
make -j4
make install
On Freeswitch
PKG_CONFIG_PATH="/usr/lib/pkgconfig" ./configure --enable-portable-binary
--prefix=/usr --localstatedir=/var --sysconfdir=/etc
--with-gnu-ld --with-python --with-erlang --with-openssl
--enable-core-odbc-support --enable-zrtp
freeswitch@ubuntu> load mod_av