RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
235 stars 28 forks source link

Pausing video causes audio delay #1501

Open Benjie95 opened 1 year ago

Benjie95 commented 1 year ago

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Describe the issue When I pause the video playback, the video image is paused instantly as it should, however, the audio takes a few seconds before pausing. When pausing again, both video and audio are paused synchronized, which is the case whenever it is paused again. The issue is only happening at the first pause, which causes the audio and video to not be in sync throughout the rest of the playback. I suspect the issue to be related to the Media Foundation since the pause function is working fine when building to Android.

Your Setup (please complete the following information):

Screenshots If applicable, add screenshots to help explain your problem.

image
Chris-RH commented 1 year ago

What sort of time difference are you getting? Have you tested different video/audio types?

Benjie95 commented 1 year ago

What are you referring to specifically with 'sort of time difference'? I haven't tested different types of video/audio. I need it to be able to work with this specific file with a .mkv container and Opus.

Chris-RH commented 1 year ago

What delay are you getting between the audio and video? During subsequent pause/unpause does it get back in sync, remain the same amount out of sync or become more out of sync? Are you able to send as a sample video please: unitysupport@renderheads.com

Benjie95 commented 1 year ago

Just send a sample now.

I'm getting a delay of approximately 2 seconds. During subsequent pauses, it remains the same amount out of sync.

Chris-RH commented 1 year ago

Ahh, I meant can you send me a sample of the MKV you are using please.

Chris-RH commented 1 year ago

Is there a chance to get a sample of the .mkv?

Benjie95 commented 1 year ago

Sorry for the delay. I've send an actual sample to unitysupport@renderheads.com now.

Chris-RH commented 1 year ago

I've had a quick look at the file. I'm wondering if the issue is caused by the difference in track lengths

Benjie95 commented 1 year ago

The difference in track length is only a couple of milliseconds. The delay I'm getting is around 3 seconds.

Chris-RH commented 1 year ago

I've just looked at it using MediaInfo Total Video Duration: 15 s 207 ms Video Duration: 12 s 0 ms Audio Duration: 15 s 0 ms Delay relative to video: -3 s 206 ms

Benjie95 commented 1 year ago

Possibly just an error when making the sample. This is the media info from the actual source clip:

image
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Benjie95 commented 1 year ago

any news on this? I'm still getting sync issues when pausing. The issue only occurs with the PC build - not the APK. The video file is the same in both cases.

Chris-RH commented 1 year ago

Have you tried ticking the "use low latency" box to see if there is any improvement? Are you able to send the actual file perhaps unitysupport@renderheads.com?

Benjie95 commented 1 year ago

I've tried doing so - no improvement. Will look into the possibility of sending you the entire file.