google/ExoPlayer

D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x-1.0]

Closed this issue · 15 comments

Currently trying to play HLS media that is not DRM protected is showing a lot of stutter and the playback is extremely choppy, I cannot give a test link because authentication headers need to be passed in order to get working playlist links.
The debug log shows the following

W/AudioCapabilities: Unsupported mime audio/dtshd
W/AudioCapabilities: Unsupported mime audio/ffmpeg
W/VideoCapabilities: Unsupported mime video/x-vnd.on2.vp6a
W/VideoCapabilities: Unsupported mime video/x-vnd.on2.vp6f
W/VideoCapabilities: Unsupported mime video/avs
W/VideoCapabilities: Unrecognized profile 4 for video/hevc
W/VideoCapabilities: Unsupported mime video/mjpeg
W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
I/VideoCapabilities: Unsupported profile 2 for video/mpeg2
I/VideoCapabilities: Unsupported profile 3 for video/mpeg2
    Unsupported profile 4 for video/mpeg2
    Unsupported profile 5 for video/mpeg2
I/VideoCapabilities: Unsupported profile 2 for video/mp4v-es
    Unsupported profile 4 for video/mp4v-es
    Unsupported profile 8 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 16 for video/mp4v-es
    Unsupported profile 32 for video/mp4v-es
    Unsupported profile 64 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 128 for video/mp4v-es
    Unsupported profile 256 for video/mp4v-es
    Unsupported profile 512 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 1024 for video/mp4v-es
    Unsupported profile 2048 for video/mp4v-es
    Unsupported profile 4096 for video/mp4v-es
I/VideoCapabilities: Unsupported profile 8192 for video/mp4v-es
    Unsupported profile 16384 for video/mp4v-es
W/VideoCapabilities: Unsupported mime video/rm10
W/VideoCapabilities: Unsupported mime video/rm20
W/VideoCapabilities: Unsupported mime video/rm30
W/VideoCapabilities: Unsupported mime video/rm40
W/VideoCapabilities: Unsupported mime video/vc1
W/Utils: could not parse long range '1-'
W/VideoCapabilities: Unrecognized level 16 for video/x-vnd.on2.vp8
W/VideoCapabilities: Unrecognized level 32 for video/x-vnd.on2.vp8
    Unrecognized level 64 for video/x-vnd.on2.vp8
    Unrecognized level 128 for video/x-vnd.on2.vp8
W/VideoCapabilities: Unrecognized level 256 for video/x-vnd.on2.vp8
    Unrecognized level 512 for video/x-vnd.on2.vp8
    Unrecognized level 1024 for video/x-vnd.on2.vp8
    Unrecognized level 2048 for video/x-vnd.on2.vp8
    Unrecognized level 4096 for video/x-vnd.on2.vp8
W/VideoCapabilities: Unrecognized level 8192 for video/x-vnd.on2.vp8
    Unrecognized level 16384 for video/x-vnd.on2.vp8
    Unrecognized level 32768 for video/x-vnd.on2.vp8
W/VideoCapabilities: Unsupported mime video/wmv3
W/VideoCapabilities: Unsupported mime video/wmv1
W/VideoCapabilities: Unsupported mime video/wmv2
W/VideoCapabilities: Unsupported mime video/x-ms-wmv
W/VideoCapabilities: Unsupported mime video/wvc1
W/Utils: could not parse long range '1-'
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x-1.0] [OMX.google.h264.decoder, video/avc] [aquaman, MiTV-AESP0, Xiaomi, 28]
D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x-1.0] [OMX.google.h264.decoder, video/avc] [aquaman, MiTV-AESP0, Xiaomi, 28]
I/OMXClient: IOmx service obtained
I/AmAVUtils: AmAVUtils::getComponentRole isEncoder :0 mime:audio/mp4a-latm 
V/AVUtils: AVUtils::getComponentRole
I/AmAVUtils: AmAVUtils::isAudioExtendFormat input = audio/mp4a-latm
I/ACodec: codec does not support config priority (err -2147483648)
I/ACodec: codec does not support config operating rate (err -2147483648)
I/OMXClient: IOmx service obtained
D/SurfaceUtils: connecting to surface 0xd3b8d808, reason connectToSurface
I/MediaCodec: [OMX.amlogic.avc.decoder.awesome] setting surface generation to 15429633
D/SurfaceUtils: disconnecting from surface 0xd3b8d808, reason connectToSurface(reconnect)
D/SurfaceUtils: connecting to surface 0xd3b8d808, reason connectToSurface(reconnect)
I/AmAVUtils: AmAVUtils::getComponentRole isEncoder :0 mime:video/avc 
V/AVUtils: AVUtils::getComponentRole

