INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: codec specific lip sync? [Solved]  (Read 3838 times)

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4195
codec specific lip sync? [Solved]
« on: January 12, 2014, 07:19:26 am »

I am in the midst of a new htpc setup and have noticed that vc1 encoded blurays (from disc or ripped to file server) suffer from bad lip sync compared to mpeg4 encoded blurays or DVDs. There are no rendering errors, stuttering or any other flaws except the sync is off by some amount.

This seems odd as I thought jriver handled this apart from any fixed hardware based delay.

How should I fix this? Can I set a rule to vary lip sync by codec?

Hardware is an i3-4340 (hd4600 igp) with an external FireWire audio device (focusrite saffire pro 24) and using ROHQ.

Thanks
Matt
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14408
  • I won! I won!
Re: codec specific lip sync?
« Reply #1 on: January 12, 2014, 02:01:30 pm »

Hi Matt,
I'd suggest it is worth tracking down what is causing the lip sync and fix that, as it should all be in sync regardless of codec.  Have a look at the options under Tools --> Video and for now make sure the Video Mode is "Red October Standard".  Is there a difference with Hardware acceleration on or off?
Thanks
Nathan
Logged
JRiver CEO Elect

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: codec specific lip sync?
« Reply #2 on: January 12, 2014, 02:32:46 pm »

I agree with jmone that you should spend more time resolving the lip sync issue. All the codecs should be synced properly.

If you can't find the solution and want a different lip sync for VC1 movies, then you need to add a Zone and setup ZoneSwitch (Player > Zone ZoneSwitch). This will let you use one Zone for VC1 and another Zone for all other video. I currently have Movie, DVD, and Concert video zones.
Logged

Trumpetguy

  • Citizen of the Universe
  • *****
  • Posts: 974
Re: codec specific lip sync?
« Reply #3 on: January 12, 2014, 03:52:50 pm »

I am in the midst of a new htpc setup and have noticed that vc1 encoded blurays (from disc or ripped to file server) suffer from bad lip sync compared to mpeg4 encoded blurays or DVDs. There are no rendering errors, stuttering or any other flaws except the sync is off by some amount.

This seems odd as I thought jriver handled this apart from any fixed hardware based delay.

How should I fix this? Can I set a rule to vary lip sync by codec?

Hardware is an i3-4340 (hd4600 igp) with an external FireWire audio device (focusrite saffire pro 24) and using ROHQ.

Thanks
Matt

I have also noticed weird results sometimes with VC-1. But when lipsync is off it has always been traced back to hardware not being up to the task. And you are running an i3 with internal graphics AND ROHQ. I would think this combo may be a bit to weak for vc-1 blurays?
Logged

kstuart

  • Citizen of the Universe
  • *****
  • Posts: 1955
  • Upgraded to MC22 Master using preorder discount
Re: codec specific lip sync?
« Reply #4 on: January 12, 2014, 06:24:51 pm »

I had a lip sync problem yesterday in ROHQ, and it went away when I switched to a less resource intensive chroma scaler.

They are generally caused by CPU or GPU over-taxed.

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4195
Re: codec specific lip sync?
« Reply #5 on: January 13, 2014, 03:25:44 am »

Hi Matt,
I'd suggest it is worth tracking down what is causing the lip sync and fix that, as it should all be in sync regardless of codec.  Have a look at the options under Tools --> Video and for now make sure the Video Mode is "Red October Standard".  Is there a difference with Hardware acceleration on or off?
Thanks
Nathan
hardware acceleration is currently off as it produces ugly decoding errors on some films.

I had a lip sync problem yesterday in ROHQ, and it went away when I switched to a less resource intensive chroma scaler.

They are generally caused by CPU or GPU over-taxed.
I will give this a try though neither shows as overloaded in taskmanager/gpu-z during playback so I, perhaps naively, assumed that can't be the problem. Is there a better (aka more granular) way to interrogate gpu/cpu load?

I am leaning towards just throwing hardware at the problem (probably a GTX660) as finding a combination of options that each of the 1st 5-6 films I've ripped seems to want a different set of options to remain stable. This is not a recipe for a quiet life :)
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: codec specific lip sync?
« Reply #6 on: January 13, 2014, 05:06:14 am »

Check to see if the "Delay Playback..." options are enabled in the madVR configuration.
I find that I get lip-sync problems with some videos if it's not enabled. (possibly VC-1, but I don't think I ever narrowed it down to anything specific)
 
Logged

leezer3

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1587
Re: codec specific lip sync?
« Reply #7 on: January 13, 2014, 06:23:07 am »

hardware acceleration is currently off as it produces ugly decoding errors on some films.
I will give this a try though neither shows as overloaded in taskmanager/gpu-z during playback so I, perhaps naively, assumed that can't be the problem. Is there a better (aka more granular) way to interrogate gpu/cpu load?

I am leaning towards just throwing hardware at the problem (probably a GTX660) as finding a combination of options that each of the 1st 5-6 films I've ripped seems to want a different set of options to remain stable. This is not a recipe for a quiet life :)


Try CTRL+J and see what the MadVR stats say- It'll tell you if it's dropping or delaying frames. If so, look at backing off the scalers.

Even though the CPU & GPU aren't showing full load, there's always the possibility of a driver bug somewhere along the line which prevents this :)

-Leezer-
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4195
Re: codec specific lip sync?
« Reply #8 on: January 13, 2014, 06:33:49 am »

I have tried everything I can think of and I cannot get it in sync

* removed the "delay playback til queues full" options
* dialled back all settings in madvr to the least intensive options
* switched to RO Standard
* repeat all the above with hardware acceleration on & off
* some of the audio device settings around buffering (was guessing at this point)

I monitored cpu/gpu load & temps throughout, the system is absolutely not under any obvious load. CPU usage is ~15% with hw acceleration off and ~25% with it on, GPU usage gets to 40-50% (and hence temps barely change). madvr reports not dropped/repeated frames except a small number at the start of playback or on skipping, it shows a total time of about 4.5ms per frame and it's at 23.976 so has about 40ms or so.

I then added a fixed sync and it seems to be somewhere in the region of 200-220ms out which seems a lot.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: codec specific lip sync?
« Reply #9 on: January 13, 2014, 06:50:37 am »

Oh, one other thing which could potentially be causing you problems.
When you're using anything other than HDMI, your video and audio will be out of sync. (HDMI should be able to keep things in sync with recent hardware)
 
The display will have some amount of latency, and this may vary depending on the refresh rate being displayed, and the options you have enabled. (e.g. motion interpolation often adds 100ms+ when enabled)
You audio hardware will also be adding some amount of latency, and this likely varies depending on the sample rate being played. With an ASIO buffer size of 8192 samples, 44.1kHz audio will have a latency of 186ms, and 192kHz audio will have a latency of 43ms. I upsample everything to 192kHz to prevent this from changing.
And Media Center/the PC itself will have some amount of latency being added as well.
 
