avoid fps too big

This commit is contained in:
xiongguangjie 2023-03-23 18:14:28 +08:00
parent 98ec6b68d9
commit 876aea33f5

View File

@ -382,7 +382,7 @@ Value makeMediaSourceJson(MediaSource &media){
int gop_size = video_track->getVideoGopSize();
int gop_interval_ms = video_track->getVideoGopInterval();
float fps = video_track->getVideoFps();
if (fps <= 1) {
if (fps <= 1 && gop_interval_ms) {
fps = gop_size * 1000.0 / gop_interval_ms;
}
obj["fps"] = round(fps);