Nexus 7 2013 mediacodec video encoder garbled output

前端 未结 1 782
一生所求
一生所求 2021-01-06 13:03

I\'m working on an app which encodes a movie using h.264 encoder to gallery and other targets. This app supports variable aspect ratios at output (1:1, 2:3, 3:2, 16:9, 3:4,

相关标签:
1条回答
  • 2021-01-06 13:50

    I believe it has something to do with the device's chipset. I have the exact same problem with an old Motorola XT1058, which uses a Qualcomm Snapdragon S4 Pro, the same chipset as the Nexus 7.

    Doing some research I discovered through another answer that in older Qualcomm devices YUV data needs to be aligned at a 2K boundary, yet I can't understand how to fix it when using a input surface instead of YUV buffers.

    See the next accepted answer for the statement about the Qualcomm alignment requirements:

    How to get stride and Y plane alignment values for MediaCodec encoder

    My workaround is that for older devices I will use resolutions which I know will work, these are the ones that I can obtain by querying video profiles with the CamcorderProfile API.

    The main problem is how to detect if a device is affected or not, as the MediaCodec API can give only the codec name but not its version.

    0 讨论(0)
提交回复
热议问题