Skip to content

Android 5 emulator: the software H.264 decoder fails on the Lewei stream #268

Closed as not planned

Description

@compot-dev

Found while checking PR #267 (lewei://, #262). The 184 frames of the capture from #262, replayed from a fake toy, do not play on the API 21 emulator:

  • OMX.google.h264.decoder starts, then SoftAVC logs Decoder failed: -2, ACodec reports ERROR(0x80001001), and the app retries with a growing delay (Codec exception, retry in … ms).
  • The same build and the same frames play on the API 25 emulator with no codec errors, and ffmpeg decodes them without errors.

The stream is H.264 Main at 1280×720, 20 fps, with SPS and PPS every 2 s or so; the first frame after connecting can be a P frame, before any SPS.

Not known yet: whether this comes from the stream, from how the app starts the decoder on Android 5, or from the emulator's software decoder alone. The first step is to play another H.264 stream on the API 21 emulator; if that fails too, the Lewei stream is not the cause. No report from a real Android 5 device so far.

Activity

  1. compot-dev commented on Nov 4, 2026

    @compot-dev
    CollaboratorAuthor

    Cause found: the software decoder of the Android 5.0 emulator handles H.264 Baseline only, and the Lewei stream is not Baseline. This is not a bug in the app or in the Lewei transport.

    • media_codecs_google_video.xml in the API 21 image declares OMX.google.h264.decoder as ProfileBaseline : Level51.
    • The stream from Toy: VISUO (vendor app WiFi UFO) — Lewei protocol on TCP 7060 #262 uses CABAC (entropy_coding_mode_flag = 1). Its SPS says Main (profile_idc 77) with constraint_set0_flag = 1, so it claims to be Baseline-compatible, which it is not.

    Each stream below went through the same app build and the same lewei:// path for 14 s on the API 21 emulator:

    Stream Decoder starts Decoder failed: -2 Result
    Capture from #262, from its first key frame 5 4 no picture
    x264 Main, CABAC, 1280×720, 20 fps 5 4 no picture
    x264 Main, CAVLC, weighted prediction on 5 4 no picture
    x264 Main, CAVLC, weighted prediction off 1 0 plays
    x264 Baseline 1 0 plays

    The last two rows rule out how the app starts the decoder, and the P frame before the first SPS as well: frames wait for the full parameter set. The Main stream that plays has no CABAC or weighted prediction, so the limit is the coding tools, not the profile number. API 25 has a newer software decoder, which is why the same frames play there.

    Not checked: a real Android 5 device. Those normally use a hardware decoder, so this result does not say how they behave. An attempt to play the files in the emulator's system player gave no result: Baseline failed there too, before any decoder started.

    What remains: on a device with only this decoder, a Main stream shows no picture and the app keeps retrying with a growing delay, with no message about the reason.

  2. compot-dev commented on Nov 4, 2026

    @compot-dev
    CollaboratorAuthor

    Closing: this is a limit of the Android 5.0 emulator's software decoder, not a bug in the app. Reopen if a real device shows the same failure.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions