Android Mediacodec Setting Mediaformat.key_profile issues

Source: Internet
Author: User

I set MEDIACODEC profile, has not been successful, read the source after the problem is found:

https://android.googlesource.com/platform/frameworks/av/+/437ced8a14944bf5450df50c5e7e7a6dfe20ea40/media/ Libstagefright/acodec.cpp


After you set up profile, you also set a Level property, but the current SDK does not provide this Key.

Even if you manually set the level, like this:

Mediacodec codec = Createencoderbytype (MEDIAFORMAT.MIMETYPE_VIDEO_AVC); Mediaformat format = = Mediaformat.createvideoformat (MEDIAFORMAT.MIMETYPE_VIDEO_AVC, 1920x1080); Format.setinteger ( Mediaformat.key_profile, MediaCodecInfo.CodecProfileLevel.AVCProfileHigh); Format.setinteger ("level", level_xxx); Codec.configure (format, NULL, NULL, MEDIACODEC.CONFIGURE_FLAG_ENCODE);
It's still not working, because Android forces profile to be set to Baseline.
XXX    if (h264type.eprofile! = omx_video_avcprofilebaseline) {        ALOGW ("Use baseline profiles instead of%d for AVC Recording ",            H264type.eprofile);        H264type.eprofile = Omx_video_avcprofilebaseline;    }

In short, Android can only use Baseline profile when using mediacodc for encode.

Google, found that other friends have found similar problems,

https://code.google.com/p/android/issues/detail?id=163580

It seems that this problem does exist, but it is unclear why Android is forcing the use of Baseline profile.

Android Mediacodec Setting Mediaformat.key_profile issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.