Kodi Community Forum
Audio video out of sync with MKV files - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Audio video out of sync with MKV files (/showthread.php?tid=66108)



[SOLVED] Audio video out of sync with MKV files - myrison - 2010-01-05

To the XBMC devs/admins, first, thank you all for the amazing work on this product. I'm absolutely in love with it. I've run into one problem with my MKV files that I'm hoping someone can help me to resolve.

Summary:

MKV DVD rips (only) exhibit a gradual speed up of the audio the longer the file is played. (example: after an hour of playback, the audio offset must be set to -1.100 seconds to be in sync with the video). Stopping the video and restarting from the last position syncs the audio back up. In a normal-length movie, I have to do this 3-4x as the audio/video becomes noticeably out of sync.

These videos play fine (in sync) in external players like VLC.

Platform: The behavior is the same on Windows 7 & Linux (Ubuntu)

XBMC version: 9.11 R26017 (12/23/2009) [was the same on RC2 and maybe before that as well]

Hardware: Windows rig is an i7 @ 3.4 GHz, 6GB RAM, Linux machine is an Acer Aspire Revo with an Intel Atom 230 @ 1.6 GHz. Average CPUs on both stay low during playback.

Graphics: Windows: ATI Radeon 4800, Linux: Integrated NVIDIA ION LE.

