Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

时间戳问题 #68

Open
RentonIssac opened this issue May 30, 2022 · 1 comment
Open

时间戳问题 #68

RentonIssac opened this issue May 30, 2022 · 1 comment

Comments

@RentonIssac
Copy link

uint32_t H264Source::GetTimestamp()
{
/* #if defined(__linux) || defined(linux)
struct timeval tv = {0};
gettimeofday(&tv, NULL);
uint32_t ts = ((tv.tv_sec*1000)+((tv.tv_usec+500)/1000))*90; // 90: _clockRate/1000;
return ts;
#else */
auto time_point = chrono::time_point_castchrono::microseconds(chrono::steady_clock::now());
return (uint32_t)((time_point.time_since_epoch().count() + 500) / 1000 * 90 );
//#endif
}

老哥你好
现象:

使用一些流行的开源转发中间件,诸如:
ZLMediaKit

使用RtspServer.Push => ZLMediaKit
观看ZLMediaKit转发的RTSP,没问题(相当于Rtsp Proxy)
但如果打开ZLMediaKit转协议出来的HTTP-FLV流,就无法打开视频图像

综合我浅查的资料来看,应该就是时间戳造成的问题。
有2点可以帮助理解:

  1. 通过ffmpeg命令行推送的RTSP流到ZLMediaKit,无论哪种协议转换,都没问题;
  2. 如果在ZLMediaKit配置:覆盖时间戳,则可以看到视频,有轻度卡顿。

另外,RTP包的时间戳,好像是相对上一帧时间,而非绝对时间。

@fatalfeel
Copy link

because of this #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants