Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Video recording unsupported on API<23 #612

Open

Description

@aforcier

I was looking at restoring the RECORD_AUDIO permission (#489, initially removed for API<23 in #488 to not prompt those users for a permission for an unreleased feature).

After restoring the permission however, I get this crash when recording video on API 21 or 22 devices:

com.automattic.loop E/AndroidRuntime: FATAL EXCEPTION: CameraX-video encoding thread
    Process: com.automattic.loop, PID: 8839
    java.lang.IllegalStateException
        at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
        at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:1033)
        at androidx.camera.core.VideoCapture.videoEncode(VideoCapture.java:604)
        at androidx.camera.core.VideoCapture$2.run(VideoCapture.java:348)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:135)
        at android.os.HandlerThread.run(HandlerThread.java:61)

Some research suggests that updating CameraX might help either resolve the issue or handle it better (I'm not sure which is the case).

We want to update CameraX when we can anyway (#197), though probably not in time for initial release.

For now (initial release) I suggest we do nothing. If we don't add the RECORD_AUDIO permission for API 21/22, attempting to record a video just fails silently. This is better than a crash or a rushed CameraX update that may cause bigger issues on all API levels.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] CrashThe app stops unexpectedly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions