Jump to content

MediaCodec isn't working for Transcoding


natsu

Recommended Posts

Hi,

 

I've used the Emby Server for android version 3.6.0.54 on my android platform with marshmallow & MTK HW, when enable the transcoding for HEVC & H264 Content, I've found that the mediacodec can't be started with ffmpeg,and return the log with following:

 

[hevc_mediacodecndk @ 0x7f8f6b9400] NdkDec: mediacodec_name: OMX.MTK.VIDEO.DECODER.HEVC
Stream mapping:
Stream #0:0 -> #0:0 (hevc (hevc_mediacodecndk) -> h264 (h264_mediacodecndk))
Stream #0:1 -> #0:1 (flac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[hevc_mediacodecndk @ 0x7f8f6b9400] NdkDec: MediaCodec output format changed: mime: string(video/raw), stride: int32(1920), slice-height: int32(1080), color-format: int32(19), image-data: data, width-ratio: int32(1), height-ratio: int32(1), crop: unknown(9), width: int32(1920), height: int32(1080), what: int32(1869968451)}
[h264_mediacodecndk @ 0x7f8f0fd800] [Eval @ 0x7ff4ad79e8] Undefined constant or missing '(' in 'high'
[h264_mediacodecndk @ 0x7f8f0fd800] Unable to parse option value "high"
[h264_mediacodecndk @ 0x7f8f0fd800] Error setting option profile to value high.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[libmp3lame @ 0x7f8f0fe700] 3 frames left in the queue on closing
Conversion failed!

 
And the transcoding will revert to CPU, which is slowly than native playing on android, may someone help with me?
 
CPU: MediaTek MT6753
GPU: ARM Mali-T720
Storage : SDHC 16GB Class 10
 
Sincerely,
Natsu.

ffmpeg-transcode-2d029ef6-c6f6-4b27-9973-01bb68b732cf_1.txt

ffmpeg-transcode-3eb04fef-af42-4940-92c6-49304447cbd5_1.txt

  • Like 1
Link to comment
Share on other sites

@@natsu - Your setup is very interesting. 

 

Could you please post or PM the first few hundred log lines after server start?

That would be a great help!

 

Regarding your problem: On the transcoding settings page, have you configured a "high" profile for H.264 encoding?

 

Please set this back to "Auto" and try again..

Link to comment
Share on other sites

We currently have a bug where we are supplying incorrect profile and level data.

 

Until this is fixed, it would be interesting whether it would work if you deactivate hardware encoding and just leave decoding enabled. 

I say interesting because your HEVC hardware decoder advertises only 1280x720 as its maximum frame size and your video is 1920x1080, so probably it won't work.

 

Also, the AVC hardware encdoder reports 1920x1072 only - but this is probably a mistake by the codec implementor.

Anyway, the important part is encoding, not decoding. How that will work  - we'll only know after we've fixed the mentioned bug...

Link to comment
Share on other sites

Hi Softworkz,

 

Thanks, I'll take a look about the different point between ARM Mali & Qualcomm, if necessary I'll check the problem is depended on MT6753 Android OS or not, thanks again!

Link to comment
Share on other sites

Hi Softworkz & Luke,

 

Checked that the MT6753 platform with Mali-T720 MP3 with following:

 

HEVC HW decoding just support 720p, so it's impossible for me to check the HEVC format

H264 HW decoding is support 1080p, but the 1080p encoding has problem on other player like VLC android checked, seems problem from Infocus M808 OS Image, I'll use the 720p encoding to check the bug first before found another OS image.

 

For Snapdragon 615 with Adreno 405, it's outdated chip (and very hot...) for me and it shouldn't to continue to focus on, but may refer the problem whether is ffmpeg problem or not.

 

anyway, thanks for your comments!

 

Sincerely,

Natsu.

Thanks! 

Link to comment
Share on other sites

Hi Softworkz,

 

is it necessary that  the "-profile:v high -level 4.1" command existed? how can I remove temporary for debugging? thanks! 

Link to comment
Share on other sites

  • 4 weeks later...

Hi Softworkz,

 

Thanks for your comment, please remind me to check again if the problem is solved or implemented, I've changed to Nokia 3 with MT6737, although the HEVC decoding is lost compard to MT6753... But the OS image is pure for us to debug the problem...

 

Sincerely,

Natsu.

Edited by natsu
Link to comment
Share on other sites

After tried 3.6.0.63, the 480p & 720p H264 video is workable for transcoding with Mediacodec, thanks!

 

Edited: Checked that the Problem is on Arm Mali T720 is 720p deocding & encoding only, not depended on CPU model, so the problem may occur on other vendor chipset.

 

But for 1080p H264 Video, I need to use another phone which is either MT6753 nor MT6737 to check...

Edited by natsu
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...