我試圖編譯PJSIP 2.1在Ubuntu視頻支持編譯PJSIP但在運行時「使」我得到以下錯誤:錯誤在Ubuntu
In file included from ../src/pjmedia/ffmpeg_util.c:26:0:
../src/pjmedia/ffmpeg_util.h:50:12: warning: ‘enum CodecID’ declared inside parameter list [enabled by default]
enum CodecID *codec_id);
^
../src/pjmedia/ffmpeg_util.h:50:12: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
../src/pjmedia/ffmpeg_util.h:53:7: warning: ‘enum CodecID’ declared inside parameter list [enabled by default]
pjmedia_format_id *fmt_id);
^
../src/pjmedia/ffmpeg_util.c:65:18: error: field ‘codec_id’ has incomplete type
enum CodecID codec_id;
^
../src/pjmedia/ffmpeg_util.c:167:13: error: conflicting types for ‘pjmedia_format_id_to_CodecID’
pj_status_t pjmedia_format_id_to_CodecID(pjmedia_format_id fmt_id,
^
In file included from ../src/pjmedia/ffmpeg_util.c:26:0:
../src/pjmedia/ffmpeg_util.h:49:13: note: previous declaration of ‘pjmedia_format_id_to_CodecID’ was here
pj_status_t pjmedia_format_id_to_CodecID(pjmedia_format_id fmt_id,
^
../src/pjmedia/ffmpeg_util.c: In function ‘pjmedia_format_id_to_CodecID’:
../src/pjmedia/ffmpeg_util.c:173:35: warning: comparison between pointer and integer [enabled by default]
if (t->id==fmt_id && t->codec_id != PIX_FMT_NONE) {
^
../src/pjmedia/ffmpeg_util.c:174:6: error: dereferencing pointer to incomplete type
*codec_id = t->codec_id;
^
../src/pjmedia/ffmpeg_util.c:174:6: warning: statement with no effect [-Wunused-value]
../src/pjmedia/ffmpeg_util.c:179:5: error: dereferencing pointer to incomplete type
*codec_id = PIX_FMT_NONE;
^
../src/pjmedia/ffmpeg_util.c:179:5: warning: statement with no effect [-Wunused-value]
../src/pjmedia/ffmpeg_util.c: At top level:
../src/pjmedia/ffmpeg_util.c:183:55: error: parameter 1 (‘codec_id’) has incomplete type
pj_status_t CodecID_to_pjmedia_format_id(enum CodecID codec_id,
^
make[2]: *** [output/pjmedia-i686-pc-linux-gnu/ffmpeg_util.o] Error 1
make[2]: Leaving directory `/home/gboutmy/Downloads/pjproject-2.1.0/pjmedia/build'
make[1]: *** [pjmedia] Error 2
make[1]: Leaving directory `/home/gboutmy/Downloads/pjproject-2.1.0/pjmedia/build'
make: *** [all] Error 1
我已經安裝了所需的依賴和不知道是什麼問題是。閱讀錯誤信息,它看起來像來自PJSIP代碼中的錯誤?
編輯:我根據Getting 「field has incomplete type」 and "conflicting types"改名enum CodecID
到enum AVCodecID
但現在我發現了以下錯誤:
../lib/libpjmedia-codec-i686-pc-linux-gnu.a(ffmpeg_vid_codecs.o): In function `ffmpeg_codec_encode_whole.isra.7':
ffmpeg_vid_codecs.c:(.text+0x1374): undefined reference to `avcodec_encode_video2'
collect2: error: ld returned 1 exit status
make[2]: *** [../bin/pjmedia-test-i686-pc-linux-gnu] Error 1
make[2]: Leaving directory `/home/gboutmy/Downloads/pjproject-2.1.0/pjmedia/build'
make[1]: *** [pjmedia-test] Error 2
make[1]: Leaving directory `/home/gboutmy/Downloads/pjproject-2.1.0/pjmedia/build'
make: *** [all] Error 1
這兩個文件不見了,但在安裝它們似乎並沒有解決問題。我仍然收到相同的錯誤信息。 我編譯了自己的ffmpeg,這可能與問題有關嗎? – noisegrrrl
@Emualynk這是可能的,但從你上次更新,似乎你正在使用一個相當舊的版本,也許是1.x版本?我認爲'avcodec_encode_video2'是在2.X – jcm
中引入的,我從網站上抓取了ffmpeg 2.1.1版本,但是:/ – noisegrrrl