Only be 'permissive' in decoder resolution check in certain circumstances
See original GitHub issuehttps://github.com/google/ExoPlayer/issues/6551 reported an issue where ExoPlayer was failing to play H264 content because it was passing the ‘display resolution’ from an HLS manifest to android.media.MediaCodecInfo.VideoCodecCapabilities#areSizeAndRateSupported
. In that case the ‘display resolution’ width was 1129 but the actual samples had a width of 1130. Odd widths are illegal in H264, so the codec reported it couldn’t play the content.
The fix (https://github.com/google/ExoPlayer/commit/d874656e8a7668a83c6702413f094f6a1f509070) was to always round video dimensions based on android.media.MediaCodecInfo.VideoCodecCapabilities#getHeightAlignment
and getWidthAlignment
.
Unfortunately this then caused some confusion in https://github.com/google/ExoPlayer/issues/9103 when a VP8 video with an odd height (405px) failed to decode but the log said format_supported=YES
because the height had been rounded to 406px before querying the decoder. Removing the rounding didn’t fix the playback error, but it changed the log to say format_supported=NO_EXCEEDS_CAPABILITIES
, so it’s at least a somewhat ‘expected’ failure.
Ideally we’d only do the rounding in cases the resolution represents something other than ‘sample resolution’. i.e. if it comes from an HLS manifest, we should round. If it comes directly from a media container, we probably shouldn’t.
This info probably needs to propagated through Format
.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:11 (5 by maintainers)
Top GitHub Comments
There are 3 interlinked issues here:
c2.android.vp8.decoder
doesn’t support videos with odd resolutions. It declares this correctly (i.e. if you ask it whether it supports a video of 1280x719 then it will say “no”). This is tracked by:c2.qti.vp8.decoder
- it also claims to only support even-resolutioned videos, but as we’ve seen it can play odd-dimensioned videos fine. Therefore if ExoPlayer can’t find any codecs that say “yes we support that resolution” we will try and play a video with one of the codecs that said it couldn’t play it, because it might work. The alternative is to not play the video at all.c2.android
one, and that is generally chosen last anyway if there are other decoders on the device.If you have questions relating specifically to (1), please comment on #9103. Please only comment on this issue if your question is specifically about (3). I will hide all off-topic comments on this issue to keep the discussion focussed.
@baonq-2356 We have no plans to resolve this issue soon. As explained in various comments above it has no real-world effect on whether an odd-dimensioned VP8 video is playable on a device or not, it only changes the logging and is therefore not considered high priority.