I'm guessing these are the 2 most important lines from the searches I have made

D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x-1.0] [OMX.google.h264.decoder, video/avc] [aquaman, MiTV-AESP0, Xiaomi, 28]
D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x-1.0] [OMX.google.h264.decoder, video/avc] [aquaman, MiTV-AESP0, Xiaomi, 28]

Is there no workaround for the media codec not being supported? Does this have to be encoded to another format?
The device is a xiaomi android TV stick running android TV 9.

There isn't enough info here for us to give you a concrete answer - we can't really tell you anything about your media without access to the stream.

If you play the stream in the demo app there might be more info logged that you can use to help understand what's going on.

If you want us to take a closer look, please either post the stream here or send it to dev.exoplayer@gmail.com using a subject in the format "Issue #1234" (where "#1234" should be replaced with this issue number.) Please also update this issue to indicate you’ve done this.

Unfortunately I am not allowed send the link, I can provide more info about the video.
image
and these are the available tracks

#EXTM3U
#EXT-X-VERSION:4
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="AUDIO",LANGUAGE="und",NAME="Audio 1",DEFAULT=YES,URI="track_a0/MFSR0413.m3u8?scsessid=llIbkHQBDkMTtxn9Iysf6OI8h29p2QLJ"
#EXT-X-STREAM-INF:PROGRAM-ID=1,RESOLUTION=640x360,CODECS="avc1.4d001e,mp4a.40.2",BANDWIDTH=1214480,AUDIO="AUDIO"
track_v0/MFSR0413.m3u8?scsessid=llIbkHQBDkMTtxn9Iysf6OI8h29p2QLJ
#EXT-X-STREAM-INF:PROGRAM-ID=1,RESOLUTION=1024x576,CODECS="avc1.4d001f,mp4a.40.2",BANDWIDTH=1884218,AUDIO="AUDIO"
track_v1/MFSR0413.m3u8?scsessid=llIbkHQBDkMTtxn9Iysf6OI8h29p2QLJ
#EXT-X-STREAM-INF:PROGRAM-ID=1,RESOLUTION=1280x720,CODECS="avc1.4d0020,mp4a.40.2",BANDWIDTH=4125566,AUDIO="AUDIO"
track_v2/MFSR0413.m3u8?scsessid=llIbkHQBDkMTtxn9Iysf6OI8h29p2QLJ
#EXT-X-STREAM-INF:PROGRAM-ID=1,RESOLUTION=1920x1080,CODECS="avc1.4d0028,mp4a.40.2",BANDWIDTH=5755649,AUDIO="AUDIO"
track_v3/MFSR0413.m3u8?scsessid=llIbkHQBDkMTtxn9Iysf6OI8h29p2QLJ

playing the video on a fireTV stick or on the emulator or on a ROCK64 board running android TV 7.1 works flawlessly with the Android TV player demo and my code. Unfortunately the mi stick refuses to play this format without extreme lag and stutter and it falls back to the software decoder every time.

From the information given this doesn't sound like an ExoPlayer problem, it sounds possibly like a limitation of the mi stick device (since you say the stream plays fine on other devices).

I'm going to close this.

@icbaker I found the solution for this device and may be the problem is more global! The problem line is here:

decoderInfos = MediaCodecUtil.getDecoderInfosSortedByFormatSupport(decoderInfos, format);

the codec selector takes the first codec and there are two candidate for this device
OMX.amlogic.avc.decoder.awesome and
OMX.google.h264.decoder

the second one (I assume) is software decoder, right?

But after the sorting MediaCodecUtil.getDecoderInfosSortedByFormatSupport(decoderInfos, format) - the codecs have the same weight - the order is changed and as result the player takes the first one (OMX.google.h264.decoder). My solution for the device was to remove OMX.google.h264.decoder decoder from the list of selected decoders here:

