I am trying to use ffmpeg in Android as a demuxer for FLV contained audio.<div><br></div><div>As a proof of concept I wrote a barebones demuxer->muxer in C that essentially tries to mimic this ffmpeg command</div><div><br>
</div><div>ffmpeg -i input.flv -acodec copy output.aac</div><div><br></div><div>The output of ffmpeg obviously works perfectly. But my program's output differs by a few bytes, I think it's the ADTS header or something.</div>
<div>My program can also do FLV contained MP3 and even though my program's output still differs by a few bytes, my output is playable.</div><div><br></div><div>Only too happy to share the entire source if someone has the time to wade through it but the basic functionality is like so:</div>
<div><br></div><div>init a whole lot of stuff</div><div>...</div><div>avformat_write_header(outputFormatCtx,NULL);<br></div><div>while(av_read_frame(inputFormatCtx, &inputPacket))</div><div> if(inputPacket.stream_index == audioStreamIndex)</div>
<div> av_interleaved_write_frame(outputFormatCtx, inputPacket)</div><div>av_write_trailer(outputFormatCtx);<br></div><div><br></div><div><br></div><div>I've been wading through ffmpeg.c to try and figure out what I'm missing but no luck as of yet.</div>
<div>I'm guessing I should add some options to avformat_write_header instead of NULL but I haven't been able to figure out what.</div><div><br></div><div>Many thanks, </div><div>Atli.</div>