Videos encoded at 24fps stutter frequently (patch suggestion included)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ren'Py |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Videos encoded at 24fps (and possibly other frame rates although these have not been tested) appear to stutter quite frequently. This was tested with the following encodings:
- Matroska container, Theora video, Vorbis audio
- WebM container, VP8 video, Vorbis audio (required recompilation of libav* with WebM and VP8 decoding enabled)
The issue appears to be caused by the audio/video sync functionality in module/ffdecode.c. The default sync threshold is lower than the time between two frames at 24fps, which appears to result in resynchronization attempts when none are needed. Increasing the threshold to a value greater than the time between two frames appears to fix the issue. A suggested fix is therefore to change the line:
#define AV_SYNC_THRESHOLD 0.01
to:
#define AV_SYNC_THRESHOLD 0.1
This should fix the issue for videos with frame rates of 10fps or greater (although this has not been tested and there may be some boundary conditions near 10fps).
Issue observed on Ren'Py 6.13.12 and 6.14.0 for Linux and Windows. Fix tested on 6.13.12 for Linux only.
Changed in renpy: | |
status: | Fix Committed → Fix Released |
Based on this bug, I spent yesterday rewriting the way 6.14 handles video playback and video-audio synchronization.
So this problem should be solved now.