Skip to content

custom implemented FfmpegVideoRenderer crashes with YUV12 on some devices #9459

Closed
@sam-m3

Description

@sam-m3

The Issue:

I have an HLS stream which is played by android tv devices, stb devices and also mobile devices;
One of the formats of the video streams is video/mpeg2 which is not supported by new android phones.
As a workaround I implemented an FfmpegVideoRenderer and FfmpegVideoDecoder based on #7132 pull request.

I have two issues with it;

First:

The software decoder worked just fine on my phone which is Galaxy A31 / SM-A31F/DS, but tried it out on anther phone, the app crashed immediately or after a second of playing, Other device is Galaxy A71 / SM-A7115F/DS.
Down below I will provide the log I got for this error and further more explanation.
note: It cannot be a hardware issue, because I got the same error on 2 or 3 other devices including an Android TV.

Second

On my device which I said the video was working fine, The FfmpegVideoRenderer was doing a fantastic job rendering my video; But I only want video/mpe2 streams to be decoded by software decoder, For Other streams I want it to be rendered by the regular MediaCodedVideoRenderer; I did that by only supporting video/mpeg type for my software decoder, It works fine when switching from a stream rendered by MediaCodecVideoRenderer to FfmpedVideoRenderer, but the other way around, I get error saying that Decoder init failed OMX........
I think it has something to do with the FfmpegVideoRenderer not being released or what so ever, but couldn't find anything to help me with the issue.

Issue logs and files:

From the file below it contains:

  • ffmpeg_jni.cc
  • both FfmpegVideoDecoder and FfmpegVideoRenderer
  • build_ffmpeg.sh
  • error logs for both issues in separate text files

ffmpegSofwareDecoder.zip

Extra info:

In the title I said it has issue with YUV, I found that out by playing around in the ffmpeg_jni.cc file; I commented out the U plane from YUV line 727 of the ffmpeg_jni.cc file, and the video started playing without any crashes, but as I did that, the video has lost it's original color and it has a yellowish color.
I don't know that much about c++, that's why it took me a day or two just to figure out where the issue was.

I'll be thankful if you could help me with it and make it easier on me.
Regards.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions