MKV audio sync is off

Yet another post about audio sync being off. I’ve got lots of MKV files, and on the majority of them, which play FINE in VLC media player on Windows, they play out of sync on the WD TV Live. However, unlike most “laymen” on this site, I know a lot about file formats and how sync works. I work at Microsoft as a developer in the audio/video department, and I know exactly what it takes to make audio and video play back in sync. **bleep**, I wrote a good chunk of the code.

Folks, almost any media that you would rip from, in order to obtain an MP4, MKV, AVI file, etc, has what are called “presentation timestamps” in the source media (DVD, blu-ray). These presentation timestamps tell the computer exactly when to play the media, so the audio and video don’t get out of sync. The computer reads and decompresses the source footage, sometimes well ahead of where it’s playing, and waits on each stream, video and audio, for the right time to play its’ decompressed footage. Frequently the timestamps aren’t included with every packet of audio or video, but are interspersed within the streams, like every 2 seconds or so. Your “rip” software SHOULD take this into account when producing it’s output file, but even so, the output streams in the MKV or MP4 file should ALSO have presentation timestamps. They might be being written at different points than in the source footage, but trust me, the presentation timestamps should be there, or your ripping software ain’t worth squat.

Secondly, any professional source footage (dvd, blu-ray) should be authored according to a “master clock”. The audio presentation timestamps should exactly match up with where they should be, given that all audio on the DVD/blu-ray should be delivered at a master format of however many Khz samples per second. In other words, if the audio says it’s 48,000 Khz, then at 48,000 samples into the audio, the presentation timestamp **bleep** well better be 1 second exactly. Video, likewise, is authored on the DVD according to the master NTSC clock, at *exactly* however many frames per second. DVD players wouldn’t be able to keep sync correctly if BOTH the DVD wasn’t authored according to a master clock and the presentation timestamps are missing or are wrong.

Okay, so assuming the PC can play back the MKV file or the MP4 file exactly correctly means either one of two things: (a) the presentation timestamps are wrong and the media player is against all the odds playing it exactly right (1 million to 1 shot), or (b) the file was ripped correctly and the presentation timestamps are correct.

Given that it’s very likely (b) above, and knowing that I have 100’s of MKV files on my PC that play correctly on the PC, the fact that the WD TV Live box does NOT play them back in sync means the bug is in the WD code, not the source files.

Simply put: on SOME files, not all of them, the WD TV Live box is not obeying the presentation timestamps correctly, for whatever reason. Given that the WD box doesn’t play a lot of MP4 or M4V files in sync either, leads me to believe there is simply a sync bug in the WD box that they haven’t found or tracked down or understand how to fix, yet. the fact that it happens on some files and not others, but nobody knows exactly which files or what formats cause the issue, is disturbing from a customer service standpoint. There should be a batch of test files in a suite which are tested against, for each new version of the firmware that comes out, with some way to automatically detect if the audio and video are in sync. Why, when I was just a wee tad at Microsoft 15 years ago, I wrote an automation tool like this which watched the video output and listened to the audio output, and verified the sync was actually in sync.

I’d be happy to talk to a WD representative about timestamps…

By the way, this is NOT the problem: The audio sync being off, but always having the same sync gap. This can be caused by delays in your audio or video pipeline. modern TVs can delay the video HMDI signal by however many frames (sometimes up to 3!), and of course, there can be a delay in the audio pipe, if you’re using digital, or even analog audio. However, this sync gap is constant and never changes. when I talk about a sync issue with my files, I’m talking about a gap that gets bigger and bigger over time and eventually is in the seconds, not milliseconds.

This is also not the problem: network bandwidth. My files are fairly low bandwidth, and connected to a very high-bandwidth, very profesionally set up ethernet network that is not clogged. I can upload/download files from my PC to my server at about 200 MB/second, so throughput on my network is not an issue.

The sync issue people are talking about is definitely related to a bug in the playback timing software.

AngryAtWD wrote:

I work at Microsoft as a developer in the audio/video department, and I know exactly what it takes to make audio and video play back in sync. **bleep**, I wrote a good chunk of the code.

[Deleted]

And now in your second (?) post on this you talk a lot about video encoding but somehow fail to mention the specifics. So as a reply, my statement still stands: NONE of my files is out of sync on neither player nor firmware.

I do have a lot of credibility. i’m one of the few people, probably on this planet, that understand how audio and video sync really work from a capture, store, and playback perspective. That you resort to trashing me online ruins YOUR credibility. But like a good, credible, programmer,[Deleted], I get paid (highly) for what I do and know.

I’m not sure I feel obligated that I have to detail exact specifics to know that there is a bug in the sync. I’m not saying where the bug is, or even exactly what causes the bug, I wasn’t hired as WD’s tester. But as a consumer who bought the darned box, I do observe that (a) the sync is off on many files and gets worse the longer I play the files, and (b) (more importantly) MANY other people complain about the same problem. So, “techflaws” it’s not as if i’m the first person to mention it.

I will work with WD directly, and not pander to your baiting.


AngryAtWD wrote:

I do have a lot of credibility. i’m one of the few people, probably on this planet, that understand how audio and video sync really work from a capture, store, and playback perspective. That you resort to trashing me online ruins YOUR credibility. But like a good, credible, programmer, I don’t have a *bleep* about your opinion, I get paid (highly) for what I do and know.


And where is your planet?

I expect you would use your real name if it were not for your obvious modesty.

I would have assumed that a person with your huge talent and great wealth would have purchased something better than a cheap off the shelf media player which is now obsolete. If you want to work directly with WD then its probably better that you ring or email them as this a user to user forum only, full of ordinary people who are not  legends in their own mind. :wink:

AngryAtWD wrote:

