Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demuxed audio stream off sync with video stream on longer duration Hap video files in Windows #2013

Open
jsquared90 opened this issue Sep 25, 2024 · 9 comments
Labels
Windows Windows platform

Comments

@jsquared90
Copy link

The demuxed audio stream drifts out of sync from the video stream on Hap videos with a duration over 3 minutes. Does not occur in MacOS. Only occurs in Windows (tested in Windows 10).

  • Unity version: 2022.3.20f1
  • AVPro Video version (number and edition (trial/core/ultra/enterprise)): Ultra 3.0.11
  • Operating system version: Windows 10 Enterprise LTSC 64bit
  • Device model: OEM, Intel i9-10920X @3.5GHz, 32G, RAM NVIDIA Quadro RTX4000
  • Video specs (resolution, frame-rate, codec, file size): 1920x1080 23.976fps HapQ 7GB+

Load AVPro with the following video file and watch lip sync to the end:

https://www.dropbox.com/scl/fi/2p0pd1r5pgwdvh69q7hjm/davita_tlm_service_091824_7.mov?rlkey=oicn9q7f3a0uigdgzfnqzg4jf&dl=0

Within the final 30 seconds, A/V sync should appear off by several frames.

@Chris-RH Chris-RH added the Windows Windows platform label Sep 26, 2024
@RichRH
Copy link

RichRH commented Oct 10, 2024

Hi @jsquared90,

Thanks for reporting this - which Video API are you using?

I've just tried here and see fairly consistent frame drops using your video with Media Foundation (will look into separately) but DirectShow seemed more consistent.

Cheers,

@jsquared90
Copy link
Author

Hey there. My initial tests were with Media Foundation. Since then I have conducted more tests and have found success with A/V sync with legacy Hap formats using DirectShow as well. However, Hap-R failed to render anything using DirectShow. I also found that if I have the "Renderer Sync" setting disabled, I can get successful A/V sync when set to the Media Foundation API. However, I have found other issues, including A/V sync issues with NotchLC and all sorts of issues when using DX12 (all my success has been with DX11). I sent a separate email to you all to see how you recommend my correspondence on this platform of my findings. I wasn't sure how much you feel I should include in this topic and how much and when I should generate a new topic. Thx!

@jsquared90
Copy link
Author

After more testing, I discovered I must have been mistaken about the note regarding disabling "Renderer Sync" providing a solution to the issue. However, I am able to resolve the issue by using the Direct Show API. I learned that I just needed to install the latest LAV filters in order to get HapR to work using Direct Show. So I have a fully working solution that involves switching to the Direct Show API from the Media Foundation API (via code) for any Hap playback.

@jsquared90
Copy link
Author

jsquared90 commented Oct 24, 2024 via email

@Chris-RH Chris-RH reopened this Oct 24, 2024
@RichRH
Copy link

RichRH commented Oct 24, 2024

Hi @jsquared90,

That's a shame - yeah, we're aware of DirectShow blocking the main thread whilst initialising and I'm actually in the process of rewriting the plugin, which includes shifting all video devices to their own threads for this reason.

I'm presuming due to the setup of your app there's no way to move the initialisation (/stall) elsewhere, leaving paused then playing at the appropriate point, in which case yeah, a bit of a conundrum!

We're pretty slammed at the moment and the progress of the rewrite is contigent on a few factors which make it hard to guarantee it'll be ready for Janurary - although there might be the possibility of a pre-release version.

In the meantime I will try and spend some time looking further into what might be causing the delay in MF, in case there are some quick wins..

Cheers,

@jsquared90
Copy link
Author

jsquared90 commented Oct 24, 2024 via email

@RichRH
Copy link

RichRH commented Oct 24, 2024

One quick thing to check @jsquared90 - with 'Media Foundation API Options' do you have 'Audio Output' set to 'System' or 'Unity'? As I'd expect 'System' to have less latency (and mirrors how DirectShow works)

Also, do you get any different results if you increase 'Parallel Frame Count' under 'Use Hap/NotchLC'?

@jsquared90
Copy link
Author

jsquared90 commented Oct 24, 2024 via email

@RichRH
Copy link

RichRH commented Oct 25, 2024

Hi @jsquared90,

The 'Unity' audio setting only works with Media Foundation and you should be able to see it set up in our 'Demo_MediaPlayer' - although I don't think it's worth visiting at this juncture as 'System' is most likely to be the best option here.

Apologies, I later updated the post but presume you only saw the original by email - note the addition: "Also, do you get any different results if you increase 'Parallel Frame Count' under 'Use Hap/NotchLC'?"

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Windows Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants