-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Use CameraX's recordedDuration in status event for video recorder's timer #438
Conversation
app/src/main/java/app/grapheneos/camera/capturer/VideoCapturer.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/app/grapheneos/camera/capturer/VideoCapturer.kt
Outdated
Show resolved
Hide resolved
This change occasionally causes video recording duration to be stuck at "0:00", not clear why. Saving the recording doesn't work produces the "this recording is too short to be saved" error. |
c55b496
to
485fff2
Compare
(only exactly when the recording starts)
Yes actually this happens because the recording does not directly start as soon as we call I have pushed some changes to only animate the UI when the recording starts, while the sound plays as the way it used to before If the recording is less than a second or half a second, it would most likely lead to an error like that. However, if it still happens after the latest changes (i.e. animating the UI and timer after CameraX notifies us about the recording starting), it could be a bug that might need to be reported |
Found a bug with latest changes, not sure if it's the same as the previous bug:
|
If the 00:00 red indicator shows up and then doesn't update later, this could be a bug of CameraX. It implies that For me, it's showing the counter as expected on first launch/attempt to record the video, but then end up with the same "recording is too short" error. The subsequent recording attempts seem to work as expected even for durations shorter than a second although. Edit: I'm able to reproduce it just as you right now, neither the Start nor Status event seems to get trigged and we end up with the "recording too short" error, while the recording attempts ahead work as expected. I'll just look into the logs to see if we find something and report it to the CameraX team soon |
In the first attempt of recording the video we have,
This stays almost forever after that, until we attempt to stop recording which then just logs
In the second attempt, however,
(rest of the logs as expected and the recording works) The main difference seems to be between the transition in the internal state (between the logs of the two case), one transitions to CONFIGURING state whereas the other transitions to RECORDING state directly |
This happens specifically when the recording starts right after the recording permission is given, possibly related to the different flows that are taken when audio permission is not already present and when it is |
The bug occurs because when audio permission an audio permission is completed, a callback is invoked that causes the
However, the issue is that This regression seems to have occurred at some point while refactoring the code that was previously used to restart the camera after audio permission was granted/audio was disabled |
Hey @muhomorr, Could you please test the latest revision of this branch for this issue? Thanks a lot for your time and help! |
b98ad8b
to
7324d47
Compare
This would help us in displaying a more accurate timer while the video recording takes place, for example in cases when the user pauses the recording or when an unexpected occasional delay occurs before the recording actually starts