我需要slice-height
和stride
信息才能将YUV 4:2:0平面数据转换为RGB。
它在SPS / PPS内吗?我该如何计算?
SPS = [0,0,0,1,103,66,-32,13,-90,-63,65,-97,-97,1,66,2, 2,3,-32,0,0,125,32,0,29,76,18,-128]
PPS = [0,0,0,1,104, -50,49,18,0,0,1,6,0,1,-64,6,1,-124,1,1,4,4,10,-75,0,49,68,84, 71,49,65,-8,-1,83,4,64,0,2,7,91,18,0,0, -94,58,0,0,-94,58,0,2,-102,55,0,0,-100,-128,-128,21,-128]
Android MediaCodec
在MediaCodec.INFO_OUTPUT_FORMAT_CHANGED
:
{图像数据= java.nio.ByteArrayBuffer [位置= 0,限制= 80,容量= 80], mime = video / raw,crop-top = 0,crop-right = 319, slice-height = 192 , color-format = 21,height = 192,width = 320,what = 1869968451, crop-bottom = 179,crop-left = 0, stride = 384 }
如何直接从H.264流中获取此信息?
答案 0 :(得分:2)
此信息不包含在编码流中。步幅的概念在编码帧中不存在。它纯粹是一个解码的图像概念,可以是任何等于或大于宽度的值。