Fixing invalid frame mapping calculation (when using a linear algorithm to map framerates). We were accidentally adding +1 to the video_length, causing a slight rounding error, causing some random frames to be skipped.

For example, if a video with 100 frames was mapped to the same framerate, we would calculate the frame increment: 101 / 100 (instead of 100 / 100). In this simple example, the value increment should be 1.0, matching the source frames exactly.
This commit is contained in:
Jonathan Thomas
2022-06-25 17:42:30 -05:00
parent d2c7e856bb
commit cba676463d

View File

@@ -219,7 +219,7 @@ void FrameMapper::Init()
int64_t new_length = reader->info.video_length * rate_diff;
// Calculate the value difference
double value_increment = (reader->info.video_length + 1) / (double) (new_length);
double value_increment = reader->info.video_length / (double) (new_length);
// Loop through curve, and build list of frames
double original_frame_num = 1.0f;