2024-11-15, 07:11 PM
libx264 and libx265 don't encode the same way. When threads is set with libx264 each frame is sliced into that many threads. libx265 does not work by slicing frames. They have a concept called WPP.
https://x265.readthedocs.io/en/stable/th...processing
When threads is set in libx265, each WPP is assigned that many threads. Depending on the resolution of the video, the number of WPPs can vary. In my testing, a 480i video had 8 WPPs and a 4K video had 34 WPPs. So setting threads to 1 on that 480i video would result in 8 threads. One per WPP. And 34 threads for the 4K video.
https://x265.readthedocs.io/en/stable/th...processing
When threads is set in libx265, each WPP is assigned that many threads. Depending on the resolution of the video, the number of WPPs can vary. In my testing, a 480i video had 8 WPPs and a 4K video had 34 WPPs. So setting threads to 1 on that 480i video would result in 8 threads. One per WPP. And 34 threads for the 4K video.
Quote:chris@rat-trap: /media/storage2/rips/wip/Dune$ ffmpeg -y -init_hw_device vaapi=va:,driver=iHD,kernel_driver=i915 -hide_banner -stats -fflags +genpts+igndts -loglevel error -i Dune_t00.mkv -map_chapters 0 -map 0:v -c:v libx265 -threads 1 -c:a libopus -vbr on -compression_level 10 -application audio -map 0:a:1 -map 0:a:3 -map 0:a:0 -map 0:a:2 -c:s copy -map 0:s:0 -map 0:s:1 -map '0:t?' -disposition:s 0 -max_muxing_queue_size 2048 -max_interleave_delta 0 -avoid_negative_ts disabled test.mkv
x265 [info]: HEVC encoder version 3.5+1-f0c1022b6
x265 [info]: build info [Linux][GCC 13.2.0][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [warning]: Turning on repeat-headers for HDR compatibility
x265 [info]: Main 10 profile, Level-5 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 1 / wpp(34 rows) ##### THIS HERE #####
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias : 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
x265 [info]: tools: b-intra strong-intra-smoothing lslices=8 deblock sao
frame= 765 fps=6.1 q=30.8 Lsize= 8188KiB time=00:00:10.90 bitrate=6149.7kbits/s speed=0.0874x
x265 [info]: frame I: 4, Avg QP:29.86 kb/s: 5665.92
x265 [info]: frame P: 220, Avg QP:31.43 kb/s: 1921.49
x265 [info]: frame B: 541, Avg QP:34.65 kb/s: 452.46
x265 [info]: Weighted P-Frames: Y:6.8% UV:2.7%
x265 [info]: consecutive B-frames: 14.7% 15.6% 12.9% 26.8% 29.9%
encoded 765 frames in 124.58s (6.14 fps), 902.18 kb/s, Avg QP:33.70