美文网首页
iOS 编译IJKMediaFramework时遇到的问题

iOS 编译IJKMediaFramework时遇到的问题

作者: liang1030 | 来源:发表于2024-08-18 15:08 被阅读0次

1,执行命令 ./compile-ffmpeg.sh all时报错:

libavcodec/aarch64/h264dsp_init_aarch64.c:84:38: error: incompatible function pointer types assigning to 'h264_weight_func' (aka 'void (*)(unsigned char *, long, int, int, int, int)') from 'void (uint8_t *, int, int, int, int, int)' (aka 'void (unsigned char *, int, int, int, int, int)') [-Wincompatible-function-pointer-types]
c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;

13691724034941_.pic.jpg

解决办法:

找到do-compile-ffmpeg.sh 这个文件,改为以下内容:

#FFMPEG_CFLAGS=
#FFMPEG_CFLAGS="$FFMPEG_CFLAGS -arch $FF_ARCH"
#FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCRUN_OSVERSION"
#FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FFMPEG_EXTRA_CFLAGS"
#FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCODE_BITCODE"
#FFMPEG_LDFLAGS="$FFMPEG_CFLAGS"

FFMPEG_CFLAGS=
FFMPEG_CFLAGS="$FFMPEG_CFLAGS -arch $FF_ARCH"
FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCRUN_OSVERSION"
FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FFMPEG_EXTRA_CFLAGS"
FFMPEG_CFLAGS="$FFMPEG_CFLAGS $FF_XCODE_BITCODE"
FFMPEG_CFLAGS="$FFMPEG_CFLAGS -Wno-error=incompatible-function-pointer-types" # 加上这个就能编译过了
FFMPEG_LDFLAGS="$FFMPEG_CFLAGS"
FFMPEG_DEP_LIBS=

然后依次执行以下命令:

cd ios
./compile-ffmpeg.sh clean
./compile-openssl.sh clean
./compile-openssl.sh all
./compile-ffmpeg.sh all

2,执行命令 ./compile-ffmpeg.sh all时报错:
ERROR: openssl not found

解决:

需要 ./init-ios.sh步骤后执行

./init-ios-openssl.sh
cd ios
./compile-ffmpeg.sh clean
./compile-openssl.sh clean
./compile-openssl.sh all
./compile-ffmpeg.sh all

制作IJKMediaFramework参考链接:
https://www.jianshu.com/p/2ab3941741c6
https://zhuanlan.zhihu.com/p/609100238

遇到的问题参考链接:
https://github.com/bilibili/ijkplayer/issues/5589
https://www.jianshu.com/p/5c54e134a1a3
https://www.jianshu.com/p/4170a9848ca5

相关文章

网友评论

      本文标题:iOS 编译IJKMediaFramework时遇到的问题

      本文链接:https://www.haomeiwen.com/subject/wyppkjtx.html