gpt4 book ai didi

c - 使用 FFMPEG 从 IP 摄像机读取 RTCP 数据包

转载 作者:太空宇宙 更新时间:2023-11-04 01:07:14 24 4
gpt4 key购买 nike

我正在使用 ffmpeg C 库。我需要拦截来自相机的 RTCP 数据包,以便从发件人报告中获取时间戳。 ffmpeg 中是否有任何方法或结构可以提供此信息?我完全被卡住了,但我无法解决这个问题。

任何帮助将不胜感激。提前致谢,

最佳答案

最后我不得不像这样侵入 ffmpeg 库:

// Patch for retrieving inner ffmpeg private data
RTSPState* rtsp_state = (RTSPState*) context->priv_data;
RTSPStream* rtsp_stream = rtsp_state->rtsp_streams[0];
RTPDemuxContext* rtp_demux_context = (RTPDemuxContext*) rtsp_stream->transport_priv;

// Decode the NTP time from the 64 bit structure
uint64_t ntp_time = rtp_demux_context->last_rtcp_reception_time;
uint32_t seconds = (uint32_t) ((ntp_time >> 32) & 0xffffffff);
uint32_t fraction = (uint32_t) (ntp_time & 0xffffffff);
double useconds = ((double) fraction / 0xffffffff);

我终于得到了时间戳信息。

关于c - 使用 FFMPEG 从 IP 摄像机读取 RTCP 数据包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20265546/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com