Dragon  
Dragon
日历
<2010年8月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234
统计
  • 随笔 - 58
  • 文章 - 0
  • 评论 - 55
  • 引用 - 0

导航

常用链接

留言簿(3)

随笔分类(58)

随笔档案(58)

搜索

  •  

最新评论

阅读排行榜

评论排行榜

 

 

将里面的ffmpegSDLbin三个文件夹COPY到工程文件夹下,然后配置好includelib的设置,这里有用的文件夹只有ffmpeg,后面两个还没用到。

设置好后,再将ffmpeg4mobile里的portab.h复制到工程文件下,在使用ffmpeg的头文件之前要包含这个头文件,不然会很多个错误,然后就可以用了。

这里要注意一下,在解码MPEG4时找不到以下三个函数的:

avpicture_get_size

avpicture_fill

img_convert

后来看到以下文章就解决前面两个函数的问题:

http://hi.baidu.com/mikenoodle/blog/item/81700bf3153af4c00b46e01f.html

int numBytes=avpicture_get_size(PIX_FMT_RGB24, g_pCodecCtx->width,g_pCodecCtx->height);

替换为

int numBytes=g_pCodecCtx->width*g_pCodecCtx->height*3;

 

 

 

avpicture_fill((AVPicture *)g_pFrameRGB, buffer, PIX_FMT_RGB24,g_pCodecCtx->width, g_pCodecCtx->height);

替换为

((AVPicture *)g_pFrameRGB)->linesize[0]=g_pCodecCtx->width*3;
((AVPicture 
*)g_pFrameRGB)->data[0]=buffer;

 

至于第三个应该是过时的,已经被另一个函数代替掉了详细如下:

http://ianccani.tistory.com/27

FFMPEG video frame decode YUV420p decode ,
Win32 RGB24 .

yuv420p_to_rgb24  img_convert() ,
FFMPEG Compile --enable-swscale , sws_scale() .

# img_convert()

img_convert ( (AVPicture *)frameRGB, PIX_FMT_RGB24, (AVPicture*)frame,is->video_st->codec->pix_fmt, is->video_st->codec->width, is->video_st->codec->height);


# sws_getContext(), sws_scale()

static struct SwsContext *img_convert_ctx;
 img_convert_ctx 
= sws_getContext (is->video_st->codec->width,
                          
is->video_st->codec->height, is->video_st->codec->pix_fmt,
                          
is->video_st->codec->width, is->video_st->codec->height,
                          PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL);
sws_scale (img_convert_ctx, frame
->data, frame->linesize,0is->video_st->codec->height, frameRGB->data, frameRGB->linesize);

 

 

posted on 2010-08-19 18:08 Dragon 阅读(1209) 评论(0)  编辑 收藏 引用 所属分类: FFMPEG

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


 
Copyright © Dragon Powered by: 博客园 模板提供:沪江博客