av_interleaved_write_frame错误 Invalid data found when processing input
生活随笔
收集整理的這篇文章主要介紹了
av_interleaved_write_frame错误 Invalid data found when processing input
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
問題描述:
調用av_interleaved_write_frame接口發(fā)送AAC格式的音頻數(shù)據(jù)時,報錯:Invalid data found when processing input。
解決方案:
我之前添加過上面的代碼,但是沒有執(zhí)行到,導致av_interleaved_write_frame接口失敗,強制設置了一下,可以了。
pOutAudioCodecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER;AV_CODEC_FLAG_GLOBAL_HEADER在源碼中的定義如下:
/*** Place global headers in extradata instead of every keyframe.* 將全局頭部信息放在extradata指針中,而不是每一個關鍵幀中*/ #define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)注意:有些格式需要設置該參數(shù)。
其具體使用可參考:
https://blog.csdn.net/a812073479/article/details/79856262
https://blog.csdn.net/passionkk/article/details/75528653
總結
以上是生活随笔為你收集整理的av_interleaved_write_frame错误 Invalid data found when processing input的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Ubuntu系统下C语言编译以及Make
- 下一篇: avformat_open_input返