Best frame pacing ever
This commit is contained in:
+4
-5
@@ -1987,15 +1987,14 @@ namespace video {
|
|||||||
if (frame_timestamp) {
|
if (frame_timestamp) {
|
||||||
auto frame_diff = *frame_timestamp - next_frame_start;
|
auto frame_diff = *frame_timestamp - next_frame_start;
|
||||||
|
|
||||||
if (frame_diff > frame_threshold) {
|
if (frame_diff > frame_threshold / 2) {
|
||||||
next_frame_start = *frame_timestamp - frame_threshold / 2;
|
next_frame_start = *frame_timestamp + frame_threshold / 2;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
frame_timestamp = next_frame_start;
|
frame_timestamp = next_frame_start;
|
||||||
|
|
||||||
next_frame_start += frame_threshold;
|
next_frame_start += frame_threshold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (encode(frame_nr++, *session, packets, channel_data, frame_timestamp)) {
|
if (encode(frame_nr++, *session, packets, channel_data, frame_timestamp)) {
|
||||||
BOOST_LOG(error) << "Could not encode video packet"sv;
|
BOOST_LOG(error) << "Could not encode video packet"sv;
|
||||||
|
|||||||
Reference in New Issue
Block a user