c++ - Avcodec : generate OPUS header for a stream -


i'm using opus avcodec encode sounds , stream using own protocol.

it works mp2 codec far when i'm switching opus, have issue :

[opus @ 1b06d040] error parsing packet header.      

i suppose unlike mp2, need generate header opus encoded data stream don't know how.

can explain me how that? thanks.

this error comes ff_opus_parse_packet() failing, handles raw opus packet header, specification calls 'toc' (for table-of-contents) byte , optional subframe lengths. means libavcodec couldn't find packet duration expected.

so custom protocol corrupting data, returning wrong data length, or you're otherwise not splitting opus packet out of framing layer correctly.

you don't need invent own protocol if don't want to. there 2 established designs: opus on rtp interactive use (like live chat latency matters) documented in rfc 7587. http streaming, file storage recording, playback , other applications use ogg container, documented here. there implementations of both of these in libavformat. see rtpenc.c, oggenc.c , oggparseopus.c if you're curious details.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -