c++ - how to create AVPacket manually with encoded AAC data to send mpegts? -


i'm developing app sends mpeg2ts stream using ffmpeg api.(avio_open, avformat_new_stream etc..)

the problem app has aac-lc audio audio frame not need encoded because app bypass data received socket buffer.

to open , send mpegts using ffmpeg, must have avformattcontext data created ffmpeg api encoder far know.

can create avformatcontext manually encoded aac-lc data? or should decode , encode data? information know samplerate, codec, bitrate..

any appreciated. in advance.

yes, can use encoded data as-is if container supports it. there 2 steps involved here - encoding , muxing. encoding compress data, muxing mixes in output file, packets interleaved. muxing example in ffmpeg distribution helped me this.

you might take @ following class: https://sourceforge.net/p/karlyriceditor/code/head/tree/src/ffmpegvideoencoder.cpp - file 1 of projects, , contains video encoder. starting line 402 you'll see setup non-converted audio - kind of hackish way, worked. unfortunately still end reencoding audio because formats not possible achieve frame-perfect synchronization needed


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -