Saturday, January 3, 2009

Active Issue: YouTube, HD and Audio-Video Sync

(NOTE: At least for the codecs I tested, this issue seems now (Feb. 2) to have been resolved (for the most part). There have been a few reports on this, but most appear to be caused by issues such as variable frame rates in the video, or other oddities in rendering. For now, though, I'll leave this here for comment, if anyone cares to add something that makes this more clear.)

Rather than keep addressing this issue piecemeal in the YouTube's Bug Reports & Issues Forum, I'm going to try to lay out as much as is presently known about this issue. Please be aware that this is an open draft, and likely to change from one moment to the next, often in response to your feedback here or in relevant channels and conduits within YouTube.

What IS the Issue?

Around mid-December, 2008, YouTube rolled out two dramatic new features. 16:9 rendering and 720p HD replay via Flash players, currently limited in theory to those connected within the US. with this sort of overlapping roll-out, a fair number of videos that once displayed in a predictable way, began to playback in ways unintended by their creators. The AVSync "issue" is one particular subset of these playback oddities that can be described, broadly, as follows:

  1. An affected video plays back in such a way that the video and audio streams are no longer held in sync with each other;
  2. Many affected videos will play with what sounds like a normal speed audio track, but the video will run faster, sometimes a little faster and sometimes much, much faster. A 39-second clip may run in NQ (Normal Quality) at its full 39 seconds and run in HD at 35 seconds. Or the original might be 4-5 minutes long and the HD playback run for merely 1 min 12 seconds.
  3. There may be some videos that seem to share similar behavior but exhibit traits that call into question either the cause or the best way to work around the present limitations and sources of defects. -- for instance, a video shot in AVCHD at 50i fps, uploaded as a MPEG-PS or MPEG-TS, might run normally in NQ and at exactly half speed in HD. Since the audio and video remain in sync, this is unlikely to stem from the same source, although similar workarounds may offer ways to correct the problem for those with the softwear or other tools needed to address current YouTube limitations.
  4. There are signs that this sync issue is not just limited to HD videos. It's hard to identify a single cause when there are thousands of potential ways that a video can be rendered and multiplexed into one of the several standard container files that YouTube and other streaming sites accept as uploads.

What Does an Affected Video Look Like, and What Sorts of Rendering Settings Is It Likely to Have?

Here's a playlist that includes multiple renders of a diagnostic video clip, meant to show where and how various renders are or are not out of sync with their audio streams.

Keep in mind that to see them out of sync you will need to view the HD versions on YouTube's own pages, not from within this viewer. As I revise this article, there were at least 10 different renders included in this playlist and I may continue adding to the list, if the issue is not explained soon, and repaired.



What is Known?

I hesitate to say here, since I'm guessing there are many who are dead certain they understand this, and I'm not the most tech savvy person looking at this by a long shot. What I know is that the sync issue happens and it happens fairly frequently. For me though, it mostly happens when the upload affected was rendered in some particular formats.

In general, it seems that it happens less, the closer one sticks to modest rendering methods and settings that make sense for streaming video. This means for instance, avoiding huge bit rates. For video anything more than 16Mbps seems a bit absurd, considering that the advertised maximum download rate for something like Comcast cable checks out at no more than 20Mbps, and that's when you do an artificial test to a fast, nearby server. In practice, I'm seeing downloading buffer speeds that average no more than 5Mbps. I'm going to assume, until given a statement from YouTube's tech staff, that uploads are transcoded to versions that in fact run at or about these rates, 4Mbps or less for what they call HD. I'd be happy to be shown I'm wrong on this, though.

YouTube gives a grid that contains suggested bitrates and other spec for rendering. Ignoring a few typos on that chart, my sense is that success is usually possible when you follow those specs. One partial exception, though, seems to be Quicktime renders. A lot of the audio codecs I have that Quicktime will render with and play just fine locally, seem to trigger the sync bug somehow. I have almost no idea why that is, but you can find a total of one video in my playlist of trial renders that does
not have the sync bug. And it seems each codec that does fail for YouTube HD streaming results in the same proportional loss of video length.

As I type this I'm wondering if, despite the recommendations, for QT at least, a 24fps playback rate might not be in effect? This is an angle I really did not explore in these renders, since the other codecs and containers tried did not seem to insist on 24fps the way, for instance, vimeo tends to.


What is Suspected?

Include both plausible and a few implausible suspicions.


What are the Workarounds that have shown the Best Results?

Render to an MPEG-4 container if your tools allow, and you have one or more good H.264 codecs available for encoding. Stick to H.264 for video, and AAC or MP3 for audio. Be sure that you are rendering a project at 720p resolution,
NOT 1080i or anything higher, and avoid uploading raw captured video as it came off your camera. No one really wants to look at unedited video anyway, so even if it didn't create problems on replay, it would still be bad form, except as a test. And the testing mostly says, "it's not a great idea."


Nothing yet.

No comments:

Post a Comment

We welcome comments, especially the funny kind.