You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user