我用Android 12构建了hdrvivid调试器,并安装在手机上。当播放一个hdrvivid测试流时,显示比手机上的默认视频播放器要暗得多。生动的流文件名是"hdr_vivid_selftest_dmsync_pq.mp4“。它被用来做生动的播放器测试,它只是在屏幕中央显示一个白色的长方形。如果你愿意的话,我可以提供这条流。谢谢!后乡
发布于 2022-08-25 08:34:30
更新:
您可以根据以下方法( docs链接 )检查该设备是否具有HDR视频解码功能
// Check the support for MediaCodec on the device.
MediaCodecList mcList = new MediaCodecList(MediaCodecList.ALL_CODECS);
MediaCodecInfo[] mcInfos = mcList.getCodecInfos();
for (MediaCodecInfo mci : mcInfos) {
// Filter out the encoder.
if (mci.isEncoder()) {
continue;
}
String[] types = mci.getSupportedTypes();
String typesArr = Arrays.toString(types);
// Filter out the non-HEVC decoder.
if (!typesArr.contains("hevc")) {
continue;
}
for (String type : types) {
// Check whether 10-bit HEVC decoding is supported.
MediaCodecInfo.CodecCapabilities codecCapabilities = mci.getCapabilitiesForType(type);
for (MediaCodecInfo.CodecProfileLevel codecProfileLevel : codecCapabilities.profileLevels) {
if (codecProfileLevel.profile == HEVCProfileMain10 || codecProfileLevel.profile == HEVCProfileMain10HDR10
|| codecProfileLevel.profile == HEVCProfileMain10HDR10Plus) {
// true means supported.
return true;
}
}
}
}
// false means unsupported.
return false;如果设备具有HDR视频解码功能,则可以通过调整设备的亮度条来调整视频的亮度。如果不支持HDR功能,则需要调用setBrightness()接口来设置视频亮度,并且该接口仅在不支持HDR的设备上生效。
似乎HarmonyOS 2.0.0.268荣誉V30 Pro系统可能不支持HDR。示例代码调用setBrightness接口,set值生效。但是,手机的默认播放器可能做了其他处理,所以看起来亮度可能不一样。
如果不支持HDR,则可以将setBrightness()设置为中等亮度值。

https://developer.huawei.com/consumer/en/doc/development/Media-Guides/android-hdr-0000001276893212
https://stackoverflow.com/questions/73481707
复制相似问题