• ffmpeg中examples编译报不兼容错误解决办法


    ffmpeg中examples编译报不兼容错误解决办法

    参考examples下的README可知,编译之前需要设置 PKG_CONFIG_PATH路径。

    export PKG_CONFIG_PATH=/home/user/work/ffmpeg/ffmpeg/_install_uclibc/lib/pkgconfig
    
    • 1

    之后执行make出现如下错误:
    在这里插入图片描述
    基本都是由于库的版本和编译时候的二进制.o文件位数不匹配造成的。

    可以使用命令查看.so和examples中.o文件详情:

    user:~/work/ffmpeg/ffmpeg/_install_uclibc/share/ffmpeg/examples$ file -L /home/user/work/ffmpeg/ffmpeg/_install_uclibc/lib/libavdevice.so
    /home/user/work/ffmpeg/ffmpeg/_install_uclibc/lib/libavdevice.so: ELF 32-bit LSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, stripped
    user:~/work/ffmpeg/ffmpeg/_install_uclibc/share/ffmpeg/examples$ file avio_dir_cmd.o
    avio_dir_cmd.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
    
    • 1
    • 2
    • 3
    • 4

    其中动态库是32位mips编译的,而程序二进制是x86-64下的。
    解决办法:
    设置CC和CXX编译工具链即可。
    例如:

    export CC=XXXXXXXX
    export CXX=xxxxxxxxxxxx
    
    • 1
    • 2

    与动态库的保持一致就可以了。

    user:~/work/ffmpeg/ffmpeg/_install_uclibc/share/ffmpeg/examples$ ls
    avio_dir_cmd    decode_audio    demuxing_decoding    encode_video    filter_audio.c     filtering_video.o   hw_decode.o  muxing.c    remuxing.o          scaling_video.o  transcoding.o
    avio_dir_cmd.c  decode_audio.c  demuxing_decoding.c  encode_video.c  filtering_audio    http_multiclient    Makefile     muxing.o    resampling_audio    transcode_aac    vaapi_encode.c
    avio_dir_cmd.o  decode_audio.o  demuxing_decoding.o  encode_video.o  filtering_audio.c  http_multiclient.c  metadata     qsvdec.c    resampling_audio.c  transcode_aac.c  vaapi_transcode.c
    avio_reading    decode_video    encode_audio         extract_mvs     filtering_audio.o  http_multiclient.o  metadata.c   README      resampling_audio.o  transcode_aac.o
    avio_reading.c  decode_video.c  encode_audio.c       extract_mvs.c   filtering_video    hw_decode           metadata.o   remuxing    scaling_video       transcoding
    avio_reading.o  decode_video.o  encode_audio.o       extract_mvs.o   filtering_video.c  hw_decode.c         muxing       remuxing.c  scaling_video.c     transcoding.c
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    ——————————————————————————————————
    有说错的或者需要补充的欢迎大家留言。

  • 相关阅读:
    没有经验能成为产品经理吗?
    Redis 的发布和订阅
    如何用python搭建神经网络,python实现人工神经网络
    河道水文标尺识别系统
    STL容器——vector
    JUC笔记(二) --- Java线程
    网易数帆:云原生向左,低代码向右
    SPSS学习
    【LeetCode】每日一题 2023_11_7 统计范围内的元音字符串数
    SAP S4 BC 关于ABAP write 方式展示的清单 导出excel的问题
  • 原文地址:https://blog.csdn.net/weixin_43615992/article/details/134080793