1 (edited by msnbcorp 22-01-2023 22:57:25)

Topic: [bug report] current build of mpv prevent h265 8 bits conv.

Working with SVP, I noticed that conversion from a 8 bits video to x265 8bits with libx265, don't work anymore. It only produce 10bits video, which is not suitable in certain case (notably when decodding with Nvidia NVENC)

I make my way through the process and discovered that this is due to a bad version of the encoder in mpv, indeed, the simple command line :

./mpv.com ./vids.mkv --no-config --o=output.mkv --no-audio --no-sub --no-sub-auto --of=matroska --ovc=libx265 --ovcopts=profile=main

cause this bug :

(+) Video --vid=1 () (h264 1920x1080 25.000fps)
Audio --aid=1 --alang=eng () (opus 2ch 48000Hz)
VO: [lavc] 1920x1080 yuv420p
[vo/lavc] Opening encoder: libx265 H.265 / HEVC [libx265]
x265 [error]: main profile not supported, internal bit depth 10.
[ffmpeg] libx265: Invalid or incompatible profile set: main.
[vo/lavc] Could not initialize encoder.
Could not initialize video chain.
Video: no video

[encode] no data written to target file
Exiting... (Interrupted by error)

After digging, it seems that the version of libx265 in mpv is compiled only with 10 bits.

When not trying to force a profile, here is part of the output :

x265 [info]: build info [Windows][GCC 12.2.1][64 bit] 10bit

Which we can compare with the version embedded, for example, with ffmpeg :

x265 [info]: build info [Windows][GCC 9.3.1][64 bit] 8bit+10bit

A look on the documentation of libx265 explain the problem :

    Profile, Level, Tier
    --profile, -P
    Enforce the requirements of the specified profile, ensuring the output stream will be decodable by a decoder which supports that profile. May abort the encode if the specified profile is impossible to be supported by the compile options chosen for the encoder (a high bit depth encoder will be unable to output bitstreams compliant with Main or MainStillPicture).

I have try to force with option like --vf=format=fmt=yuv420p with no success.

I think this is not the desired behaviour. The version of libx265 embeded in mpv should be compiled in 8bit 10 bit.

I have open a bug on mpv github, but they say that the binary included are builded by the third party distributor...

I have submitted the bug to Shinshiro,  which seems to be the source of the major build of mpv, and it admit that it was introduced by him in the previous version, see :
https://github.com/shinchiro/mpv-winbui … issues/313

I think may be SVP should build its own version because the current Shinshiinro choice prevent the conversion to x265 8bit, which is not the wanted behaviour.