FFMpeg直接解碼live555收到的網路資料包時錯誤解決方案

來源:互聯網
上載者:User

錯誤描述:

[h264 @ 003e4df0] non-existing PPS 0 referenced
[h264 @ 003e4df0] decode_slice_header error
[h264 @ 003e4df0] non-existing PPS 0 referenced
[h264 @ 003e4df0] decode_slice_header error

 

說明:上面的錯誤原因是PPS在解碼的時候沒有被設定

解決方案:

AVCodecContext *pCodecCtx;   //解碼環境

pCodecCtx = avcodec_alloc_context();//分配解碼環境

 pCodecCtx->extradata = new uint8_t[32];//給extradata成員參數分配記憶體
 pCodecCtx->extradata_size = 32;//extradata成員參數分配記憶體大小

 

//給extradata成員參數設定值
 //00 00 00 01
 pCodecCtx->extradata[0] = 0x00;
 pCodecCtx->extradata[1] = 0x00;
 pCodecCtx->extradata[2] = 0x00;
 pCodecCtx->extradata[3] = 0x01;

 //67 42 80 1e
 pCodecCtx->extradata[4] = 0x67;
 pCodecCtx->extradata[5] = 0x42;
 pCodecCtx->extradata[6] = 0x80;
 pCodecCtx->extradata[7] = 0x1e;

 //88 8b 40 50
 pCodecCtx->extradata[8] = 0x88;
 pCodecCtx->extradata[9] = 0x8b;
 pCodecCtx->extradata[10] = 0x40;
 pCodecCtx->extradata[11] = 0x50;

 //1e d0 80 00
 pCodecCtx->extradata[12] = 0x1e;
 pCodecCtx->extradata[13] = 0xd0;
 pCodecCtx->extradata[14] = 0x80;
 pCodecCtx->extradata[15] = 0x00;

 //03 84 00 00
 pCodecCtx->extradata[16] = 0x03;
 pCodecCtx->extradata[17] = 0x84;
 pCodecCtx->extradata[18] = 0x00;
 pCodecCtx->extradata[19] = 0x00;

 //af c8 02 00
 pCodecCtx->extradata[20] = 0xaf;
 pCodecCtx->extradata[21] = 0xc8;
 pCodecCtx->extradata[22] = 0x02;
 pCodecCtx->extradata[23] = 0x00;

 //00 00 00 01
 pCodecCtx->extradata[24] = 0x00;
 pCodecCtx->extradata[25] = 0x00;
 pCodecCtx->extradata[26] = 0x00;
 pCodecCtx->extradata[27] = 0x01;

 //68 ce 38 80
 pCodecCtx->extradata[28] = 0x68;
 pCodecCtx->extradata[29] = 0xce;
 pCodecCtx->extradata[30] = 0x38;
 pCodecCtx->extradata[31] = 0x80;

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.