OpenVisualCloud / SVT-HEVC

SVT HEVC encoder. Scalable Video Technology (SVT) is a software-based video coding technology that is highly optimized for Intel® Xeon® processors. Using the open source SVT-HEVC encoder, it is possible to spread video encoding processing across multiple Intel® Xeon® processors to achieve a real advantage of processing efficiency.
Other
507 stars 169 forks source link

Methods to improve the coding quality of SVtheVC encoder #621

Closed zhangjiarui130 closed 1 year ago

zhangjiarui130 commented 1 year ago

X265 encoder preset= Medium, SVT_HEVC encoder preset=6, SVT_HEVC encoder output picture quality is lower than X265, and the picture appears fuzzy problem, X265 and SVT_HEvc command lines are as follows:

ffmpeg -analyzeduration 15M -probesize 15M -y -ss 120 -t 60 -i "bxh_3min.mp4" -map [oout] -map 0:a? -filter_complex "[0:v:0]fifo[in];[in]yadif=deint=1,scale=1920x1032,format=yuv420p[oout]"  -dts_delta_threshold 50  -c:v libsvthevc  -hielevel 2 -bl_mode 1 -tune 1 -vbv_bufinit 90 -preset 6 -map_chapters -1 -profile:v 1 -level:v 51 -aspect 1920:1032 -b:v 1272000 -g 125 -sc_detection 0 -rc 1 -vbv_bufsize 2544000 -vbv_maxrate 1335600 -vsync cfr -hdr 0 -pix_fmt yuv420p -an -sn -dn -ignore_unknown -r 25 -t 60 preset6tune2.ts
ffmpeg -analyzeduration 15M -probesize 15M -y -ss 120 -t 60 -i "bxh_3min.mp4" -map [oout] -map 0:a? -filter_complex "[0:v:0]fifo[in];[in]yadif=deint=1,scale=1920x1032,format=yuv420p[oout]"  -dts_delta_threshold 50  -c:v libx265 -preset medium -tune psnr -map_chapters -1 -aspect 1920:1032 -b:v 1272000 -bufsize 1272000 -minrate 1144800 -maxrate 1908000 -vsync cfr -x265-params keyint=125:scenecut=0:force-cfr=1:videoformat=component:bframes=2:b_pyramid=2 -b_strategy 0 -color_primaries bt709 -colorspace bt709 -color_trc bt709 -pix_fmt yuv420p -an -sn -dn -ignore_unknown -r 25 -t 60 medium.ts

May I ask whether the picture quality can be improved by adjusting the QPMax value or by mapping the QP logic of X265

image

1480c1 commented 1 year ago

May I ask whether the picture quality can be improved by adjusting the QPMax value or by mapping the QP logic of X265

The individual qp numbers are not apples to apples comparable between SVT-HEVC and x265, so you cannot easily map them. It is possible to gain additional quality at the expense of encoding time and bitstream size by adjusting the QPMax and qp values, but I do not think it will give you as good of a quality as x265 most of the time.

The chart you have screenshotted from https://x265.readthedocs.io/en/stable/svthevc.html does not actually mean that the quality and time spent for x265's medium preset equals SVT-HEVC's preset 6. That table only means if you decide to use SVT-HEVC through x265, it will map medium to 6 through their wrapper.

zhangjiarui130 commented 1 year ago

May I ask whether the picture quality can be improved by adjusting the QPMax value or by mapping the QP logic of X265

The individual qp numbers are not apples to apples comparable between SVT-HEVC and x265, so you cannot easily map them. It is possible to gain additional quality at the expense of encoding time and bitstream size by adjusting the QPMax and qp values, but I do not think it will give you as good of a quality as x265 most of the time.

The chart you have screenshotted from https://x265.readthedocs.io/en/stable/svthevc.html does not actually mean that the quality and time spent for x265's medium preset equals SVT-HEVC's preset 6. That table only means if you decide to use SVT-HEVC through x265, it will map medium to 6 through their wrapper.

Thank you for your reply. I understand your meaning. But when I test using preset=6 or preset=4, I find that the motion scene is still not as good as Medium of X265, and the effect of Medium is barely reached by adding qmax=31 to SVtheVC, but this method is not applicable to all scenes, and the code rate is about 20% too high. Is there any other code level optimization direction

zhangjiarui130 commented 1 year ago

There was also a problem that some video frames were blurry due to the low bit rate, so we temporarily used qmax to control the video frame quality and prevent its bit rate from being low