static void log_frame_info(struct obs_output *output) { uint32_t video_frames = video_output_get_total_frames(output->video); uint32_t video_skipped = video_output_get_skipped_frames(output->video); uint32_t total = video_frames - output->starting_frame_count; uint32_t skipped = video_skipped - output->starting_skipped_frame_count; int dropped = obs_output_get_frames_dropped(output); double percentage_skipped = (double)skipped / (double)total * 100.0; blog(LOG_INFO, "Output '%s': stopping", output->context.name); blog(LOG_INFO, "Output '%s': Total frames: %"PRIu32, output->context.name, total); if (total) blog(LOG_INFO, "Output '%s': Number of skipped frames: " "%"PRIu32" (%g%%)", output->context.name, skipped, percentage_skipped); if (dropped) { double percentage_dropped; percentage_dropped = (double)dropped / (double)total * 100.0; blog(LOG_INFO, "Output '%s': Number of dropped frames: " "%d (%g%%)", output->context.name, dropped, percentage_dropped); } }
static void log_frame_info(struct obs_output *output) { struct obs_core_video *video = &obs->video; uint32_t video_frames = video_output_get_total_frames(output->video); uint32_t video_skipped = video_output_get_skipped_frames(output->video); uint32_t total = video_frames - output->starting_frame_count; uint32_t skipped = video_skipped - output->starting_skipped_frame_count; uint32_t drawn = video->total_frames - output->starting_drawn_count; uint32_t lagged = video->lagged_frames - output->starting_lagged_count; int dropped = obs_output_get_frames_dropped(output); double percentage_skipped = 0.0f; double percentage_lagged = 0.0f; double percentage_dropped = 0.0f; if (total) { percentage_skipped = (double)skipped / (double)total * 100.0; percentage_dropped = (double)dropped / (double)total * 100.0; } if (drawn) percentage_lagged = (double)lagged / (double)drawn * 100.0; blog(LOG_INFO, "Output '%s': stopping", output->context.name); blog(LOG_INFO, "Output '%s': Total encoded frames: %"PRIu32, output->context.name, total); blog(LOG_INFO, "Output '%s': Total drawn frames: %"PRIu32, output->context.name, drawn); if (total && skipped) blog(LOG_INFO, "Output '%s': Number of skipped frames due " "to encoding lag: %"PRIu32" (%0.1f%%)", output->context.name, skipped, percentage_skipped); if (drawn && lagged) blog(LOG_INFO, "Output '%s': Number of lagged frames due " "to rendering lag/stalls: %"PRIu32" (%0.1f%%)", output->context.name, lagged, percentage_lagged); if (total && dropped) blog(LOG_INFO, "Output '%s': Number of dropped frames due " "to insufficient bandwidth/connection stalls: " "%d (%0.1f%%)", output->context.name, dropped, percentage_dropped); }
void OBSBasicStatusBar::UpdateDroppedFrames() { if (!streamOutput) return; int totalDropped = obs_output_get_frames_dropped(streamOutput); int totalFrames = obs_output_get_total_frames(streamOutput); double percent = (double)totalDropped / (double)totalFrames * 100.0; if (!totalFrames) return; QString text = QTStr("DroppedFrames"); text = text.arg(QString::number(totalDropped), QString::number(percent, 'f', 1)); droppedFrames->setText(text); droppedFrames->setMinimumWidth(droppedFrames->width()); }