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

[Enhancement][iOS] Reduce delay on first call to StartCapture #389

Open
makakaorg opened this issue May 16, 2024 · 1 comment
Open

[Enhancement][iOS] Reduce delay on first call to StartCapture #389

makakaorg opened this issue May 16, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request iOS

Comments

@makakaorg
Copy link

makakaorg commented May 16, 2024

Unity Version

2022.3.29

AVPro Movie Capture Version

5.2.4-Mobile Edition build 1387

Which platform(s) are you using?

iOS

Which OS version(s) are you using?

iOS 17.5

Which rendering API(s) are you using?

Metal

Hardware

iPhone XS Max

Which capture component are you using?

Capture From Screen

Capture mode

Realtime

Which output mode are you using?

Video file

Video codecs

H264

Audio source

Microphone

Audio codecs

AAC

Any other component configuration

No response

The issue

Environment:

  • BiRP
  • 60 FPS Fullsize Recording
  • Camera spin.

On default Screen Capture Demo after installing the app on iPhone,
there is a noticeable freeze in the first few starts of recording (about a 1 second).

Then the freeze is not noticeable, but it is there.


I tested the code in Another Environment:

  • URP
  • AR Foundation + Face Tracking
  • 60 FPS Fullsize Recording.

I have noticeable freeze (> 1 sec) every screen recording.

How can this be fixed?

P.S. I compared with Camera app by Apple, and there is no such freezing behavior.

Log output

No response

@makakaorg makakaorg added the Bug 🐛 Something isn't working label May 16, 2024
@Chris-RH Chris-RH added the iOS label May 24, 2024
@MorrisRH
Copy link
Contributor

There is a noticeable pause the first time StartCapture is called due to the system having to load the necessary frameworks. For subsequent calls to StartCapture this work is no longer required. We are looking into ways we can improve this.

When capturing from microphone there is extra overhead if we need to change the audio session to support recording. This can be alleviated by making sure Prepare iOS for Recording is checked in the Unity player settings inspector panel, or by calling NativePlugin.SetMicrophoneRecordingHint(true, NativePlugin.MicrophoneRecordingOptions.None); prior to starting a capture at a point where a pause in frame rate is acceptable.

@MorrisRH MorrisRH added enhancement New feature or request and removed Bug 🐛 Something isn't working labels Aug 29, 2024
@MorrisRH MorrisRH changed the title [Bug] Freeze on Starting Screen Capture [Enhancement][iOS] Reduce delay on first call to StartCapture Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request iOS
Projects
None yet
Development

No branches or pull requests

3 participants