Displays: 1) 1920x1080 projector @59 Hz, 2) LCD computer display 1920x1080 @59 Hz {note, these are not in use at the same time, just two different ones I've tried to attempt to isolate the issue}

Movie source:DVDs ripped using MakeMKV

File location: Movie file is local to the Windows machine, streamed over a network to the Linux machine.

MediaInfo from example MKV movie with a problem (I have others if that would be helpful)

Code:
Format                           : Matroska
File size                        : 3.25 GiB
Duration                         : 1h 57mn
Overall bit rate                 : 3 975 Kbps
Encoded date                     : UTC 2010-01-03 13:01:32
Writing application              : MakeMKV v1.4.9 beta win(x64-release)
Writing library                  : libmakemkv v1.4.9 beta (0.7.7/0.8.1) win(x64-release)

Video
ID                               : 1
Format                           : MPEG Video
Format version                   : Version 2
Format profile                   : Main@Main
Format settings, BVOP            : No
Format settings, Matrix          : Default
Codec ID                         : V_MPEG2
Codec ID/Info                    : MPEG 1 or 2 Video
Duration                         : 1h 57mn
Bit rate mode                    : Variable
Bit rate                         : 3 512 Kbps
Nominal bit rate                 : 9 800 Kbps
Width                            : 720 pixels
Height                           : 480 pixels
Display aspect ratio             : 16:9
Original display aspect ratio    : 16:9
Frame rate                       : 29.970 fps
Standard                         : NTSC
Resolution                       : 8 bits
Colorimetry                      : 4:2:0
Scan type                        : Interlaced
Scan order                       : Top Field First
Bits/(Pixel*Frame)               : 0.339
Stream size                      : 2.87 GiB (88%)

Audio
ID                               : 2
Format                           : AC-3
Format/Info                      : Audio Coding 3
Codec ID                         : A_AC3
Duration                         : 1h 57mn
Bit rate mode                    : Constant
Bit rate                         : 384 Kbps
Channel(s)                       : 6 channels
Channel positions                : Front: L C R, Surround: L R, LFE
Sampling rate                    : 48.0 KHz
Stream size                      : 322 MiB (10%)
Title                            : 3/2+1
Language                         : English

Text
ID                               : 3
Format                           : VobSub
Codec ID                         : S_VOBSUB
Codec ID/Info                    : The same subtitle format used on DVDs
Language                         : English

Menu
00:00:00.000                     : en:Chapter 01
... (snip)...
01:50:11.605                     : en:Chapter 28

Debug Log file: Pastebin.com (note that this log is from my Windows machine. Since it is far more powerful hardware-wise, I've used it to avoid the possibility of any hardware limitations causing the problem)

Possibly related issues:
I am not certain if they are the same, but in the interest of helping pinpoint the problem, I'll point out two that seem similar. (The first one seems to be very closely related)
  • TRAC 8353 - MKV Video from DVD plays too fast

  • TRAC 8368 - Audio / Video Sync with HD streams.

I have tried using various settings in the XBMC settings for "AV Sync" and "Sync playback to display" but none seem to have any effect on this issue. (though I could be using them incorrectly)

I've done my best to post everything requested in the various stickies re: how to report a problem correctly, but if there is anything missing, please let me know.

I can also post a sample file if that would be helpful, but due to the very gradual nature of the problem, a sample file is going to be fairly lengthy to demonstrate the problem. If that is needed here, just say the word and I'll find a way to post one. (I'm hoping it's something else obvious that I've missed that is causing the issue)

Thanks in advance for reviewing. If this is confirmed to be the same bug as one of those posted above or something new I'll submit a formal bug report as well.

Jason


- jpennell - 2010-01-05

Jason,

I don't want to be seen as hijacking your thread... I don't have the same issue as you although I am running Camelot on my Revos.

I have several BD which I have converted to MKV using MakeMKV. On the Revos, despite VDPAU being used and low CPU usage, there is a weird "glitch" in the video playback.

It's hard to explain - and more obvious on long, panning shots but if you imagine a film where every few hundred sprocket holes, two holes were joined together so the film kind of "slips". It's like a jump - but no missed frames are reported.

For example, the scene in Harry Potter and the Half-Blood Prince where the train is travelling across the fields near the start of the film - the panning and train movement "jerks" every 5 seconds or so.

Have you seen anything like this? I only purchased a BD drive last week so am experimenting with using HandBrake to reduce the MKV size to something more manageable.

In the meantime, since I don't have your audio speed issue - maybe worth running Live from a USB with Camelot and see if the issue is fixed?

Regards,

Jon


- myrison - 2010-01-05

Jon, thanks for the reply. In an attempt to keep this post on topic, I copied your question to its own thread.

I've been able to reproduce this now on 5 different machines, so I don't think it has to do with the XBMC version (unless XBMC Live is the only version that doesn't have the problem and Windows/Linux Ubuntu both do, which maybe would be my luck).

In the meantime, I'm trying to determine if I have any MKV files that play normally and if so, how they are different.


- myrison - 2010-01-06

As an update on this, only 1 of 10 MKV DVD rips tested seems to play all of the way through without getting out of sync.

Interlaced video tracks seem to run out of sync more quickly and more severely, but unfortunately the progressive material is affected to, so I haven't been able to isolate anything about the one video that worked vs. those that did not.

I'll continue to experiment a bit in the meantime, but it does not appear to be isolated to only a few MKVs. Suggestions welcomed! Big Grin


- myrison - 2010-01-07

Well, in the interest of closing out this thread, I wanted to report back that this was confirmed to be a bug and was fixed by elupus yesterday.

I've since downloaded the SVN build and recompiled (Windows only thus far) and confirmed that it solved the problem.

As a relatively new XBMC user, I was really impressed (amazed) with the speed and quality of support. I don't get this good of support on 99% of the products I have paid for, much less those that are free. Donation inbound!

Thanks guys, keep up the awesome work.

Jason


- ConfusedNewUser - 2010-08-11

I too have been experiencing this issue, and have reviewed the fix link in the previous post; however, I have not been able to find any reference to how to implement that fix. If someone could point me in the right direction, or at some appropriate instructions, I'd appreciate it.

Thanks


- ConfusedNewUser - 2010-08-11

Naturally, after looking for the instructions for a week, I found them 2 minutes after posting. Thanks anyway.


- myrison - 2010-08-11

That's normally how it goes! Glad you got it fixed. Smile


- ConfusedNewUser - 2010-08-12

Well, I wish I could say that fixed it, but I couldn't get the code to compile properly (saw lots of commments from others with the same problem). Anyway, I'm not in that big a rush (still saving up for the necessary storage server). I presume these changes were made for Dharma, anyone have any idea when that is due for official release? Looks like its getting close.


- CrystalP - 2010-08-12

You don't need to compile anything, that reference to elupus' change indicates that the fix was added to the xbmc codebase.
Grab the latest nightly release and test if the problem is indeed fixed.

Backup your video db first as it will be upgraded by the new version.