码迷,mamicode.com
首页 > 其他好文 > 详细

FFmpeg extradata问题描述

时间:2018-01-06 16:38:08      阅读:1600      评论:0      收藏:0      [点我收藏+]

标签:拷贝   form   buffer   rect   pack   idc   unsigned   tco   emc   

场景描述

            手动添加SPS/PPS信息到AVFormatContext

unsigned char sps_pps[] = { 0x00 ,0x00 ,0x01,0x67,0x42,0x00 ,0x2a ,0x96 ,0x35 ,0x40 ,0xf0 ,0x04 ,0x4f ,0xcb ,0x37 ,0x01 ,0x01 ,0x01 ,0x40 ,0x00 ,0x01 ,0xc2 ,0x00 ,0x00 ,0x57 ,0xe4 ,0x01 ,0x00 ,0x00 ,0x00 ,0x01 ,0x68 ,0xce ,0x3c ,0x80, 0x00};
pFormatContext->streams[0]->codecpar->extradata_size = sizeof(sps_pps);
pFormatContext->streams[0]->codecpar->extradata = (uint8_t*)av_mallocz(pFormatContext->streams[0]->codecpar->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
memcpy(pFormatContext->streams[0]->codecpar->extradata, sps_pps, sizeof(sps_pps));


通过avcodec_parameters_to_context将信息从pFormatContext->streams[0]->codecpar拷贝到m_pAVCodecContext

av_read_frame(pVideo->m_pAVFormatContext)分帧

avcodec_send_packet(m_pAVCodecContext)解码


出错异常如下

I:2018-01-06 14:26:03 ms:366:deprecated pixel format used, make sure you did set range correctly
I:2018-01-06 14:26:03 ms:387:unknown SEI type 229
I:2018-01-06 14:26:03 ms:387:unknown SEI type 128
I:2018-01-06 14:26:03 ms:390:nal_unit_type: 7, nal_ref_idc: 3
I:2018-01-06 14:26:03 ms:391:nal_unit_type: 8, nal_ref_idc: 3
I:2018-01-06 14:26:03 ms:392:nal_unit_type: 6, nal_ref_idc: 0
I:2018-01-06 14:26:03 ms:393:nal_unit_type: 5, nal_ref_idc: 3
I:2018-01-06 14:26:03 ms:393:unknown SEI type 229
I:2018-01-06 14:26:03 ms:393:Reinit context to 1920x1088, pix_fmt: yuvj420p

FFmpeg extradata问题描述

标签:拷贝   form   buffer   rect   pack   idc   unsigned   tco   emc   

原文地址:http://blog.51cto.com/fengyuzaitu/2058138

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!