Skip to content
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

[BUG] Video recorded in too short duration will be failed to be produced #150

Closed
hujian-jian opened this issue Dec 7, 2022 · 4 comments · Fixed by #168
Closed

[BUG] Video recorded in too short duration will be failed to be produced #150

hujian-jian opened this issue Dec 7, 2022 · 4 comments · Fixed by #168
Labels
r: camera Related to the camera package. s: enhancement This issue addressed some enhancement.

Comments

@hujian-jian
Copy link

hujian-jian commented Dec 7, 2022

Describe the bug
I found that when long pressing to record a video, if the user lets go for a short time, it will cause the camera to have a black screen.

How to reproduce
No Example

Steps to reproduce the behavior:
When using the long press to record the video, if you let go in a short time, it will cause the camera to have a black screen
使用长按录屏功能时,用户如果短时间内就松手会导致相机黑屏,我自己是录制几百毫秒松手就必现

Expected behavior
I hope that recording the video screen in a short time will not cause the camera to black.

Screenshots (If contains)
1231670380416_ pic

Version information

  • Device: [e.g. iPhone X]
  • OS: [e.g. iOS 14.7.1]
  • Package Version: [e.g. 2.4.1]
  • Flutter Version: [e.g. v2.5.0]

Additional context

@hujian-jian hujian-jian added the await investigate The issue is waiting for further investigation. label Dec 7, 2022
@ultronx2
Copy link

I am facing the same issue with android devices.

1 similar comment
@HongZhiQing
Copy link

I am facing the same issue with android devices.

@HongZhiQing
Copy link

HongZhiQing commented Apr 3, 2023

The error log:

I/MediaRecorder(12456): stop
I/CameraDevice-JV-0(12456): Camera now idle
I/Camera  (12456): CameraCaptureSession onClosed
I/CameraDevice-JV-0(12456): Camera now idle
E/MediaRecorder(12456): stop failed: -1007
E/MethodChannel#plugins.flutter.io/camera_android(12456): Failed to handle method call
E/MethodChannel#plugins.flutter.io/camera_android(12456): java.lang.RuntimeException: stop failed.
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at android.media.MediaRecorder.native_stop(Native Method)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at android.media.MediaRecorder.stop(MediaRecorder.java:2179)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at io.flutter.plugins.camera.Camera.stopVideoRecording(Camera.java:761)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at io.flutter.plugins.camera.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:129)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:322)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$2j2MERcK825A5j1fv5sZ7xB2Iuo.run(Unknown Source:12)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at android.os.Handler.handleCallback(Handler.java:955)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at android.os.Handler.dispatchMessage(Handler.java:102)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at android.os.Looper.loopOnce(Looper.java:206)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at android.os.Looper.loop(Looper.java:296)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at android.app.ActivityThread.main(ActivityThread.java:9070)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
E/MethodChannel#plugins.flutter.io/camera_android(12456): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:968)
[CameraPicker - LOG] Error when stop recording video: CameraException(error, stop failed.)
[CameraPicker - LOG] Try to initialize a new CameraController...
I/flutter (12456): ══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════
I/flutter (12456): The following CameraException was thrown:
I/flutter (12456): CameraException(error, stop failed.)
I/flutter (12456): 
I/flutter (12456): When the exception was thrown, this was the stack:
I/flutter (12456): #0      handleErrorWithHandler (package:wechat_camera_picker/src/internals/methods.dart:28:3)
I/flutter (12456): #1      CameraPickerState.stopRecordingVideo (package:wechat_camera_picker/src/states/camera_picker_state.dart:749:7)
I/flutter (12456): <asynchronous suspension>
I/flutter (12456): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/Camera  (12456): dispose
I/Camera  (12456): close

@AlexV525
Copy link
Member

AlexV525 commented May 7, 2023

I came up with a solution that might work: I saw many apps add the minimum recording duration limit in the past few months, and most of them are limited to 1 second at least. We might add the same behavior for recordings.

48e697ed9ddb5f3d6b1370e18470e19

@AlexV525 AlexV525 added s: enhancement This issue addressed some enhancement. r: camera Related to the camera package. and removed await investigate The issue is waiting for further investigation. labels May 7, 2023
@AlexV525 AlexV525 changed the title [BUG] I found that when long pressing to record a video, if the user lets go for a short time, it will cause the camera to have a black screen. [BUG] Video recorded in too short duration will be failed to be produced May 7, 2023
AlexV525 added a commit that referenced this issue May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r: camera Related to the camera package. s: enhancement This issue addressed some enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants