google / google/ExoPlayer

HEVC adaptation issues when switching profiles

Open
#10,052 6 comments 0 reactions 1 assignee Assigned to @microkatz View on GitHub
bug: device specific
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

i'm experiencing an issue in a device which reference board is the qualcomm sdm845 and confirmed the issue is reproducible in a Samsung s9 phone, both have the same hevc video decoder OMX.qcom.video.decoder.hevc and the secure version.

this is the log of the decoders.
```
02-12 13:24:16.872 25185 25185 D EventLogger: downstreamFormat [eventTime=0.12, mediaPos=0.00, window=0, period=0, id=1, mimeType=video/hevc, codecs=hvc1.2.4.L150.A0, res=3840x2160]
02-12 13:24:16.916 25185 25185 D EventLogger: videoDecoderInitialized [eventTime=0.17, mediaPos=0.00, window=0, period=0, OMX.qcom.video.decoder.hevc]
02-12 13:24:16.917 25185 25185 D EventLogger: videoInputFormat [eventTime=0.17, mediaPos=0.00, window=0, period=0, id=1, mimeType=video/hevc, codecs=hvc1.2.4.L150.A0, res=3840x2160]
02-12 13:24:36.085 25185 25185 D EventLogger: downstreamFormat [eventTime=19.33, mediaPos=0.00, window=1, period=1, id=1, mimeType=video/hevc, codecs=hvc1.1.6.L150.90, res=3840x2160]
02-12 13:24:36.086 25185 25185 D EventLogger: videoInputFormat [eventTime=19.34, mediaPos=0.00, window=1, period=1, id=1, mimeType=video/hevc, codecs=hvc1.1.6.L150.90, res=3840x2160]
```

when playing the videos in this order in a playlist order: hvc1.2.4.L150.A0, hvc1.1.6.L150.90

Decoder is configured for the first file (hvc1.2.4.L150.A0 codec profile)and It plays fine. But after app started to decode/play the next video file (which codec profile is hvc1.1.6.L150.90) - no error reported from decoder, app still uses decoder configured for hvc1.2.4.L150.A0 and we observe video distortion.

if playing the videos in the reverse order both the videos play fine.

if using a pixel device, issue was not observed.
however, the decoder named in the playback are different. the pixel uses c2.qti.hevc.decoder. It also does not report any errors. but the decoder initialization happens once only and works fine in both cases.

since my hardware is custom i've discarted a change in workaround code in mediacodecinfo.java
https://github.com/google/ExoPlayer/blob/f1b37bc547e7194354fe31e240afa8a8fb0b5c6c/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java#L797
but may want to consider for off the shelf device such as the samsung s9

but for my immediate need there seems to be a workaround i can do by customizing the renderer factory/and video renderer in my app. reference https://github.com/metalg/testplayer/blob/master/app/src/main/java/com/example/concatenatingplayer/PlayListMediaCodecVideoRenderer.java#L38

is this the right approach to solve this issue i face?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.