@Eliasdevlb if you can reproduce using the demo app on the device, can you please grab all logs from the logcat and attach them to the issue (don't copy paste, just upload a text file) to help us verify which decoder was picked. Please, also specify which version of ExoPlayer you are using.

From the logs you shared

D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x-1.0] [OMX.google.h264.decoder, video/avc] [aquaman, MiTV-AESP0, Xiaomi, 28]
D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x-1.0] [OMX.google.h264.decoder, video/avc] [aquaman, MiTV-AESP0, Xiaomi, 28]

show that the ExoPlayer detects that OMX.google.h264.decoder cannot support the 1920x1080 resolution,
e.g. they are produced here

Later on, this log line references the hardware decoder so I assume the hardware decoder was picked

I/MediaCodec: [OMX.amlogic.avc.decoder.awesome] setting surface generation to 15429633

So it looks ExoPlayer is picking the hardware decoder correctly in this case, but it might be the the decoder is not performing fast enough

@kpandroid I can see you have posted a similar comment on #8593 but I'm not sure your comment applies to any of the two issues. The logs originally reported in this ticket show that the hardware decoder was picked, not the software one.

For what it's worth

after the sorting MediaCodecUtil.getDecoderInfosSortedByFormatSupport(decoderInfos, format) - the codecs have the same weight - the order is changed

If in the decoders list before sorting, the hardware decoder is placed first, then the order between the two codecs is guaranteed to remain the same by Collections.sort()

If you have an issue with codec selection on a device and you do see the decoders being re-ordered, can you please open a new issue so that we take a look at it separately?

I'll keep this issue open to inspect logs and verify that device originally reported is indeed picking the hardware decoder.

@christosts The Exoplayer version being used is 2.11.7 (since this is the version in our current production app) I have set up the stream on the leanback showcase demo app and I've attached the full log below.
leanback_showcase_logcat.txt
Let me see if I can find a way to send the exo team a sample video or URL.
For us to deal with this issue, we had to transcode all our videos again to make sure they are widely supported. Also our QA team noted that the issue happens on the new chromecast with google TV as well but I can't confirm that since I haven't tried it myself.

@Eliasdevlb will you be able to play the specific content on the device using the ExoPlayer demo app and provide the logs produced from the demo app? The demo app logs show which decoder was used (no content links are logged). You can email the logs to dev.exoplayer@gmail.com with subject "Issue #8542" if you prefer to not attach them here.

Yes, I will provide them over this weekend and I'll do my best to include a test playlist link in the email if possible.

Here is the Log from the exoplayer demo
exoplayer_demo_log.txt
I will also send an email later today containing a demo file.

Thank you for providing the logs @Eliasdevlb. I can see the player picked the hardware decoder

videoDecoderInitialized [eventTime=6.98, mediaPos=0.00, window=0, period=0, OMX.amlogic.avc.decoder.awesome]

and the content contains a single track with resolution at 1920x1080. If it is similar content as the one you posted above, then I assume is encoded at ~6Mbps with frame rate 29.97. From the information we have so far, it looks like a device issue, where the decoder cannot keep up decoding.

From the device specs you mentioned and the decoder name, I would expect such content to play without problems. But if it works flawlessly on other devices as you say, then this indicates it is a device-specific issue.

This might worth 5 minutes of your time: I see you used the demo app from 2.13.1. You can try to test with some experimental threading optimizations we are working on for dropped frames. Call experimentalSetAsynchronousBufferQueueingEnabled(true) on the demo app's DefaultRenderersFactory instance here. This is an experimental feature not yet released though, so if it works, you might want to restrict using it to this device only.

I will check out the experimental branch later this week and report back. I am still trying to provide a playlist link but it's a bit complicated.

ojw28 commented

[Setting needs more info tag]

I've sent an email about this subject.

Hi @Eliasdevlb. Thank you for sharing the content. I played it directly on a few devices (local playback) to see how each device's decoder would perform. I did not see any issue. From the data we've collected so far, it looks like this is an issue with the specific device and content and not something related to ExoPlayer.

You could try some of the experimental optimizations I mentioned in this comment above, but if it's the underlying decoder not being able to decode the stream fast enough, there's not much ExoPlayer can do.