MKV Audio / Video Sync issues

For help and support with PS3 Media Server in general
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

MKV Audio / Video Sync issues

Postby silverbow25 » Fri Apr 19, 2013 5:21 pm

Below are two similar files one with sync issues and one without. I believe I found a way to fix the sync issues and just wanted to pass the solution on to others with the same problem.

File with sync issues when streamed to PS3 but not when run locally on the system:
Code: Select all
D:\Videos\Movies & Shows\Naruto\Shippuden Season 06\Naruto Shippuden - 115 - Zabuza's Blade.mkv
  General
    Unique ID : 237441519619971906345754994882554375614 (0xB2A192C1ABE219B599C146C350E82DBE)
    Complete name : D:\Videos\Movies & Shows\Naruto\Shippuden Season 06\Naruto Shippuden - 115 - Zabuza's Blade.mkv
    Format : Matroska
    Format version : Version 2
    File size : 124 MiB
    Duration : 23mn 24s
    Overall bit rate : 739 Kbps
    Encoded date : UTC 2012-11-11 14:05:04
    Writing application : mkvmerge v5.7.0 ('The Whirlwind') built on Jul  8 2012 20:08:51
    Writing library : libebml v1.2.3 + libmatroska v1.3.0
  Video #1
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High 10@L5.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 16 frames
    Muxing mode : Header stripping
    Codec ID : V_MPEG4/ISO/AVC
    Width : 1 280 pixels
    Height : 720 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 10 bits
    Scan type : Progressive
    Writing library : x264 core 125 r2208 d9d2288
    Encoding settings : cabac=1 / ref=16 / deblock=1:1:2 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=0.40:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=25.0 / qcomp=0.60 / qpmin=0 / qpmax=81 / qpstep=4 / ip_ratio=1.40 / aq=1:0.60
    Language : English
    Default : Yes
    Forced : No
  Audio #2
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : A_AAC
    Duration : 23mn 24s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Compression mode : Lossy
    Delay relative to video : 9ms
    Default : Yes
    Forced : No

File with no noticed sync issues:
Code: Select all
D:\Videos\Movies & Shows\Fairy Tail\Season 1\Fairy Tail - 007 - Flame and Wind.mkv
  General
    Unique ID : 236887445419169644736586922082971575808 (0xB236DCCA0FCEA80A943D63F1E55A6600)
    Complete name : D:\Videos\Movies & Shows\Fairy Tail\Season 1\Fairy Tail - 007 - Flame and Wind.mkv
    Format : Matroska
    Format version : Version 2
    File size : 171 MiB
    Duration : 24mn 27s
    Overall bit rate : 975 Kbps
    Encoded date : UTC 2012-10-22 09:16:08
    Writing application : mkvmerge v4.9.1 ('Ich will') built on Jul 11 2011 23:53:15
    Writing library : libebml v1.2.1 + libmatroska v1.1.1
  Video #1
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High 10@L5.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 16 frames
    Muxing mode : Header stripping
    Codec ID : V_MPEG4/ISO/AVC
    Duration : 24mn 27s
    Width : 1 280 pixels
    Height : 720 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 23.976 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 10 bits
    Scan type : Progressive
    Writing library : x264 core 125 r2208 d9d2288
    Encoding settings : cabac=1 / ref=16 / deblock=1:1:2 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=0.40:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=25.0 / qcomp=0.60 / qpmin=0 / qpmax=81 / qpstep=4 / ip_ratio=1.40 / aq=1:0.60
    Language : English
    Default : Yes
    Forced : No
  Audio #2
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : A_AAC
    Duration : 24mn 27s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Compression mode : Lossy
    Default : No
    Forced : No
  Audio #3
    ID : 3
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : A_AAC
    Duration : 24mn 27s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Compression mode : Lossy
    Default : Yes
    Forced : No
  Text #4
    ID : 4
    Format : UTF-8
    Codec ID : S_TEXT/UTF8
    Codec ID/Info : UTF-8 Plain Text
    Language : Japanese
    Default : Yes
    Forced : No
  Menu
    00:00:00.054 : en:00:00:00.054 / en:00:00:00.054

Someone else may notice other differences but the only major difference that I noticed is that one has "Frame rate mode : Constant" while the other is set to variable. The Variable one is the one with problems. Not 100% sure this is the problem but what I did that appears to have fixed the problem file was check the box under "MEncoder" "Force framerate parsed from FFmpeg." After doing that the audio and video appeared to be synced much more closely (not sure if it's good enough but it's way better).

Edit: Okay, finally success! I determined that if I went into the transcode folder when pulling up the video on the PS3, and pick the FFmpeg Audio then it plays perfectly with no visible sync issues. Not sure why I couldn't figure out how to make it do that from the options side but I'm happy.
silverbow25
 
Posts: 6
Joined: Fri Apr 19, 2013 5:11 pm

Re: MKV Audio / Video Sync issues

Postby ExSport » Sat Apr 20, 2013 7:00 am

First file also has audio delay present, small but it is there:-)
When Alternate A/V sync settings is ticked, it ignores audio delay. Try to untick this settings.
Also with more cores (>2) the a/v sync issues grow due to bug in MEncoder. And yes, ffmpeg is much better with a/v sync but not so many features include right now.
ExSport
 
Posts: 2168
Joined: Mon Jan 19, 2009 5:40 pm

Re: MKV Audio / Video Sync issues

Postby silverbow25 » Wed Apr 24, 2013 8:59 pm

Well I found out the hard way that the reason my solution worked was because the video I needed to work had hard subtitles, for any video that does not have hardsubs this fix isn't going to work for me because ffmpeg has no subs and I can't figure out how to get it to have subs.

I also could not verify what you said about the multi-core processor bug. I do have a triple core processor so I went in and under general transcoding set it to "2" instead of "3," no difference. I also uncheck used multi-core processing under mencoder's options, still no difference. So if it's a rendering bug to do with multi-core processing I sure can't prove it.

So now I need to either figure out how to make ffmpeg do subs or figure out how to fix mencoder no amount of changing the settings has been successful for me yet.

Also I can hear the audio starting almost a second late on a file I have now, and checking the alternative method for A/V Sync makes no visible difference on that.

_edit: Well I'm stuck. I don't know a good solution besides hardsubbing all the files that I have which I'd prefer to avoid. I sure can't figure out a solution for these files:
Code: Select all
D:\Videos\Movies & Shows\Bleach\(Hi10)_Bleach_-_001_(480p)_(Arigatou).mkv
  General
    Unique ID : 179532892599664137127369790011688073518 (0x8710C702C5171C2F90E8601E0E63B92E)
    Complete name : D:\Videos\Movies & Shows\Bleach\(Hi10)_Bleach_-_001_(480p)_(Arigatou).mkv
    Format : Matroska
    Format version : Version 2
    File size : 56.8 MiB
    Duration : 22mn 59s
    Overall bit rate : 346 Kbps
    Movie name : Shinigami ni natchatta hi --- The Day I Became A Shinigami
    Encoded date : UTC 2012-07-15 11:10:05
    Writing application : mkvmerge v4.9.1 ('Ich will') built on Jul 11 2011 23:53:15
    Writing library : libebml v1.2.1 + libmatroska v1.1.1
  Video #1
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High 10@L4.0
    Format settings, CABAC : Yes
    Format settings, ReFrames : 16 frames
    Muxing mode : Header stripping
    Codec ID : V_MPEG4/ISO/AVC
    Duration : 22mn 59s
    Width : 720 pixels
    Height : 480 pixels
    Display aspect ratio : 4:3
    Frame rate mode : Constant
    Frame rate : 23.976 fps
    Standard : NTSC
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 10 bits
    Scan type : Progressive
    Writing library : x264 core 125 r2200 999b753
    Encoding settings : cabac=1 / ref=16 / deblock=1:1:2 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=0.40:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=24.0 / qcomp=0.60 / qpmin=0 / qpmax=81 / qpstep=4 / ip_ratio=1.40 / aq=1:0.60
    Language : English
    Default : Yes
    Forced : No
  Audio #2
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : A_AAC
    Duration : 22mn 59s
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Compression mode : Lossy
    Title : Audio
    Language : Japanese
    Default : No
    Forced : No
  Text #3
    ID : 3
    Format : UTF-8
    Codec ID : S_TEXT/UTF8
    Codec ID/Info : UTF-8 Plain Text
    Title : Subtitles
    Language : English
    Default : Yes
    Forced : No
  Menu
    00:00:00.000 : en:Chapter 1
    00:01:30.400 : en:Chapter 2
    00:08:52.334 : en:Chapter 3
    00:21:39.801 : en:Chapter 4
    00:22:39.334 : en:Chapter 5

