Opened 10 months ago

Last modified 10 months ago

#11676 new defect

Broken video decoding on Android TV boxes with MediaCodec

Reported by: bl1nch Owned by:
Priority: critical Component: ffmpeg
Version: 7.1 Keywords: amlogic mediacodec hwaccel
Cc: bl1nch Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by bl1nch)

Hello ffmpeg developers. I faced the problem of broken hardware video decoding on Android TV boxes with CPU Amlogic s905w2 and GPU Mali-G31 using MediaCodec. This problem occurs when using any player based on ffmpeg. I tested it with libmpv(https://github.com/mpv-player/mpv) and libmdk(https://github.com/wang-bin/mdk-sdk). I also tested with plugins for Flutter based on these video players (since I am a developer on the Flet(Flutter) framework). In some cases I get video with lags and in some strange green frames. I can give you a video sample with which you can reproduce the error. I also talked to the developers of the MPV player and they confirmed that this is a bug on the part of ffmpeg (https://github.com/mpv-android/mpv-android/issues/1088). I can also assume that this is really the case because I see exactly the same error in the logs and the same video output when using MDK.
You can also see additional information here (https://github.com/media-kit/media-kit/issues/614), including an example of a green frame of the video output.

I can't reproduce this error by calling ffmpeg from the command line because it happens on an Android TV box.
The simplest thing I can offer from myself to reproduce this error is to build a Flutter application using any of the players (for example MDK, i.e. the fvp library (https://pub.dev/packages/fvp)). For this you can simply use the example code (https://pub.dev/packages/video_player#example) and substitute my video sample there.

Please pay attention to this problem. I have not been able to figure this out for a year and now I have found out that this is a problem with ffmpeg. I am not the only one experiencing this problem and it makes it impossible to use any player built on ffmpeg on a huge number of Android TV boxes.

Change History (3)

comment:1 by bl1nch, 10 months ago

Description: modified (diff)

comment:2 by bl1nch, 10 months ago

I just discovered that this is most likely a problem with the interaction of MediaCodec with Amlogic decoders. I forced the decoder to change from OMX.amlogic.avc.decoder.awesome2 to OMX.google.h264.decoder and I no longer have green frames in the video output. But now the video is a little laggy when playing.

comment:3 by bl1nch, 10 months ago

Description: modified (diff)
Keywords: amlogic mediacodec hwaccel added
Note: See TracTickets for help on using tickets.