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

Local record audio desynchronization on camera switch #869

Closed
CubitSpeed opened this issue May 3, 2021 · 1 comment · Fixed by #1048
Closed

Local record audio desynchronization on camera switch #869

CubitSpeed opened this issue May 3, 2021 · 1 comment · Fixed by #1048
Labels

Comments

@CubitSpeed
Copy link
Contributor

Describe the bug
The audio becomes desynchronized for a local record if the camera is switched

To Reproduce
Steps to reproduce the behavior:

  1. Modify the iOS example to enable local recordings (add type: .localRecord to publish method)
  2. Start a stream
  3. Switch the camera from the rear to front camera
  4. Speak into the camera
  5. Switch back camera
  6. End stream
  7. Review local recording

Expected behavior
The local recording's audio should not have any desynchronization

Smartphone (please complete the following information):

  • Device: iPhone6s, iPhoneX
  • OS: iOS 12, iOS 14
  • Version: 1.1.5
@shogo4405 shogo4405 added the bug label May 4, 2021
@mkrn
Copy link

mkrn commented Nov 3, 2021

This seems to happen because the selfie or back camera is not immediately available, so it loses some frames while audio is still being written to output. Audio becomes ahead of video. It seems AVCaptureAudioDataOutput hangs while you switch cameras.

By the way the iPhone Camera doesn't let you switch while recording (probably due to the same issue)

Any idea @shogo4405? Can the video be re-synchronized with audio after the switch?

shogo4405 added a commit that referenced this issue Aug 15, 2022
…ding

fix #869 Local record audio desynchronization on camera switch
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants