RenderHeads / UnityPlugin-AVProMovieCapture

AVPro Movie Capture is a Unity Plugin for advanced video capture to AVI/MP4/MOV files
https://renderheads.com/products/avpro-movie-capture/
49 stars 8 forks source link

Syncing of Audio and Video with Custom Listener #423

Closed dirtygilly closed 2 months ago

dirtygilly commented 2 months ago

Hello

I have build a custom audio "Capture from Audio Listener Component" script which inherits from UnityAudioCapture class, to incorporate two audio sources (microphone and screen) based on this post https://github.com/RenderHeads/UnityPlugin-AVProMovieCapture/issues/96 and this code https://gist.github.com/WikkidEdd/35fea92260b95135d6837188006919dc.

It works great! However I get a creeping audio-video synch. I thought it may be my custom plugin processing time but the audio runs ahead of the video.

Do you have any suggestions on how to address or trouble shoot the problem?

Thanks!

dirtygilly commented 2 months ago

The difference is hardly noticeable at the start but it is about 2 to 3 seconds, 2 to 3 minutes into the video. When I examined the captured FrameRate/framespersecond and EncodedSeconds on the CaptureStats property, there appears to be the same time differential. But maybe I am not understand these correctly

Chris-RH commented 2 months ago

We don't officially support capturing audio from multiple sources, and that workaround is something that a user coded for themselves, so its not really anything to do with us.
That said, could you provide more info and maybe a basic test project to unitysupport@renderheads.com, then there might be something that we can do. A sample of the video recorded would also be helpful, thanks. Also, please make sure that you have updated to the latest version of AVPro Movie Capture and retested to make sure that the issue lies with the most recent version.

  1. Unity Version
  2. AVPro Movie Capture Version
  3. Which platform(s) are you using?
  4. Which OS version(s) are you using?
  5. Which rendering API(s) are you using?
  6. Hardware
  7. Which capture component are you using?
  8. Capture mode
  9. Which output mode are you using?
  10. Video codecs
  11. Audio source
  12. Audio codecs
  13. Any other component configuration
  14. Log output
dirtygilly commented 2 months ago

After giving it some thought, I think it is a bit rate misalignment between the video and audio, given the audio runs ahead i.e. too few audio samples streamed. Switching between 2 sources is probably causing or making it worse. I am going to trouble shoot down this path a bit more and will reopen this ticket, if needs be. If you do think of something or have suggestions, that would be helpful as well. Thanks for your prompt responses.