[Bf-blender-cvs] [c09de255000] temp-vse-fast-scrubbing2: FFmpeg: Improve scrubbing performance

Richard Antalik noreply at git.blender.org
Mon Mar 1 14:05:31 CET 2021


Commit: c09de255000bfbbbcc806bff26a273b0dcb15510
Author: Richard Antalik
Date:   Thu Feb 25 00:24:19 2021 +0100
Branches: temp-vse-fast-scrubbing2
https://developer.blender.org/rBc09de255000bfbbbcc806bff26a273b0dcb15510

FFmpeg: Improve scrubbing performance

Applying negative offset to seek position before scanning doesnn't have
any effect. This change results in 1.5x faster seeking (random frame,
average value) in sample file with 30 frame GOP length.

If I am not mistaken, B frames can have `pts` that can be less than
`pts` of I frame that must be decoded. Even in this case though, B frame
packet will be stored after that I frame.

In addition, preseek value is de facto hardcoded so seeking would fail
if it could. This can be hard to spot though.

Differential Revision: https://developer.blender.org/D10529

===================================================================

M	source/blender/imbuf/intern/anim_movie.c

===================================================================

diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 28bf26aa343..d36c7bbe486 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -1149,7 +1149,7 @@ static ImBuf *ffmpeg_fetchibuf(struct anim *anim, int position, IMB_Timecode_Typ
       }
     }
     else {
-      pos = (int64_t)(position - anim->preseek) * AV_TIME_BASE / frame_rate;
+      pos = (int64_t)position * AV_TIME_BASE / frame_rate;
 
       av_log(anim->pFormatCtx,
              AV_LOG_DEBUG,



More information about the Bf-blender-cvs mailing list