Skip to content

安卓播放 hevc (608x1080) 视频出现斜纹 #903

@Crazy86321475

Description

@Crazy86321475

rk3568 安卓13 设备
从日志中看:
2025-09-10 11:23:53.262 13756-13855 CCodec com.example.ledcontroller D allocate(c2.android.aac.decoder)
2025-09-10 11:23:53.263 324-13852 C2RKMpiDec [email protected] I initDecoder enter
2025-09-10 11:23:53.263 324-13852 C2RKMpiDec [email protected] I init: w 608 h 1080 coding 16777220
2025-09-10 11:23:53.263 324-13852 mpp_info [email protected] I mpp version: 8a4fa843 author: Yandong Lin 2023-07-31 [mpp_buffer]: add the check of commit duplicate buffer
2025-09-10 11:23:53.267 324-13852 C2RKNalParser [email protected] I find h265 sps start code.
2025-09-10 11:23:53.267 324-13852 rk_c2_log [email protected] I [rk3568] codec-0x01000004 fbc_support_result-1
2025-09-10 11:23:53.267 324-13852 C2RKMpiDec [email protected] I use mpp fbc output mode
2025-09-10 11:23:53.267 324-13856 mpp_buf_slot [email protected] I set frame info: w 608 h 1080 hor 640 ver 1088
2025-09-10 11:23:53.267 324-13856 mpp_dec [email protected] I setting default w 608 h 1080 h_str 640 v_str 1088
2025-09-10 11:23:53.267 324-13852 C2RKMpiDec [email protected] I init: get stride [640:1088]
2025-09-10 11:23:53.267 324-13852 rk_c2_log [email protected] I [rk3568] codec-0x01000004 fbc_support_result-1
2025-09-10 11:23:53.267 324-13852 C2RKMpiDec [email protected] I fbc padding offset(0, 4)
2025-09-10 11:23:53.267 324-13852 C2RKDump [email protected] I dump flag: 0x00000000
2025-09-10 11:23:53.268 317-317 android.ha...V1-service and...graphics.allocator-V1-service I alloc_format: FMT:0x10c,MOD:0x10000
2025-09-10 11:23:53.268 317-317 android.ha...V1-service and...graphics.allocator-V1-service I mali_gralloc_adjust_dimensions: alloc_format=FMT:0x10c,MOD:0x10000 usage=0xc408000000000100 alloc_width=608, alloc_height=1152
2025-09-10 11:23:53.268 13756-13855 CCodec com.example.ledcontroller I setting up 'default' as default (vendor) store
2025-09-10 11:23:53.272 317-317 android.ha...V1-service and...graphics.allocator-V1-service I alloc_format: FMT:0x10c,MOD:0x10000
2025-09-10 11:23:53.272 317-317 android.ha...V1-service and...graphics.allocator-V1-service I mali_gralloc_adjust_dimensions: alloc_format=FMT:0x10c,MOD:0x10000 usage=0xc408000000000100 alloc_width=608, alloc_height=1152
2025-09-10 11:23:53.276 317-317 android.ha...V1-service and...graphics.allocator-V1-service I alloc_format: FMT:0x10c,MOD:0x10000

逻辑宽高(视频 SPS 指定的):608 × 1080

实际对齐后 stride:横向 = 640,纵向 = 1088

mali_gralloc_adjust_dimensions: alloc_width=608, alloc_height=1152

gralloc 最终分配的 buffer 是 608 × 1152 = 700416。

这和解码器需要的 stride(640×1088) = 696320 对不上,但我不知道这是否是原因;
还有一部分日志在刚才的日志之前:

CCodec com.example.ledcontroller D setup formats input: AMessage(what = 0x00000000) = {
int32_t height = 1080
int32_t level = 65536
int32_t max-input-size = 2097152
string mime = "video/hevc"
int32_t profile = 1
int32_t width = 608
Rect crop(0, 0, 607, 1079)
}
CCodec com.example.ledcontroller D setup formats output: AMessage(what = 0x00000000) = {
int32_t android._color-format = 2135033992
int32_t android._video-scaling = 1
int32_t rotation-degrees = 0
int32_t color-standard = 1
int32_t color-range = 2
int32_t color-transfer = 3
int32_t sar-height = 1
int32_t sar-width = 1
Rect crop(0, 0, 607, 1079)
int32_t width = 608
int32_t height = 1080
int32_t max-height = 1080
int32_t max-width = 608
string mime = "video/raw"
int32_t android._dataspace = 260
int32_t color-format = 2130708361
}
有打印 包含 crop,,这个像是预设解码器输出的信息? 意思是 codec 想让解码器输出不包含 padding 的帧?
而解码器最终却输出了包含 padding 的帧到一个不包含 padding 的buffer 中?

虽然和解码器解码出帧应该是没问题的,但是,解码器和安卓视频框架对接以及申请应该还是rk来对接的;
期待能否解答一下?

下图是 的问题现象,exoplayer + textureView ,可以明显看到有小的矩形灰色色块,斜着排布,神奇的是,他不是每个像素行都偏移。
Image

这是原视频:

52207_677309288900760D0DE6E162DCE1F23F_4446453.mp4

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