Closed orbitalnine closed 1 month ago
Its probably a memory thing.
Can you provide a full, unfiltered logcat in txt format please What android device are you using for testing? Is this occurring in Windows editor too or just your Android device? Is this reproducible in a new project, running only AVPro Movie Capture?
Do you have an email I can send the log to? The full log contains too much information about my public product in it.
On Windows/Mac the recording seems to work ok. Just Android and iOS have problems.
I think your email address was censored by your email server/client. Can you post on github directly?
I'll just add my logcat file here logcat.txt
ahh, ok, that's good to know. I knew that email replies didn't include any attachments, but I wasn't aware that it would censor email addresses. For future reference, our support email is unitysupport@renderheads.com
I'm not seeing any log output for the captures being stopped in the logical provided, there should be something like the following:
[AVProMovieCapture] Stopping capture 53472
I'm calling
if (Recorder.IsCapturing()) { Recorder.StopCapture(false, false, true); } CaptureBase.DeleteCapture(Recorder.OutputTarget, Recorder.LastFilePath);
when retrying a level
The only output line with "[AVProMovieCapture]" is "[AVProMovieCapture] Failed to create recorder" when the recording fails. There are lines like 2024-09-12 11:54:17.625 14572 15316 Debug MPEG4Writer Video track source stopping after each retry though
Also, if I call
if (Recorder.IsCapturing())
{
Recorder.StopCapture(true, true, true);
}
it immediately crashes the game logcat_crash.txt
File writing is asynchronous on Android and iOS so when you call StopCapture it might not complete the file writing process immediately. Calling StopCapture(false, false, true)
will delete the file when the recorder has finished so you should not need to call DeleteCapture directly and doing so might be harmful.
I can't reproduce a crash when calling StopCapture(true, true, true)
.
The crash on StopCapture(true, true, true) happens everytime for me. This is on a Pixel 6, Android 14.
When I profile the demo project on my Android device I see memory is freed up when pressing the stop recording button. When I profile my project most of the memory is not freed up when stopping recording. A little bit is but most is not, so if i start/stop many times eventually I run out of memory. Is there something I should be doing to trigger the memory to be cleaned up when stopping a recording? Any settings for the video recorder that I should look at? I'm just calling StartCapture() at the start of a game level, and StopCapture() at the end. Is there something I'm missing?
Here's what the memory looks like when start/stop recording 3 times:
Are you unloading the scene before the capture has completed?
No. It looks like I missed the code in the demo for the cleanup. It seems a bit weird to manage the cleanup myself in an update loop, but it's working now. I'll close both of the issues i opened.
public void Update() { if (FileWritingHandler.Cleanup(m_fileWritingHandlers)) { if (m_fileWritingHandlers.Count == 0) { Debug.Log("All pending file writes completed"); } } }
Unity Version
2021.3.39
AVPro Movie Capture Version
5.3.0f1-trial (scripts v5.3.1)
Which platform(s) are you using?
Windows, Android
Which OS version(s) are you using?
Windows 11, Android 14
Which rendering API(s) are you using?
OpenGLES
Hardware
No response
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
None
Audio codecs
AAC
Any other component configuration
Output Folder: Relative To Persistent Data
The issue
I can record video on Android about 10-20 times (short clips under 10s), eventually though recording fails with the error in the Log output below.
My game is a difficult physics drawing game and requires many retries to solve a level. I want to record all of the attempts, and throw them away, and just save the final good solution video.
Log output