Closed Bug 1981503 Opened 9 months ago Closed 5 months ago

Corrupt HEVC decoding on Android

Categories

(Core :: Audio/Video: Playback, defect, P2)

Unspecified
Android
defect

Tracking

()

VERIFIED FIXED
148 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- wontfix
firefox146 --- wontfix
firefox147 --- verified
firefox148 --- verified

People

(Reporter: pehrsons, Assigned: jhlin)

References

Details

(Keywords: webcompat:platform-bug)

User Story

user-impact-score:300

Attachments

(4 files)

Tested in Firefox 141 release and the late Nightly from Aug 3 2025.

First found when playing the video on https://www.svt.se/nyheter/lokalt/vast/sa-drar-stormen-floris-in-over-landet-under-tisdagen.

On my Samsung Galaxy S22 (Exynos 2200 with an AMD RDNA 2 based GPU) I see corrupt video at first, then the device does a full reset and starts booting up automatically.
A colleague with a Google Pixel 7 Pro (Mali GPU) saw corrupt video with no reset.
jimm's Samsung Galaxy Z Flip4 (Adreno GPU) saw corrupt video with no reset.

Sometimes the video plays. My unconfirmed hypothesis is that the HEVC hw decoder is unavailable so we play the AVC stream instead.

I enabled media playback logging and captured it through logcat in a scenario that led to a full reset, see that file attached.

Looking at the log and the DASH manifest, this appears to be the stream causing problems:

			<Representation id="2" bandwidth="959867" width="540" height="540" codecs="hvc1.2.4.L123.90" sar="1:1" mimeType="video/mp4">
				<SupplementalProperty schemeIdUri="urn:se:svt:average-bitrate:2024" value="625231"/>
				<SegmentTemplate initialization="cmaf-video-hevc-540x540p25-625/cmaf-video-hevc-540x540p25-625-init.mp4" media="cmaf-video-hevc-540x540p25-625/cmaf-video-hevc-540x540p25-625-$Number$.mp4" startNumber="1" timescale="12800">
					<SegmentTimeline>
						<S t="0" d="49152" r="8"/>
						<S t="442368" d="9728"/>
					</SegmentTimeline>
				</SegmentTemplate>
			</Representation>

The full URL for the init segment is https://ed12.cdn.svt.se/d0/world/20250805/80b8a341-5e4f-4365-a178-01b50f742acb/cmaf-video-hevc-540x540p25-625/cmaf-video-hevc-540x540p25-625-init.mp4.

Given this, I also tested some other HEVC material and found another repro case in the DASH reference player.
STR:

  • Click Load.
  • In the video controls, select manually the lowest bitrate stream.
  • Wait a minute or so.

Note this case also fails on macOS with MEDIA_ERR_DECODE (void mozilla::AppleVTDecoder::OnDecodeError(OSStatus): OnDecodeError:ffffbae2) which is kVTVideoDecoderReferenceMissingErr, so perhaps the root cause is on our end in platform independent code.

As requested on chat.m.o I have run adb shell dumpsys media.player on the Galaxy S22.

Loading the svt page in Chrome shows it downloading first the 234x234 HEVC stream, then switching to the 1080x1080 HEVC stream. I assume they're using the hw decoder or they should have picked an AVC stream instead.

SVT say there were no recent changes on their end, and they have been using HEVC for some time. Plausibly we may be looking at a 141 regression.

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)

The latest I heard from SVT was that they have been using HEVC for some time on their VOD service svtplay.se. They ran an experiment earlier in summer with HEVC for news videos on svt.se, which was when I started seeing issues. I haven't used svtplay.se in Firefox on Android which is likely why this didn't come up before.

Flags: needinfo?(jolin)
Duplicate of this bug: 1988801
Flags: needinfo?(jmathies)
Blocks: 1988526
User Story: (updated)
Assignee: nobody → jolin
Severity: -- → S3
Priority: -- → P2

It looks like the websites serve HEVC video with different resolutions specified in initialization segments but HEVChangeMonitor::CheckForChange() doesn't check the changes.

Flags: needinfo?(jolin)
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch

Firefox Nightly on Android works on svt.se now. Would you consider an uplift?

Status: RESOLVED → VERIFIED
Flags: needinfo?(jolin)

I am assuming this only affects Android. The patch seems independent of platform though. Please update the tracking if it affects desktop too.

(In reply to Andreas Pehrson [:pehrsons] from comment #12)

I am assuming this only affects Android. The patch seems independent of platform though. Please update the tracking if it affects desktop too.

It affects "recyclable" video decoders. AFAIK only enabled on Android.

Flags: needinfo?(jolin)
Attachment #9533605 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined: Sites that serving HEVC with dynamic resolutions could show broken images.
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Not risky because the change is straightforward.
  • String changes made/needed: N/A
  • Is Android affected?: yes
Attachment #9533605 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified as fixed on the latest Nightly (148.0a1) and latest Beta (147.0b6) builds.

The video from the description plays correctly.

Device used: Samsung Galaxy S25 Ultra (Android 15).

Marking the ticket as verified on 147 and 148.

Regressions: 2012108
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: