tiny4412 移植ffmpeg 不适用命令行,使用C代码方式压缩视频
来源:互联网 发布:网络职业推手公司 编辑:程序博客网 时间:2024/06/06 16:46
1.ubuntu 16.04 编译x264
./configure --host=arm-linux --prefix=/x264-asm --enable-shared --disable-asm
编辑config.mak
CC=arm-linux-gccCFLAGS=-Wshadow -O3 -fno-fast-math -Wall -I. -std=gnu99 -fPIC -fomit-frame-pointer -fno-tree-vectorizeDEPMM=-MM -g0DEPMT=-MTLD=arm-linux-gcc -oLDFLAGS= -lm -lpthreadLIBX264=libx264.aAR=arm-linux-ar rcRANLIB=arm-linux-ranlibSTRIP=stripAS=ASFLAGS= -DPIC -DBIT_DEPTH=8make
make install
下载地址
http://download.csdn.net/download/aexisun/10135414
http://download.csdn.net/download/aexisun/10135418
2.ubuntu 16.04 编译ffmpeg
./configure --cross-prefix=arm-linux- --enable-cross-compile --target-os=linux --cc=arm-linux-gcc --arch=arm --prefix=/ffmpeg-4412 --enable-shared --disable-static --enable-gpl --enable-nonfree --enable-libx264 --enable-ffmpeg --disable-ffplay --enable-ffserver --enable-swscale --enable-pthreads --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-stripping --extra-cflags=-I/x264-4412/include --extra-ldflags=-L/x264-4412/lib
make
make install
下载
http://download.csdn.net/download/aexisun/10135443
3.测试ffmpeg
ffmpeg -s 1280*720 -pix_fmt yuv422 -i cam.yuv -vcodec mpeg4 output.avi
4.移植文件到目标板
全部拷贝下
ffmpeg-4412/bin/*
ffmpeg-4412/lib/*
ffmpeg-4412/include/*
x264-4412/lib/*
x264-4412/include/*
到4412开发板根目录下的lib include
5.移植文件到交叉工具链里
全部拷贝下
ffmpeg-4412/lib/*
ffmpeg-4412/include/*
x264-4412/lib/*
x264-4412/include/*
到 ubuntu /opt/FriendlyARM/toolschain/4.5.1/arm-none-linux-gnueabi目录下的lib include
6成功编译
arm-linux-gcc ff.c -o ff -lavcodec -lavdevice -lavfilter -lavformat -lavutil
ff.c
#include <stdio.h> #define __STDC_CONSTANT_MACROS #ifdef __cplusplus extern "C" { #endif #include "libavcodec/avcodec.h"#include "libavformat/avformat.h"#include "libavfilter/avfilter.h"#ifdef __cplusplus }; #endif // arm-linux-gcc ff.c -o ff -lavcodec -lavdevice -lavfilter -lavformat -lavutil /** * AVFormat Support Information */ char * avformatinfo(){ char *info=(char *)malloc(40000); memset(info,0,40000); av_register_all(); AVInputFormat *if_temp = av_iformat_next(NULL); AVOutputFormat *of_temp = av_oformat_next(NULL); //Input while(if_temp!=NULL){ sprintf(info, "%s[In ] %10s\n", info, if_temp->name); if_temp=if_temp->next; } //Output while (of_temp != NULL){ sprintf(info, "%s[Out] %10s\n", info, of_temp->name); of_temp = of_temp->next; } return info; } /** * AVCodec Support Information */ char * avcodecinfo() { char *info=(char *)malloc(40000); memset(info,0,40000); av_register_all(); AVCodec *c_temp = av_codec_next(NULL); while(c_temp!=NULL){ if (c_temp->decode!=NULL){ sprintf(info, "%s[Dec]", info); } else{ sprintf(info, "%s[Enc]", info); } switch (c_temp->type){ case AVMEDIA_TYPE_VIDEO: sprintf(info, "%s[Video]", info); break; case AVMEDIA_TYPE_AUDIO: sprintf(info, "%s[Audio]", info); break; default: sprintf(info, "%s[Other]", info); break; } sprintf(info, "%s %10s\n", info, c_temp->name); c_temp=c_temp->next; } return info; } /** * AVFilter Support Information */ char * avfilterinfo() { char *info=(char *)malloc(40000); memset(info,0,40000); avfilter_register_all(); AVFilter *f_temp = (AVFilter *)avfilter_next(NULL); while (f_temp != NULL){ sprintf(info, "%s[%15s]\n", info, f_temp->name); f_temp=f_temp->next; } return info; } /** * Configuration Information */ char * configurationinfo() { char *info=(char *)malloc(40000); memset(info,0,40000); av_register_all(); sprintf(info, "%s\n", avcodec_configuration()); return info; } int main(int argc, char* argv[]) { char *infostr=NULL; infostr=configurationinfo(); printf("\n<<Configuration>>\n%s",infostr); free(infostr); infostr=avformatinfo(); printf("\n<<AVFormat>>\n%s",infostr); free(infostr); infostr=avcodecinfo(); printf("\n<<AVCodec>>\n%s",infostr); free(infostr); infostr=avfilterinfo(); printf("\n<<AVFilter>>\n%s",infostr); free(infostr); return 0; }
- tiny4412 移植ffmpeg 不适用命令行,使用C代码方式压缩视频
- FFMPEG库压缩视频
- FFmpeg压缩MP4视频
- ffmpeg无压缩视频
- 怎样用ffmpeg 压缩视频
- FFMPEG音视频开发笔记(1)FFMPEG简介及FFMPEG命令行工具的使用
- 使用FFmpeg将多幅图像压缩为H264视频流
- ffmpeg命令行批量转换视频
- ffmpeg 命令行视频编解码
- ffmpeg命令行批量转换视频
- c中不适用任何算法,就能使用map
- FFmpeg 视频旋转和压缩
- Ffmpeg视频截图代码
- ffmpeg使用命令行收集
- HBase适用&不使用情形
- Java代码使用ffmpeg视频按帧存储
- 【Tiny4412--2】Uboot移植
- 使用FFMPEG合并视频
- 解决SpringBoot框架下利用jdbcTemplate插入mysql数据库中文乱码问题
- sql判断一个表是否存在 以及表中的字段是否存在
- test
- 上海大数据高峰论坛—暨OurwayBI新品发布会即将开启!
- 解决Error:(3) Error: "app_name" is not translated in "zh" (Chinese) [MissingTranslation]
- tiny4412 移植ffmpeg 不适用命令行,使用C代码方式压缩视频
- 插入排序和希尔排序(Java实现)
- 阿里云RDS新建数据库与导入
- 关于Android之WebView加载网页缓存和清除问题
- huigu
- PG10的函数比PG9.6变化不少
- tar中的参数 cvf,xvf,cvzf,zxvf的区别
- mac 终端中添加tree命令显示文件目录结构
- python多进程笔记2