Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-116053

FFMPEG does not work on certain Android devices

    XMLWordPrintable

Details

    • Android
    • 2023wk34FOQtforAndroid, 2023wk36FOQtforAndroid

    Description

      The issue can be reproduced by deploying 6.5.2 QML multimedia player example to certain Android device or emulator, and then playing video. A video that can be used for testing:

      https://roboticsmoley-my.sharepoint.com/:v:/g/personal/yuriy_ischenko_moley_com/EXy2QAjCwb9Otlol09Ez5t4Bf1Q40q1yzxtGynaw4gsGUQ?e=GEAXyh
      

      Not necessarily to load video by network (that is another problem related to SSL, not the issue described here). Downloading the video and playing it locally can reproduce the issue.

      The issue is not being able to load video. The error message is 'Cannot create codec. Failed to open FFmpeg codec context Generic error in an external library'. Please find the attached screenshot. Since it is reported that 6.5.1 example works fine, so I think it must be due to FFMPEG backend added to Android kit by 6.5.2.

      Multiple setups have been tested by original reporter. I have confirmed all x86 emulator cases to be valid. I don't have access to Galaxy S8 or ARM emulator, so haven't tested them yet. Will try to do more testing. But anyway, the results go like:

      Emulator-Android-9-API-28-x86 or arm32:

      • Qt 6.5.1 arm32 - works
      • Qt 6.5.1 x86 - works
      • Qt 6.5.2 arm32 - doesn't work
      • Qt 6.5.2 x86 - doesn't work
      • Qt 6.6.0 arm32 - doesn't work
      • Qt 6.6.0 x86 - works

      Emulator-Android-12-API-31-x86-64:

      • Qt 6.5.1 x86-64 - works
      • Qt 6.5.2 x86-64 - works
      • Qt 6.6.0 x86-64 - works

      Device-GalaxyS8-Android-13-API-33-arm64:

      • Qt 6.5.1 arm64 - works
      • Qt 6.5.1 arm32 - works
      • Qt 6.5.2 arm64 - doesn't work
      • Qt 6.5.2 arm32 - doesn't work
      • Qt 6.6.0 arm64 - doesn't work
      • Qt 6.6.0 arm32 - doesn't work

      Runtime logs for all cases are uploaded. The reasons for error can be summarized as:
      On Android 9:

      W VideoCapabilities: Unrecognized profile 4 for video/hevc
      I VideoCapabilities: Unsupported profile 4 for video/mp4v-es
      E emuglGLESv2_enc: a vertex attribute index out of boundary is detected. Skipping corresponding vertex attribute. buf=0xc3e915b0
      E emuglGLESv2_enc: Out of bounds vertex attribute info: clientArray? 0 attribute 2 vbo 186 allocedBufferSize 768 bufferDataSpecified? 1 wantedStart 0 wantedEnd 1108
      ...(similar message continuous)
      

      On Android 13:

      W AudioCapabilities: Unsupported mime audio/x-ima
      W AudioCapabilities: Unsupported mime audio/mpeg-L1
      W AudioCapabilities: Unsupported mime audio/mpeg-L2
      W VideoCapabilities: Unsupported mime video/wvc1
      W VideoCapabilities: Unsupported mime video/x-ms-wmv
      W VideoCapabilities: Unsupported mime image/vnd.android.heic
      W VideoCapabilities: Unsupported mime image/vnd.android.heic
      

      Although the logs are different, I suppose the root cause should be the same, i.e. AudioCapabilities and VideoCapabilities find unsupported formats. So FFMPEG does not work properly at the end.

      Another observation is that the issue happens to ARM platform most of times, except emulator for Android 9 x86 image.

      Update:
      The issue is probably device and/or OS dependent. I don't have S8, so I tried Samsung Galaxy S20 FE with Android 13. No error happens. Video can be played normally - both 32 and 64 bit application. So I guess it is better to start investigating by Android 9 emulator since the problem should be consistently reproducible.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bartlomiejmoskal Bartlomiej Moskal
            luqiaochen Luqiao Chen
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes