Skip to content

关于Android MediaCodec硬编码16位对齐的问题 #29

@MarkMjw

Description

@MarkMjw

前段时间我也遇到这个问题了,参考:https://stackoverflow.com/questions/28291204/something-about-stagefright-codec-input-format-in-android 解决了。

但现在遇到一个新问题:视频能正常编码出来,但是部分手机在视频右侧或底部出现一条绿纹,应该就是对齐增加的几个像素导致,不知道如何解决。

不知道是不是对齐的方式有问题,我的方式:
if (w % 16 > 0) {
w = (w / 16) * 16 + 16;
}
if (h % 16 > 0) {
h = (h / 16) * 16 + 16;
}

有遇到相同的情况吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions