使用 H264Decoder 我想获得解码的 YUV420 数据作为 Java 字节数组。我已经搜索了所有内容,但没有看到任何适合的示例。
ByteBuffer buf = ByteBuffer.wrap(h264EncodedByteArray); H264Decoder 解码器 = new H264Decoder(); // 假设解码器上设置了sps和pps 图片输出 = Picture.create(320, 240, ColorSpace.YUV420); 图片真实=decoder.decodeFrame(buf, out.getData());
“h264EncodedByteArray”将是来自流或文件的 h264 编码字节数组。