Little lag during playback (in Project monitor) everytime there is a clip change
Brought to you by:
ddennedy,
lilo_booter
Do not expect anyone to do anything about this anytime soon, but I will be glad to leave it open for you in the meantime. A possible fix in the apps is to make them configure MLT (possibly via setting) to have a little buffer for rendering frames ahead of playout, but this can also create some side effects with respect to responsiveness and accuracy of pause handling, which is why they are not using a buffer as that requires further optimization.
This might also be affected by the default interpolation setting of in-app preview, which also affects the accuracy of seeking in the avformat producer. This is inter-related with the buffering mentioned in previous comment. A less accurate seek means frames may be repeated upon seek (starting next clip where in point is not the beginning is a seek). A more accurate seek often takes more time. It depends upon the format of the video especially if there are B frames.
Last edit: Dan Dennedy 2013-03-07
To see what I mean, try this command line to see how it helps:
melt your.kdenlive -consumer sdl buffer=100 rescale=bilinear
(If your.kdenlive has a lot of filters or transitions, then it will be harder to see improvement.)
The rescale=bilinear acts like a general quality setting now. It affects more than just the scaler, but also other effects that use interpolation. It also makes the seeking more accurate to avoid repeating frames upon the seek to an in point, but it will take long to perform that seek on video with B frames. To counteract the slower seeking, we can set buffer level to 100 frames, but notice how the player shows black for a few seconds before starting playback while it fills the buffer.
Just as you said, with that command the lag is gone! It also works without the "buffer=100" setting. Is there any way to apply it to Kdenlive? Or at least, which flags should I set in ffmpeg so I could have a proxy clip that avoids this problem? I say this because I found that if I transcode the clips to DNxHD the problem does not show up in kdenlive.
Thank you very much!
Last edit: Javier J. Salmeron Garcia 2013-03-08
git commit 560868 improves purging buffers. This will lets apps enable playback buffering and purge after pausing or seeking to minimize latency.
I will close this ticket on the next release.