免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1999 | 回复: 0
打印 上一主题 下一主题

[其他] 用avilib封装avi文件,为什么播放不了,都是黑的! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-07-23 10:59 |只看该作者 |倒序浏览
avi_t* avi= AVI_open_output_file("test.avi");
AVI_set_video(avi, 736, 576, 25, "H264");
AVI_write_frame(avi,  (char*)Buffer_getUserPtr(hOutBuf),  (long)Buffer_getNumBytesUsed(hOutBuf),1)
hOutBuf为硬件编码出来的帧buffer 结构如下
typedef struct _Buffer_Object {
    Buffer_Type             type;
    _Buffer_State           origState;
    _Buffer_State           usedState;
    Memory_AllocParams      memParams;
    Int8                   *userPtr;
    Int32                   physPtr;
    Int                     id;
    Bool                    reference;
    BufTab_Handle           hBufTab;
    Int32                   virtualBufferSize;
} _Buffer_Object;

这个帧BUFF是硬件编码器编码出来的帧,是不是要经过处理才能写进去?对这个不很懂,求解!
avilib库在附件!

用ffplay播放 显示一下error log:
ffplay version 1.2 Copyright (c) 2003-2013 the FFmpeg developers
  built on Jul 23 2013 10:42:25 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
  configuration: --enable-shared --prefix=/usr/local/ffmpeg/ --disable-yasm
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
[avi @ 0x9e78b60] max_analyze_duration 5000000 reached at 5000000 microseconds
[avi @ 0x9e78b60] decoding for stream 0 failed
[avi @ 0x9e78b60] Could not find codec parameters for stream 0 (Video: mpeg2video (MPEG / 0x4745504D), 736x576): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
test.avi: could not find codec parameters
    nan A-V:  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP