Page MenuHomePhabricator

Ogg .ogv transcode loses audio sync over time
Closed, ResolvedPublic

Description

In testing longer videos I found that audio gets slowly desynchronized from video over time in at least some ogg transcodes, such as that for https://commons.wikimedia.org/wiki/File:Knowledge_for_Everyone_(no_subtitles).webm

This is not specific to ogv.js, but is visible in other browsers with native playback (but most people with native playback will see the webm transcodes which do not suffer from this problem).

I reran the ogg transcodes on that file with current settings to make sure this was not an old problem, and can confirm it's still present.

Seek to about 17:52 in the file for the kids' final plea, showing very broken sync in ogg version while webm transcodes are fine. Sync is ok near the beginning of the file and gets progressively worse...

Event Timeline

Tracked this to the audio resampling -- currently we're set to max out ogg transcodes at 44.1 kHz, while the source audio was 48k. Something went wrong accumulating rounding errors or something, and the result is not pretty.

As a quick hack, bumping the rate limit from 44.1 to 48k should avoid resampling on the 48k input, while still not resampling lower input rates.

Or just remove the sample rate...

Change 289900 had a related patch set uploaded (by Brion VIBBER):
Don't resample audio with ffmpeg2theora, it's unreliable

https://gerrit.wikimedia.org/r/289900

Change 289900 merged by jenkins-bot:
Don't resample audio with ffmpeg2theora, it's unreliable

https://gerrit.wikimedia.org/r/289900

brion claimed this task.

closing out, this merged a while ago