Comments (32)
Hey @supermoos can you try disabling the Prepare on Awake
boolean then trying again? Let me know if the issue persists.
from videokit.
from videokit.
What device and OS version are you recording on? Can you share the full logs from app start in a .txt
attachment? Make sure to capture all logs (no filtering).
from videokit.
This looks to be device-specific at first glance.
from videokit.
Disabling prepare on wake worked at least one time now. Here's the log with prepare on wake enabled.
log.txt
from videokit.
log_no_prepare_on_wake.log
Here's one that failed even though prepare on awake was not checked.
from videokit.
What device and OS version is this? This issue is device-specific:
Warn CCodec previous call to queue exceeded timeout
Error MediaCodec Codec reported err 0x80000000, actionCode 0, while in state 6
One last thing to try is to record at 1280x720 and see if that helps.
from videokit.
It's a Google Pixel 4, Android Version 11
from videokit.
Try out 1280x720 and let me know if that has the same behaviour.
from videokit.
1280x720_prepare_on_wake.log
It works when prepare on wake is not checked, however when it is checked it only works the first time the scene is loaded, if I unload it, and load it again the above log errors appear.
from videokit.
This is an device-specific bug. From the logs:
Warn CCodec previous call to queue exceeded timeout
Then everything from there fails and the errors cascade. We have to improve error handling so that the logs don't get spammed with IllegalStateException
, but that isn't the actual issue here. I'm closing this issue.
from videokit.
Minor note on this: NatCorder doesn't actually have a timeout for how long it's willing to wait for the encoder. We ask to wait infinitely until the encoder is ready to give us a buffer to use.
from videokit.
Okay, well is there some workaround maybe? It's also an issue on another device I tested on (pixel3a, android 10, api 29).
Log attached.
pixel3a.txt
from videokit.
Just did another test on a Lenovo YT-J706f android 11 api 30 - it also throws a bunch of errors and outputs a completely black video.
lenovo_yt_j706f_android_11_api_30.txt
from videokit.
The second time I try a recording on the Lenovo it works.
from videokit.
And here's another failed test on a Pixel 4A, Android 13, SDK 33.
pixel4a_android13_sdk_33.txt
from videokit.
It works fine on a Pixel 7. However that's a lot of devices that don't work / work very flaky - I'm not entiely sure I would write it off as a device issue without at least providing better error handling, perhaps including some fallback configurations that could be retried. My understanding was that MP4 recording and api level 24+ was suppose to be the only minimum requirements for it to work? But maybe I'm missing something? :-)
from videokit.
Okay, well is there some workaround maybe? It's also an issue on another device I tested on (pixel3a, android 10, api 29).
Log attached.
Same error:
Warn CCodec previous call to queue exceeded timeout
Error MediaCodec Codec reported err 0x80000000, actionCode 0, while in state 6
Just did another test on a Lenovo YT-J706f android 11 api 30 - it also throws a bunch of errors and outputs a completely black video.
Info MPEG4Writer setStartTimestampUs: 105257
Info MPEG4Writer Earliest track starting time: 105257
Warn MPEG4Writer Condition timestampUs >= 0LL failed for Video track
Error MPEG4Writer Dumping Video track's last 1 frames' timestamps(pts, dts) and frame type :
Error MPEG4Writer (0us, 0us Key frame)
This seems to be complaining about negative timestamps, but that can't be the case since timestamps generated for recording are guaranteed to be monotonic. The only potential issue, which is also extremely unlikely, is if pixel buffers are being committed out of order. One way to test this is to set your app to render with OpenGL ES3 in Player Settings, then add the following code before you start recording:
NatML.Recorders.TextureInput.UseGLESTextureInput = false;
And here's another failed test on a Pixel 4A, Android 13, SDK 33.
Same as the other Pixel errors:
Warn CCodec [c2.qti.avc.encoder] previous call to queue exceeded timeout
Error MediaCodec Codec reported err 0x80000000/UNKNOWN_ERROR, actionCode 0, while in state 6/STARTED
I can't help but notice that for the 4-5 seconds where you record, there are no logs being generated:
2023/05/03 **10:01:38.048** 9589 14287 Info MPEG4Writer Earliest track starting time: 0
2023/05/03 **10:01:42.452** 9589 9617 Info Unity Stop recording
Are you filtering logs? If so, please refrain from doing that cos I need to see everything.
from videokit.
I haven't configured any filtering. The logs are from the Unity Android Logcat window. The filtering is set to verbose?
I just ran another test on pixel 7 and this time it started throwing errors and produced a fully black video.
Logs attached.
pixel7_error.txt
from videokit.
Same error as the Lenovo:
Info MPEG4Writer setStartTimestampUs: 5126
Info MPEG4Writer Earliest track starting time: 5126
Warn MPEG4Writer Condition timestampUs >= 0LL failed for Video track
Error MPEG4Writer Dumping Video track's last 1 frames' timestamps(pts, dts) and frame type :
Error MPEG4Writer (0us, 0us Key frame)
Did you try out what I mentioned above?
from videokit.
Do you mean like the screenshot?
I'm getting a compile error with the code snippet you provided:
Assets/game_doodles/Scripts/GameManager.cs(133,13): error CS0234: The type or namespace name 'TextureInput' does not exist in the namespace 'NatML.Recorders' (are you missing an assembly reference?)
Let me know if it's easier to jump in discord on a call or something.
from videokit.
Oops, missed a namespace:
NatML.Recorders.Inputs.TextureInput.UseGLESTextureInput = false;
from videokit.
Yes that seems to work on the pixel 7 at least the two times I've tested now.
Here's the log. However I'm not. sur eof the implication of switching the graphics API for my app. Shouldn't it work without this non-default setup too?
from videokit.
It also works on the lenovo.
lenovo_working_es3.txt
from videokit.
The pixel 4 still doesn't work however.
pixel4_es_not_working.txt
from videokit.
The pixel 4a worked on the first run, second run failed.
pixel4a_second_run_error_es3.txt
from videokit.
Yes that seems to work on the pixel 7 at least the two times I've tested now.
Here's the log. However I'm not. sur eof the implication of switching the graphics API for my app. Shouldn't it work without this non-default setup too?
This means that the pixel readback buffers are likely out of order. Your app was rendering with Vulkan before, which means that it's a bug from Unity's implementation of AsyncGPUReadback
. The readbacks don't seem to be coming back in the same order as they were requested.
The pixel 4 still doesn't work however.
Same error:
Warn CCodec previous call to queue exceeded timeout
Error MediaCodec Codec reported err 0x80000000, actionCode 0, while in state 6
The pixel 4a worked on the first run, second run failed.
Same error:
Warn CCodec [c2.qti.avc.encoder] previous call to queue exceeded timeout
Error MediaCodec Codec reported err 0x80000000/UNKNOWN_ERROR, actionCode 0, while in state 6/STARTED
from videokit.
TL;DR: For the Pixel 4s, it's device-specific. And for the Pixel 7 and Lenovo, it's a Unity bug.
from videokit.
Okay, is it something you're planning to add work arounds for, since effectively you're solution (we have a subscription for) is not working on a whole bunch of Android devices? Happy to help out in any way I can with debugging.
from videokit.
Okay, is it something you're planning to add work arounds for.
We might be able to add a workaround for the timestamp issue on the Pixel 7. As for the Pixel 4, there isn't anything we can do; it's a device-specific issue.
since effectively you're solution (we have a subscription for) is not working on a whole bunch of Android devices
We don't have any other reports of this, so it seems "whole bunch of Android devices" only refers to the Pixel 4 series. Except you have more?
from videokit.
The Pixel 3A also exhibits the same issue. Would be great with a workaround for the pixel 7, and perhaps better error handling for the devices you're unable to support.
from videokit.
Added workarounds for Pixel 7 in latest VideoKit alpha build.. I'm closing this issue.
from videokit.
Related Issues (20)
- White shadows issue in JPEG image sequence in iOS AR app having linear color space
- Intermittent crash when ending recording with audio
- Compiler errors when updating Function package to version 0.0.7 for VideoKit version 0.0.18-alpha.4 in Unity version 2022.3.16f1 HOT 4
- Add method for reading images from a video `MediaAsset` HOT 1
- 0.0.18-alpha.4 can't add components anymore HOT 1
- 0.0.18-alpha.4 unable to record HOT 7
- 0.0.18-alpha.6: Microphone sample data too large HOT 5
- CloudPrediction class does not exist in new version of Function HOT 2
- Assembly for Vision Pro HOT 3
- Crash Android when switching between VideoKit and ARCore HOT 2
- Crash on IOS - VKTRecorderCommitSamples HOT 6
- Audio Listener as source for audio in video recording produces no sound in the output HOT 2
- Feature Request: Share text only HOT 1
- `CameraDevice.focusPointSupported` is always `false` HOT 1
- VideoKit breaks Live Wallpaper on Android HOT 4
- I am using NatCorder in Unity in Windows DllNotFoundException: NatCorder HOT 3
- Only initialize VideoKit when it get's actually used HOT 4
- Failed to create MLModel from graph data - with VideoKit 0.0.17 - crash or no image from camera. HOT 2
- Add basic video edition capabilities HOT 1
- Memory Leak on VideoKitCameraManager HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from videokit.