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

Not able to record video in android 14 in some devices #1282

Open
rakeshrajput537 opened this issue Jul 29, 2024 · 6 comments
Open

Not able to record video in android 14 in some devices #1282

rakeshrajput537 opened this issue Jul 29, 2024 · 6 comments

Comments

@rakeshrajput537
Copy link

Describe the bug

I have two android 14 devices one is oneplus and another one is vivp.
in my oneplus it is working fine but failing in vivo.

To Reproduce

Start video recording in android 14 in vivo phone.

Expected behavior

Should record video as expect

XML layout

Part of the XML layout with the CameraView declaration, so we can read its attributes.

<androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.otaliastudios.cameraview.CameraView
        android:id="@+id/camera"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:keepScreenOn="true"
        app:layout_constraintBottom_toTopOf="@+id/bottomPanel"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Logs

onVideoResult result is null: something went wrong. java.lang.RuntimeException: start failed.
java.lang.RuntimeException: start failed.
at android.media.MediaRecorder._start(Native Method)
at android.media.MediaRecorder.start(MediaRecorder.java:1376)
at com.otaliastudios.cameraview.video.FullVideoRecorder.onStart(FullVideoRecorder.java:314)
at com.otaliastudios.cameraview.video.VideoRecorder.start(VideoRecorder.java:80)
at com.otaliastudios.cameraview.engine.Camera1Engine.onTakeVideo(Camera1Engine.java:426)
at com.otaliastudios.cameraview.engine.CameraBaseEngine$5.run(CameraBaseEngine.java:605)
at com.otaliastudios.cameraview.engine.orchestrator.CameraStateOrchestrator$3.run(CameraStateOrchestrator.java:100)
at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator$1.call(CameraOrchestrator.java:84)
at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator$1.call(CameraOrchestrator.java:81)
at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator$3.run(CameraOrchestrator.java:152)
at com.otaliastudios.cameraview.internal.WorkerHandler.run(WorkerHandler.java:137)
at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator.execute(CameraOrchestrator.java:147)
at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator.access$100(CameraOrchestrator.java:34)
at com.otaliastudios.cameraview.engine.orchestrator.CameraOrchestrator$2.run(CameraOrchestrator.java:137)
at android.os.Handler.handleCallback(Handler.java:1013)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:328)
at android.os.HandlerThread.run(HandlerThread.java:67)

@rohitraj-khorwal
Copy link

Are you getting this error with cameraEngine camera2 also?
And did you change its mode before recording the video?

camera.mode = Mode.VIDEO

@rakeshrajput537
Copy link
Author

rakeshrajput537 commented Jul 29, 2024 via email

@rakeshrajput537
Copy link
Author

rakeshrajput537 commented Jul 29, 2024 via email

@AntonLogin0v
Copy link

I have the same problem

@AntonLogin0v
Copy link

AntonLogin0v commented Aug 8, 2024

@rakeshrajput537 The problem is in the methods

mediaRecorder.setVideoSize(mProfile.videoFrameWidth, mProfile.videoFrame Height);
mediaRecorder.setVideoFrameRate(mProfile.videoFrameRate);

works for me, comment them out(download lib), but they affect the quality

source: https://blog.csdn.net/netwalk/article/details/17686993

also works, set mProfile custom quality(1080p)

@jerome268
Copy link

can anybody tell me how to comment that out since i am seeing any class it is downloaded from maven , or google not sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants