复制H.264附件B&使用libavformat与vcopy / acopy的AAC流 [英] Muxing a H.264 Annex B & AAC stream using libavformat with vcopy/acopy

查看:175
本文介绍了复制H.264附件B&使用libavformat与vcopy / acopy的AAC流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用来自IP摄像头的视频(H.264)和音频(AAC)进行一些集成工作。

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

我已经取得了一些进展我可以存储视频&音频流独立具有使用VLC播放器播放的能力。 H.264正在以附件B格式存储,音频使用格式为格式的文件。

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.

我现在正在尝试将流复制到MP4文件中,而无需做任何解码或编码,但到目前为止还没有找到答案。

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.

我可以使用ffmpeg手动执行此操作:
ffmpeg -i recording.h264 -i recording.aac -vcodec copy -acodec copy -absf aac_adtstoasc recording.mp4

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

如何使用C ++中的ffmpeg库执行此操作?

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

推荐答案

查看复用样本;关键是跟踪您的音频/视频时间戳,并使用 av_interleaved_write_frame 及时写下一个。

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.

这篇关于复制H.264附件B&使用libavformat与vcopy / acopy的AAC流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