UnityPlugin-AVProMovieCapture icon indicating copy to clipboard operation
UnityPlugin-AVProMovieCapture copied to clipboard

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

Open makakaorg opened this issue 1 year ago • 3 comments

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 avatar May 16 '24 20:05 makakaorg

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 avatar Aug 29 '24 11:08 MorrisRH

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.

stale[bot] avatar Apr 26 '25 01:04 stale[bot]

This issue has been automatically closed because it has not had recent activity. If you wish to continue this issue, then please create a new issue as we do not monitor closed issues.

stale[bot] avatar May 06 '25 05:05 stale[bot]