i’m one of the few people, probably on this planet, that understand how audio and video sync really work from a capture, store, and playback perspective.

 And look what good it does you in getting your files to play back in sync!

AngryAtWD wrote:

That you resort to trashing me online ruins YOUR credibility. 

Actually it doesn’t cause I have the facts on my side which are these: I have the same hardware as you, the same firmware as you but different MKVs. Now what does that tell you about ALL of mine being in sync and yours not?

AngryAtWD wrote:

I get paid (highly) for what I do and know.

 Yeah, that’s probably what everyone is telling themselves who just couldn’t land a job at Apple.

AngryAtWD wrote:
I’m not sure I feel obligated that I have to detail exact specifics to know that there is a bug in the sync.

So that’s they way people from Micros~1 deal with bugs. That explains a lot.

AngryAtWD wrote:
I do observe that (a) the sync is off on many files and gets worse the longer I play the files

 Which should tell you something about your files, being the genius that you are.

AngryAtWD wrote:
(b) (more importantly) MANY other people complain about the same problem.

Name three.

richUK wrote:
I expect you would use your real name if it were not for your obvious modesty.

LOL!

Boy, I sure don’t like having to stoop to [Deleted] the ins and outs about testing. But since I’m waiting for the scrambled eggs to finish, and have a few seconds, i’ll reply, maybe you’l shut up. Probably you won’t. WD might want to pay attention too, since they’re obviously not doing their testing either.

I pointed out in the beginning post that the files all play back perfectly on my PC, but some of them don’t play right on the WD box. It’s not like I can mis-configure the WD box, so that only leaves the software on the WD box or the MKV files as being the problem. ALL of them play back perfectly on the PC. Again, like I pointed out before, in order for them to play back perfectly on the PC, it would have to be (a) a miracle, or (b) the files are authored correctly. To put it the other way, IT ONLY TAKES ONE LITTLE THING (bug) for the files to NOT play right. On the PC, the timestamps are obviously there, and are being obeyed.  As for why the one arrogant dude’s files are all playing back perfectly on HIS WD system, I’ll take a wild guess he’s outputting to some type of consistent format that WD just happens to play back correctly. that’s great for him, but there are literally millions of permutations you can compress a MKV file into. Various frame rates, compression rates, audio formats, etc. The way I happen to compress my MVK files is through DvdFab 9, with the output set to H264, and frame rate as “same as source”. The audio is set to “passthrough” which puts the source audio directly into the output file. WD has released a box that implicitly claims to ‘play anything’, and as such, they should test “all” permutations for audio sync. They obviously haven’t accomplished this.

The fact that WD plays some correctly and some other ones wrong IS weird. I’m assuming that the places where they play correctly is because of one of two reasons:

possibility 1: the files are authored so that the presentation timestamps don’t matter, the files’ data are exactly correct anyhow. this means that at time 50 seconds, and 48Khz, you’ve received exactly 50 * 48000 samples. For a file with the audio data is slightly off, the presentation timestamps might not exactly line up with how many samples have been delivered. In this case, it’s the playback system’s job to stretch or shrink the audio so the user doesn’t hear clicks or pops. You “laymen” might not understand this because, well, you’re not in the field as a professional like I am.

possibility 2: the WD box does try to obey presentation timestamps but when the CPU gets really bogged down, and it needs to dropframe (very likely), something happens in the math, and some time offset variable starts to get off, and they don’t know how to fix it yet. Dropframing is actually pretty tough to do right, and even microsoft occasionally gets this code wrong. I wasn’t on the team that dealt with the dropframing code, but I was one of the team members that would report the problems and wrote the code to detect it.

flame all you want, you just come across like angry anti-microsoft [Deleted]. doesn’t change the fact that WD has a buggy product that I’m trying to help them make better.

AngryAtWD wrote:

Boy, I sure don’t like having to stoop to teach morons the ins and outs about testing. But since I’m waiting for the scrambled eggs to finish, and have a few seconds, i’ll reply, maybe you’l shut up. Probably you won’t.

 Probably not. You’re just too funny with that misplaced indignation and moronic sense of importance of yours.

AngryAtWD wrote:

I pointed out in the beginning post that the files all play back perfectly on my PC, but some of them don’t play right on the WD box. 

Most people do. The regular answer they get is that players like VLC are optimized to play even bad files in ways  hardware players like the LIVE (which is quite picky about spec compliance) never could. Which means, it’s in no way a miracle you get the files to play back on your PC.

AngryAtWD wrote:
As for why the one arrogant dude’s files

 Ooh, the irony!

AngryAtWD wrote:
The way I happen to compress my MVK files is through DvdFab 9, with the output set to H264, and frame rate as “same as source”. The audio is set to “passthrough” which puts the source audio directly into the output file.

Being the expert you are (*chuckle*), it’s hard to believe it took you so long to post this vital information (sample files are still missing though). Apart from DVDfab 9 still being BETA, I’ve read a lot of complaints about weirdly authored files on their forums so this might be a first hint at what’s going wrong. Since you couldn’t be bothered to link to any of the MANY postings in which people here supossedly claim to suffer from out of sync files too and none has chimed in so far here, I’m still chalking it up to your files (until you redo them with MakeMKV or Handbrake and receive similar results).

AngryAtWD wrote:
Dropframing is actually pretty tough to do right, and even microsoft occasionally gets this code wrong.

 Yeah, unlike all the other code by Micros~1. Hilarious.

AngryAtWD wrote:

flame all you want, you just come across like angry anti-microsoft jercs.

Jercs? Is that a spelling error corrected by Micros~1 Word?

AngryAtWD - so why do you have a obsolete WD player which you can’t seem to work properly. What does it tell you about yourself when a large number of [Deleted]/ laymen can play their files OK. You are not giving us much faith in Microsoft if nobody there can help you out with your little problem.