Open Bug 1857608 Opened 2 years ago Updated 2 years ago

GBR-planar WebM vp9 video won't play on Android

Categories

(Core :: Audio/Video, enhancement)

Firefox 113
All
Android
enhancement

Tracking

()

People

(Reporter: office, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0

Steps to reproduce:

Try to play this video in Firefox 113:

https://mb.sb/teaching/networking/internet/videos/globe_crf_55_720.webm

Actual results:

The browser shows a message: "Video can't be played because the file is corrupt"

Expected results:

I expected the video to play.

It does play in:

  • Firefox 118.0.1 on Linux
  • Chromium on Linux
  • Vanadium on GrapheneOS
  • Samsung Internet on Android

The WebM video in question was created from a set of PNGs using

ffmpeg -i %03d.png -vf scale=720:720 -crf 55 globe_crf_55_720.webm

If I convert the video using

ffmpeg -i globe_crf_55_720.webm -pix_fmt yuv420p globe_crf_55_720_yuv420p.webm

the resulting video plays in Firefox on Android: https://mb.sb/teaching/networking/internet/videos/globe_crf_55_720_yuv420p.webm

Maybe this issue is related to that: https://bugzilla.mozilla.org/show_bug.cgi?id=1368063

I originally created a bug report for this issue here: https://gitlab.com/relan/fennecbuild/-/issues/55

Excerpts from the output of ffprobe:

For the non-working video:

Stream #0:0: Video: vp9 (Profile 1), gbrp(pc, gbr/unknown/unknown, progressive), 720x720, SAR 1:1 DAR 1:1, 25 fps, 25 tbr, 1k tbn

For the working video with YUV420p:

Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv, progressive), 720x720, SAR 1:1 DAR 1:1, 25 fps, 25 tbr, 1k tbn

Can you take a look?

Flags: needinfo?(m_kato)
Component: General → Audio/Video
Flags: needinfo?(m_kato)
Product: Fenix → Core

I can reproduce this with https://mb.sb/teaching/networking/internet/videos/globe_crf_55_720.webm on Android 14 + Pixel 6a. Firefox Nightly the lastest version cannot play this WebM correctly.

Status: UNCONFIRMED → NEW
Ever confirmed: true

On my device:

10-07 14:34:52.791 9885 9896 W VideoCapabilities: Unrecognized profile 2130706433 for video/avc
10-07 14:34:52.802 9885 9896 W VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
10-07 14:34:52.803 9885 9896 W VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
10-07 14:34:52.807 9885 9896 W VideoCapabilities: Unsupported mime video/divx
10-07 14:34:52.808 9885 9896 W VideoCapabilities: Unsupported mime video/divx311
10-07 14:34:52.809 9885 9896 W VideoCapabilities: Unsupported mime video/divx4
10-07 14:34:52.816 9885 9896 W VideoCapabilities: Unsupported mime video/mp4v-esdp
10-07 14:34:52.826 9885 9896 I VideoCapabilities: Unsupported profile 4 for video/mp4v-es
10-07 14:34:52.839 9885 9904 I OMXClient: Using client-side OMX mux.
10-07 14:34:52.855 9885 9904 E OMXMaster: A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one.
10-07 14:34:52.881 9885 9903 I MediaCodec: MediaCodec will operate in async mode
10-07 14:34:52.883 9885 9903 I MediaCodec: [OMX.google.vp9.decoder] setting surface generation to 10122241
10-07 14:34:52.884 9885 9904 W OMXNodeInstance: [1:google.vp9.decoder] component does not support metadata mode; using fallback
10-07 14:34:52.884 9885 9904 E ACodec : [OMX.google.vp9.decoder] storeMetaDataInBuffers failed w/ err -1010
10-07 14:34:52.884 9885 9904 I ExtendedACodec: setupVideoDecoder()
10-07 14:34:52.884 9885 9904 E OMXNodeInstance: getParameter(1:google.vp9.decoder, ParamVideoAndroidVp8Encoder(0x6f600007)) ERROR: UnsupportedIndex(0x8000101a)
10-07 14:34:52.920 5131 5222 D QtiTetherService/IpaWrapper: getStats(false)
10-07 14:34:52.934 9885 9905 F SoftVPX : frameworks/av/media/libstagefright/codecs/on2/dec/SoftVPX.cpp:142 CHECK_EQ( mImg->fmt,VPX_IMG_FMT_I420) failed: 262 vs. 258
10-07 14:34:52.934 9885 9905 F mozglue : failed to resend signal during crash: Operation not permitted
10-07 14:34:52.943 9245 9257 E GeckoRemoteManager: remote codec is dead
10-07 14:34:52.943 9245 9257 E GeckoRemoteManager: remote codec is dead
10-07 14:34:52.957 2054 5267 I ActivityManager: Process org.mozilla.firefox_beta:media (pid 9885) has died

I think the most suspicious part is SoftVPX : frameworks/av/media/libstagefright/codecs/on2/dec/SoftVPX.cpp:142 CHECK_EQ( mImg->fmt,VPX_IMG_FMT_I420) failed: 262 vs. 258
262 -> 0x106 -> VPX_IMG_FMT_I444
258 -> 0x102 -> VPX_IMG_FMT_I420

So maybe the android's vpx library cannot handle format VPX_IMG_FMT_I444

From ffmpeg:
https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/libvpxenc.c#L814-L819 AV_PIX_FMT_GBRP will use VPX_IMG_FMT_I444 as img_fmt (in the switch statement fall-through)

Ref: https://trac.ffmpeg.org/wiki/Encode/VP9#compatibility

On Pixel 6 + Android 13 , the video does not show message "Video can't be played because the file is corrupt", just jump to the end of video with all black.

adb log:

10-07 20:20:13.762 8096 16097 I CCodecConfig: query failed after returning 17 values (BAD_INDEX)

then endless loop of:

10-07 20:20:15.232 830 16098 W ExynosC2Vp9DecComponent: [onUpdateC2Work] input is corrupted
10-07 20:20:15.234 830 16099 E libexynosv4l2: failed to ioctl: VIDIOC_G_FMT (11 - Try again)
10-07 20:20:15.234 830 16099 E ExynosVideoCodec-Vp9Dec: [setup] srcSetup() is failed
10-07 20:20:15.234 830 16099 E ExynosVp9DecFilter: [onSetup] setup() is failed

Bug 1368063 comment 4 indicates an expectation that this should play, given the free codec.

Severity: -- → S2
See Also: → yuv444
Summary: WebM video won't play → YUV444 WebM vp9 video won't play on Android
Summary: YUV444 WebM vp9 video won't play on Android → GBR-planar WebM vp9 video won't play on Android
Type: defect → enhancement
Severity: S2 → S3
You need to log in before you can comment on or make changes to this bug.