File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,15 @@ uint64_t Utils::Obs::NumberHelper::GetOutputDuration(obs_output_t *output)
3131 video_t *video = obs_output_video (output);
3232 uint64_t frameTimeNs = video_output_get_frame_time (video);
3333 int totalFrames = obs_output_get_total_frames (output);
34-
35- return util_mul_div64 (totalFrames, frameTimeNs, 1000000ULL );
34+ uint64_t divisor = 0ULL ;
35+ for (size_t i = 0 ; i < MAX_OUTPUT_VIDEO_ENCODERS; i++) {
36+ obs_encoder_t *encoder = obs_output_get_video_encoder2 (output, i);
37+ if (!encoder)
38+ continue ;
39+ uint32_t encoder_divisor = obs_encoder_get_frame_rate_divisor (encoder);
40+ divisor += encoder_divisor <= 1 ? 1000000ULL : 1000000ULL / encoder_divisor;
41+ }
42+ return util_mul_div64 (totalFrames, frameTimeNs, divisor ? divisor : 1000000ULL );
3643}
3744
3845size_t Utils::Obs::NumberHelper::GetSceneCount ()
You can’t perform that action at this time.
0 commit comments