This could easily add up to over 200ms. In my case, it all adds up to 136ms for video playback. (when my TV is in "Film mode" rather than "PC/Game" mode where it's <30ms)
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4195
Re: codec specific lip sync?
« Reply #10 on: January 13, 2014, 08:04:16 am »

Oh, one other thing which could potentially be causing you problems.
When you're using anything other than HDMI, your video and audio will be out of sync. (HDMI should be able to keep things in sync with recent hardware)
 
The display will have some amount of latency, and this may vary depending on the refresh rate being displayed, and the options you have enabled. (e.g. motion interpolation often adds 100ms+ when enabled)
You audio hardware will also be adding some amount of latency, and this likely varies depending on the sample rate being played. With an ASIO buffer size of 8192 samples, 44.1kHz audio will have a latency of 186ms, and 192kHz audio will have a latency of 43ms. I upsample everything to 192kHz to prevent this from changing.
And Media Center/the PC itself will have some amount of latency being added as well.
 
This could easily add up to over 200ms. In my case, it all adds up to 136ms for video playback. (when my TV is in "Film mode" rather than "PC/Game" mode where it's <30ms)
thanks for the info. Is there a recommended method for determining that delay other than eyeballing it?

If that is the root cause, I don't understand why it doesn't seem to be a problem for other codecs though. In fact, it seems more of a Q of why aren't the other codecs out of sync given that I am using HDMI for video only?
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: codec specific lip sync?
« Reply #11 on: January 13, 2014, 06:24:43 pm »

thanks for the info. Is there a recommended method for determining that delay other than eyeballing it?
Unfortunately I don't know of a way to get reliable results automatically.
 
If that is the root cause, I don't understand why it doesn't seem to be a problem for other codecs though. In fact, it seems more of a Q of why aren't the other codecs out of sync given that I am using HDMI for video only?
Is it possible that your VC1 videos are using 48kHz when others are using 96kHz or vice-versa?
 
I'd definitely try having everything upsampled to the maximum that your audio hardware supports to see if it helps.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4195
Re: codec specific lip sync?
« Reply #12 on: January 15, 2014, 04:04:39 am »

I spent some more time on this last night and determined that, with upsampling to 96kHz & 4096 asio buffer then my display (or at least my TV) needs ~150ms delay to correct the VC1 BD and that this seems to be consistent a 1080p24 MPEG-4 BD but not consistent with a 1080i30 MPEG-4 BD nor a DVD though playback of the latter was a bit glitchy last night. I hope this means the delay is simply different for 50/60Hz content and that the sync is consistent across displays (TV and PJ).

A new video card should arrive today so will tune further once I have that installed.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: codec specific lip sync?
« Reply #13 on: January 15, 2014, 04:41:49 am »

Many displays have a different delay with 24p because they do different video processing then.
MC has separate delay options for 24p and everything else, to accommodate for this situation.
Logged
~ nevcairiel
~ Author of LAV Filters

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4195
Re: codec specific lip sync?
« Reply #14 on: January 16, 2014, 05:46:38 am »

I have now switched to a GTX660 and I think this shows that I really was asking the igp to do something it couldn't & that separate delays for 24 and for 50/60 content is all I need. Thanks for the guidance to all who replied.
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14408
  • I won! I won!
Re: codec specific lip sync?
« Reply #15 on: January 16, 2014, 01:51:01 pm »

Glad it is sorted.  I have the 660 in my HTPC and it works nicely.
Logged
JRiver CEO Elect

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4195
Re: codec specific lip sync?
« Reply #16 on: January 16, 2014, 06:12:20 pm »

Unfortunately I don't know of a way to get reliable results automatically.
FWIW I was pointed at this from the BBC

http://www.bbc.co.uk/blogs/bbcinternet/2008/12/a_christmas_present_from_the_h.html

It is regularly broadcast on some BBC HD channels during the day apparently as well as being available on youtube & various places for download.
Logged

6233638

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 5353
Re: codec specific lip sync? [Solved]
« Reply #17 on: January 16, 2014, 07:57:13 pm »

I did not find the results I get with that test to be completely reliable, but thanks for the link anyway.
 
What I ended up doing was calculating the amount of latency of each component, adding it up, and then figuring out how much I needed to offset that by for whatever latency MC is adding itself.
 
I wish there was a product that had a photocell you place on the display and a 3.5mm input which would tell you exactly what the delay is - similar to the Leo Bodnar lag tester, but for audio and video rather than just video.
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14408
  • I won! I won!
Re: codec specific lip sync? [Solved]
« Reply #18 on: January 16, 2014, 08:17:27 pm »

I've use the BBC Clapper before and find it pretty good.  One suggestion made last year is to have a similar graphic but generated by MC itself that you could then just use say the Left / Right arrow to adjust the sync.  The graphic would need to be able to be natively generated at various frame rates and from this thread potentially different codecs.
Logged
JRiver CEO Elect

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4195
Re: codec specific lip sync? [Solved]
« Reply #19 on: January 17, 2014, 03:44:46 am »

I've use the BBC Clapper before and find it pretty good.  One suggestion made last year is to have a similar graphic but generated by MC itself that you could then just use say the Left / Right arrow to adjust the sync.  The graphic would need to be able to be natively generated at various frame rates and from this thread potentially different codecs.
That sounds like a great idea
Logged
Pages: [1]   Go Up