Videos encoded at 24fps stutter frequently (patch suggestion included)

Bug #1032972 reported by David Hart
6
This bug affects 1 person
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.

Revision history for this message
Tom Rothamel (renpytom) wrote :

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.

Changed in renpy:
status: New → Fix Committed
importance: Undecided → Medium
milestone: none → 6.14
Revision history for this message
David Hart (davey3000) wrote :

Thanks, I'll test the changes in the next 6.14.0 build.

For reference, the 6.14.0 build that the issue was still present in was 6.14.0.313.

Revision history for this message
David Hart (davey3000) wrote :

Verified that this is issue is fixed in build 6.14.0.329 (tested on Ubuntu 12.04 LTS 32-bit and Windows 7 64-bit).

Tom Rothamel (renpytom)
Changed in renpy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.