_edit: Anyone know how far off ffmpeg is from having subtitle support?
silverbow25
 
Posts: 6
Joined: Fri Apr 19, 2013 5:11 pm

Re: MKV Audio / Video Sync issues

Postby silverbow25 » Wed May 01, 2013 2:47 am

I still have made no headway on this. I don't suppose anyone else see's something that I'm missing?
silverbow25
 
Posts: 6
Joined: Fri Apr 19, 2013 5:11 pm

Re: MKV Audio / Video Sync issues

Postby dudius » Wed May 01, 2013 5:15 pm

I've had no success with .mkv files. The only remedy I have found was to convert into a different file such as .mp4 or .avi. I downloaded Any Video Converter and it has been fine for me other than the inconvenience of waiting for files to convert.
dudius
 
Posts: 2
Joined: Mon Apr 22, 2013 8:45 am

Re: MKV Audio / Video Sync issues

Postby silverbow25 » Wed May 01, 2013 7:08 pm

I've actually had plenty of success with MKV's just not with a few that I run into. I really wish I could tell what is different about the files that don't work versus the ones that work perfectly. Yes, converting them would almost assuredly fix this problem. The reason I do not want to do that is these are 10-bit MKVs which is a relatively new compression process which allows files to be about half the size they normally are at this resolution and quality with no quality loss.

When you are talking about 32 GB of video vs 60 GB with the smaller file size, if anything, looking better, I'll choose the smaller ones every time.
silverbow25
 
Posts: 6
Joined: Fri Apr 19, 2013 5:11 pm

Re: MKV Audio / Video Sync issues

Postby happy.neko » Wed May 01, 2013 10:47 pm

try playing problem files with ffmpeg engine (through TRANSCODE folder) or check/uncheck "keep AC3 track" and "use LPCM audio" options
happy.neko
Project Member
 
Posts: 478
Joined: Fri Sep 23, 2011 5:38 pm

Re: MKV Audio / Video Sync issues

Postby silverbow25 » Fri May 03, 2013 12:39 am

ffmpeg engine works flawlessly. That has been my solution for some files, but it only works with the files that have hardsubs because ffmpeg doesn't support softsubs yet. The files that I am trying to find a solution to now do not have hardsubs so I cannot use ffmpeg for them and I have tried both checked/uncheck AC3 track and use LPCM audio, but I will try again just in case.

update - tried all of the following combinations:

checked - use lpcm
checked - keep ac-3 track

un-checked - use lpcm
un-checked - keep ac-3 track

un-checked - use lpcm
checked - keep ac-3 track

checked - use lpcm
un-checked - keep ac-3 track

With the Bleach video I can tell within the first 3 seconds that it is out of sync because there is a sound that is supposed to happen right before a section in the video (which it does with ffmpeg) but every time I play it with mencoder that audio happens too late. Is the fact that I can tell it's off in the first few seconds a hint as to what the problem is?
silverbow25
 
Posts: 6
Joined: Fri Apr 19, 2013 5:11 pm

Re: MKV Audio / Video Sync issues

Postby ch2375 » Sat Jun 08, 2013 4:24 am

Did you try disabling the "Use Multiple CPU Cores" setting for MEncoder? ExSport pointed out that there is a bug with MEncoder with >2 CPU cores. I used this to address the sync issue with DVD iso's, but I don't know how it will work with MKV files.
ch2375
 
Posts: 1
Joined: Sat Jun 08, 2013 4:19 am


Return to General Help and Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 15 guests