美文网首页
FFmpeg开发笔记(十一):ffmpeg在移植到海思HI35x

FFmpeg开发笔记(十一):ffmpeg在移植到海思HI35x

作者: 红模仿_红胖子 | 来源:发表于2022-03-14 11:33 被阅读0次

    前言

      上一篇交叉编译了ffmpeg的海思版本,使用交叉编译的qt的ffmpeg播放器在海思上播放,本片是将ffmpeg的环境添加进海思的sample环境中。

    在海思sample中引入ffmpeg库

    步骤一:查看之前交叉编译的安装文件

    步骤二:打开编译的参数文件,添加头文件和库文件

    ##### add by yangjiong 2022-03-12 startINC_FLAGS +=-I/home/yang/work/ffmpeg-hi3559av100/includeMPI_LIBS +=/home/yang/work/ffmpeg-hi3559av100/lib/libavcodec.aMPI_LIBS +=/home/yang/work/ffmpeg-hi3559av100/lib/libavdevice.aMPI_LIBS +=/home/yang/work/ffmpeg-hi3559av100/lib/libavfilter.aMPI_LIBS +=/home/yang/work/ffmpeg-hi3559av100/lib/libavformat.aMPI_LIBS +=/home/yang/work/ffmpeg-hi3559av100/lib/libavutil.aMPI_LIBS +=/home/yang/work/ffmpeg-hi3559av100/lib/libswresample.aMPI_LIBS +=/home/yang/work/ffmpeg-hi3559av100/lib/libswscale.a##### add by yangjiong 2022-03-12 stop

    如下图:

    步骤三:在venc另起sample添加ffmpeg测试

    (注意海思的sample子目录下,文件夹只能有一个main函数,也就是说会把子文件夹中所有的头文件和源文件当作一个应用联合编译。)

    将原来的.c的改一下后缀.bak,然后重新建立一个c文件。

    步骤四:将目标应用在板子上跑

    (注意:需要先将库加入到运行环境中,最简单的方式就是直接copy之前的库,将lib放到海思系统的/lib文件目录下,也可以自定义路径,运行时使用脚本先加入路径然后跑应用,方法很多,条条大路通罗马)。

    在HI3559AV100运行结果如下:

    Demo源码

    #ifdef__cplusplus#if__cplusplusextern"C"{#endif#endif/* End of #ifdef __cplusplus */#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<pthread.h>#include<signal.h>#include<sys/socket.h>#include<sys/un.h>#include<unistd.h>#include<netinet/in.h>#include<arpa/inet.h>#include<sys/types.h>#include"sample_comm.h"// ffmepg#include<libavcodec/avcodec.h>#include<libavformat/avformat.h>#include<libswscale/swscale.h>#include<libavdevice/avdevice.h>#include<libavformat/version.h>#include<libavutil/time.h>#include<libavutil/mathematics.h>#defineLOG printf("%s:%d\n", __FILE__, __LINE__);intmain(intargc,char*argv[]){printf("%s\n",avcodec_configuration());return0;}#ifdef__cplusplus#if__cplusplus}#endif#endif/* End of #ifdef __cplusplus */

    相关文章

      网友评论

          本文标题:FFmpeg开发笔记(十一):ffmpeg在移植到海思HI35x

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