java手机av_ffmpeg综合应用示例(三)——安卓手机摄像头编码手机av「java手机av_ffmpeg综合应用示例(三)——安卓手机摄像头编码」

   日期:2025-01-19     作者:6omk7       评论:0    移动:http://alvinling88.article.eyameya.com/mobile/news/779.html
核心提示:#include#include#include"libavcodec/avcodec.h"#include"libavformat/avformat.h"#include"libswscale/swscale.h"#include"lib

#include 

#include 

#include "libavcodec/avcodec.h"

#include "libavformat/avformat.h"

#include "libswscale/swscale.h"

#include "libavutil/log.h"

#ifdef ANDROID

#include 

#include 

#define LOGE(format, ...)  __android_log_print(ANDROID_LOG_ERROR, "(>_

#define LOGI(format, ...)  __android_log_print(ANDROID_LOG_INFO,  "(=_=)", format, ##__VA_ARGS__)

#else

#define LOGE(format, ...)  printf("(>_

#define LOGI(format, ...)  printf("(^_^) " format " ", ##__VA_ARGS__)

#endif

AVFormatContext *ofmt_ctx;

AVStream* video_st;

AVCodecContext* pCodecCtx;

AVCodec* pCodec;

AVPacket enc_pkt;

AVFrame *pFrameYUV;

int framecnt = 0;

int yuv_width;

int yuv_height;

int y_length;

int uv_length;

int64_t start_time;

//Output FFmpeg's av_log()

void custom_log(void *ptr, int level, const char* fmt, va_list vl){

FILE *fp=fopen("/storage/emulated/0/av_log.txt","a+");

if(fp){

vfprintf(fp,fmt,vl);

fflush(fp);

fclose(fp);

}

}

JNIEXPORT jint JNICALL Java_com_zhanghui_test_MainActivity_initial

(JNIEnv *env, jobject obj,jint width,jint height)

{

 
特别提示:本信息由相关用户自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。

举报收藏 0打赏 0评论 0
 
更多>同类最新资讯
0相关评论

相关文章
最新文章
推荐文章
推荐图文
最新资讯
点击排行
{
网站首页  |  关于我们  |  联系方式  |  使用协议  |  隐私政策  |  版权隐私  |  网站地图  |  排名推广  |  广告服务  |  积分换礼  |  网站留言  |  RSS订阅  |  违规举报  |  鄂ICP备2020018471号