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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -