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

[Bug] Switching Application causes frozen frame in recording. The amount of time with a frozen frame equals the amount of time of pausing #411

Closed makakaorg closed 2 months ago

makakaorg commented 4 months ago

Unity Version

2022.3.38

AVPro Movie Capture Version

5.3.0 Mobile Edition

Which platform(s) are you using?

iOS

Which OS version(s) are you using?

iOS 17.5.1

Which rendering API(s) are you using?

Metal

Hardware

iPhone 15

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

  1. App Switching: capturing pauses automatically.
  2. App Switching Back: capturing continues automatically.
  3. Video Saving by Button in the App.

The Resulting Video Duration equals the difference in time from Start to Stop, including Pause Time. During Pause Time, there is the last frozen frame without audio.

So, the pausing is not working.

Log output

1. 

-> applicationWillResignActive()

OnApplicationPause: pausing video capture
-> applicationDidEnterBackground()

2.

-> applicationWillEnterForeground()
-> applicationDidBecomeActive()

OnApplicationFocus: capturing video again

3. 

[AVProMovieCapture] Stopping capture 60240
RenderHeads.Media.AVProMovieCapture.CaptureBase:StopCapture(Boolean, Boolean, Boolean)

🔹 Stopping capture...
🟩 Video capture finished.
🟩 Audio capture finished.
🔹 Stopped, writing file...
🔹 Successfully added captured video to photos
🟩 Asset added to photo library with URL: file:///var/mobile/Media/DCIM/120APPLE/IMG_0971.MP4
🔹 Finished writing
🟩 deallocating instance <MCVideoRecorder: 0x105f5f3d0>

CompletedFileWritingAction - updating LastFileSaved to file:///var/mobile/Media/DCIM/120APPLE/IMG_0971.MP4
RenderHeads.Media.AVProMovieCapture.<>c:<StopCapture>b__361_0(FileWritingHandler)
RenderHeads.Media.AVProMovieCapture.FileWritingHandler:Dispose()
RenderHeads.Media.AVProMovieCapture.FileWritingHandler:IsFileReady()
RenderHeads.Media.AVProMovieCapture.FileWritingHandler:Cleanup(List`1)
ARMasksCameraModesControl:Update()

Video Recording — all pending file writes completed
🟩 deallocating instance <MCVideoCaptureMetal: 0x300626ae0>
🟩 deallocating instance <MCAssetWriterInputPixelBufferAdaptorVideoCaptureOutput: 0x30092ad00>
makakaorg commented 4 months ago

There is also random experience when video is not saved at 3rd step

MorrisRH commented 2 months ago

This has been fixed and will make it into the next release.

MorrisRH commented 2 months ago

There is also random experience when video is not saved at 3rd step

Not sure what you mean by this but hopefully the fix for the capture not being paused will cover it.

Chris-RH commented 2 months ago

This has been fixed in AVPro Movie Capture version 5.3.1. Please let us know if your issue is not resolved.