mpv技术文档对于“硬解降低画质”的专业解答
potplayer吧
全部回复
仅看楼主
level 10
实际上,绝大多数的PC播放器都是基于ffmpeg开发的,这当中也包括各类解码器和渲染器!
而mpv的官方技术文档是我所见过的这些播放器中最详细,也是最专业的!原文如下:
Quality reduction with hardware decoding
In theory, hardware decoding does not reduce video quality (at least for the codecs h264 and HEVC). However, due to restrictions in video output APIs, as well as bugs in the actual hardware decoders, there can be some loss, or even blatantly incorrect results. This has largely ceased to be a problem with modern hardware, but there is a lot of hardware out there, so caveat emptor. Known problems are discussed below, but the list cannot be considered exhaustive, as even hwdecs that work well on certain hardware generations may be problematic on other ones.
In some cases, RGB conversion is forced, which means the RGB conversion is performed by the hardware decoding API, instead of the shaders used by --vo=gpu. This means certain colorspaces may not display correctly, and certain filtering (such as debanding) cannot be applied in an ideal way. This will also usually force the use of low quality chroma scalers instead of the one specified by --cscale. In other cases, hardware decoding can also reduce the bit depth of the decoded image, which can introduce banding or precision loss for 10-bit files.
vdpau always does RGB conversion in hardware, which does not support newer colorspaces like BT.2020 correctly. However, vdpau doesn't support 10 bit or HDR encodings, so these limitations are unlikely to be relevant.
dxva2 is not safe. It appears to always use BT.601 for forced RGB conversion, but actual behavior depends on the GPU drivers. Some drivers appear to convert to limited range RGB, which gives a faded appearance. In addition to driver-specific behavior, global system settings might affect this additionally. This can give incorrect results even with completely ordinary video sources.
mediacodec is not safe. It forces RGB conversion (not with -copy) and how well it handles non-standard colorspaces is not known. In the rare cases where 10-bit is supported the bit depth of the output will be reduced to 8.
cuda should usually be safe, but depending on how a file/stream has been mixed, it has been reported to corrupt the timestamps causing glitched, flashing frames. It can also sometimes cause massive framedrops for unknown reasons. Caution is advised, and nvdec should always be preferred.
crystalhd is not safe. It always converts to 4:2:2 YUV, which may be lossy, depending on how chroma sub-sampling is done during conversion. It also discards the top left pixel of each frame for some reason.
If you run into any weird decoding issues, frame glitches or discoloration, and you have --hwdec turned on, the first thing you should try is disabling it.
我节选一些重点来说:
理论上,硬件解码不会降低视频质量(至少对于编解码器h264和HEVC)。然而,由于视频输出API的限制,以及实际硬件解码器中的错误,可能会出现一些损失,甚至是明显不
正确的
结果,比如:
1、硬件解码可能会降低解码图像的比特深度,这可能会对10位文件引入条带或精度损失。
2、dxva2不安全。它似乎总是使用BT.601进行强制RGB转换,但实际行为取决于GPU驱动程序。一些驱动程序似乎会转换为有限范围的RGB,这会使外观褪色。
就我个人的实战体会:我是无法分辨出软解和D3D11硬解之间的画质差异,但是dxva2(copy back)还是能稍稍感觉到画面的质感是不如软解的!所以PC上用软解还是D3D11硬解,我个人是倾向于只要不影响视频的流畅播放,能软解就用软解,没必要让CPU太空闲啊!
2025年01月14日 12点01分 1
吧务
level 13
现在的硬件只要解码原格式输出应该没这问题。
2025年01月14日 13点01分 2
现在不是什么上古遗物显卡都支持10bit硬解,不是什么上古遗物系统也都支持D3D11无copyback硬解,楼主说了一堆实际上和没说没区别
2025年01月15日 15点01分
@AMDPENTIUM 告诉你为啥“硬解可能会降低画质”啊!上古遗物的笔记本移动CPU芯片都能流畅软解24帧的4K HEVC(这个术语不叫10bit哦)视频,为啥不用呢?
2025年01月16日 10点01分
真实案例来了:https://tieba.baidu.com/p/9486050907,说明硬解是有可能出问题的!
2025年02月12日 01点02分
@狩猎🏹肖磊凤姐 你这链接贴子是硬件解码原格式输出引起的问题?[汗]
2025年02月12日 09点02分
level 1
madVR在缩小计算上,在看4k的时候我都只能用dxva才能98%以下(1066ti笔记本电脑,9代i7).画面会明显的白一点
2025年01月14日 14点01分 3
刚看了GPU的崛起,生动的形容图像处理细微区别,CPU是逐步打印,GPU是喷墨打印。按游戏来说,你没得选择只能用GPU,但视频来说,你就可以用旧办法CPU软解或新办法GPU硬解。
2025年02月12日 03点02分
level 1
没区别肯定硬解啊,软解不是浪费电
2025年01月14日 14点01分 4
理论上软解画质最高,且稳定性最强,另外madVR的一些功能是必须在软解下才能使用,当然是能软解就软解!玩高端HTPC的谁还在乎最多20W的功耗?
2025年01月15日 00点01分
@狩猎🏹肖磊凤姐 那你去软解个120帧的视频看看
2025年01月15日 00点01分
@留言贩子 不好意思,我不看山寨重编码出来的120帧视频!PS: 能软解就软解这句话是不理解还是看不懂?
2025年01月15日 01点01分
@狩猎🏹肖磊凤姐 笑死,山寨编码都来了,你是真的懂[笑眼]
2025年01月15日 02点01分
level 6
开了软解也就百分之几的cpu消耗,无所谓的
2025年01月14日 16点01分 5
1