Muxing a H.264 Annex B & AAC stream using libavformat with vcopy/acopy

我与影子孤独终老i 提交于 2019-12-10 11:52:29

问题


I'm doing some integration work with video (H.264) and audio (AAC) from an IP camera.

I've made a bit of progress and I can store the video & audio streams individually with the ability to play it back using VLC player. The H.264 is being stored in Annex B format and the audio is using an adts formatted file.

I'm now trying to mux the streams into an MP4 file without doing any decoding or encoding but so far haven't managed to find the answer.

I can do this manually with ffmpeg: ffmpeg -i recording.h264 -i recording.aac -vcodec copy -acodec copy -absf aac_adtstoasc recording.mp4

How do I do this with the ffmpeg library from C++?


回答1:


Check out the muxing sample; the key is to keep track of your audio/video timestamps and write the next one in time using av_interleaved_write_frame.



来源:https://stackoverflow.com/questions/15239124/muxing-a-h-264-annex-b-aac-stream-using-libavformat-with-vcopy-acopy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!