Closed uthay45 closed 3 months ago
This looks like x265, maybe ask about this on their issue tracker? Also, it seems you are using an older version of libvmaf
as compute_vmaf()
has been removed since v3.0.
Yeah u are right compute_vmaf is deprecated since v3.0. but I got the same error even If I use v2.3.1 and v2.0.0
Could you provide more details on your OS, how you built libvmaf, x265, and how they are linked together? I can try to reproduce this.
vmaf built: wget https://github.com/Netflix/vmaf/archive/refs/tags/v2.3.1.tar.gz tar -xzf v2.3.1.tar.gz cd vmaf-2.3.1/libvmaf/ meson setup build --buildtype release ninja -vC build ninja -vC build test ninja -vC build install
x265 built: git clone https://bitbucket.org/multicoreware/x265_git.git cd x265_git cd /build/linux ./make-Makefiles.bash (while running this i change enable_libvmaf to ON and enable_shared to OFF) make -j8 sudo make install
OS info : Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 88 On-line CPU(s) list: 0-87 Thread(s) per core: 2 Core(s) per socket: 22 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 79 Model name: Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz Stepping: 1 CPU MHz: 3254.614 CPU max MHz: 3600.0000 CPU min MHz: 1200.0000 BogoMIPS: 4399.92 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 56320K NUMA node0 CPU(s): 0-21,44-65 NUMA node1 CPU(s): 22-43,66-87
Thanks for the details, I was able to reproduce your issue.
My observations:
compute_vmaf
.Because the model is hardcoded here to vmaf_v0.6.1.pkl
, and we removed support for pkl model files in favor of json some time ago, it won't work as-is. I tried changing that line to vmaf_v0.6.1.json
, and then moved into the next error. Note: I don't know why this wasn't a problem for you.
I could repro your segmentation fault and root caused it to bitdepth_map. This is because the format string passed into compute_vmaf
is NULL
. This comes again from this line - vcd
is defined in this way and I can't find anywhere it is modified, and then it passes the null pointer into compute_vmaf
here.
This seems to be a problem on x265's end, and nontrivial for someone without x265 knowledge to get right. I tried hardcoding the pixel format that I'm working with (yuv420p10le
) in that line, recompiling, and voila:
sample command
x265 repro/out_4096x2160_10b.yuv -o repro/output.hevc --recon repro/recon.yuv --input-res 4096x2160 --fps 25 --log-level full --csv-log-level 1 --csv repro/out.csv
contents of repro/out.csv
:
Encode Order, Type, POC, QP, Bits, Scenecut, I/P cost ratio, RateFactor, Latency, List 0, List 1, Intra 64x64 DC, Intra 64x64 Planar, Intra 64x64 Ang, Intra 32x32 DC, Intra 32x32 Planar, Intra 32x32 Ang, Intra 16x16 DC, Intra 16x16 Planar, Intra 16x16 Ang, Intra 8x8 DC, Intra 8x8 Planar, Intra 8x8 Ang, 4x4, Inter 64x64, Inter 32x32, Inter 16x16, Inter 8x8, Skip 64x64, Skip 32x32, Skip 16x16, Skip 8x8, Merge 64x64, Merge 32x32, Merge 16x16, Merge 8x8, Avg Luma Distortion, Avg Chroma Distortion, Avg psyEnergy, Avg Residual Energy, Min Luma Level, Max Luma Level, Avg Luma Level, Min Cb Level, Max Cb Level, Avg Cb Level, Min Cr Level, Max Cr Level, Avg Cr Level, Intra 64x64, Skip 64x64, AMP 64, Inter 64x64, Merge 64x64, Inter 64x32, Merge 64x32, Inter 32x64, Merge 32x64, Intra 32x32, Skip 32x32, AMP 32, Inter 32x32, Merge 32x32, Inter 32x16, Merge 32x16, Inter 16x32, Merge 16x32, Intra 16x16, Skip 16x16, AMP 16, Inter 16x16, Merge 16x16, Inter 16x8, Merge 16x8, Inter 8x16, Merge 8x16, Intra 8x8, Skip 8x8, AMP 8, Inter 8x8, Merge 8x8, Inter 8x4, Merge 8x4, Inter 4x8, Merge 4x8, 4x4, DecideWait (ms), Row0Wait (ms), Wall time (ms), Ref Wait Wall (ms), Total CTU time (ms),Stall Time (ms), Total frame time (ms), Avg WPP, Row Blocks, VMAF Frame Score
0, I-SLICE, 0, 33.48, 67336, 0,0.00,25.087,5, -, -, 0.00%, 0.00%, 0.00%, 0.76%, 0.00%, 35.10%, 0.00%, 0.00%, 60.89%, 0.00%, 0.00%, 3.25%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 8159.08, 6766.56, 1407.75, 213328.95 , 0, 83, 41.50, 0, 83, 40.39, 0, 83, 37.72, 0.00%, 0.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 100.00%, 0.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 97.56%, 0.00%,0.00%, 2.44%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 100.00%, 0.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 282.9, 0.1, 4457.9, 0.1, 1861.5, 0.0, 4700.6, 19.490, 1419, 96.772195
1, P-SLICE, 1, 32.54, 50304, 0,1.00,28.000,4, 0 , -, 0.00%, 0.00%, 0.00%, 1.46%, 0.02%, 37.96%, 0.42%, 0.01%, 48.59%, 0.00%, 0.01%, 9.59%, 0.00%, 0.00%, 0.00%, 0.06%, 0.01%, 0.00%, 0.00%, 0.57%, 0.00%, 0.00%, 0.00%, 1.32%, 0.00%, 5320.94, 3136.72, 1302.64, 171120.62 , 0, 75, 19.06, 0, 2, 1.00, 0, 2, 1.00, 0.00%, 0.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 100.00%, 0.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 93.40%, 3.60%,0.00%, 3.10%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 99.94%, 0.00%,0.00%, 0.06%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 296.9, 58.7, 4580.6, 50.9, 1701.3, 0.0, 4865.9, 19.222, 698, 96.124773
2, P-SLICE, 2, 33.00, 2328, 0,1.00,28.000,3, 1 0 , -, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 44.06%, 49.21%, 6.73%, 0.00%, 5455.49, 6871.46, 1414.37, 5455.49 , 0, 83, 41.50, 0, 83, 40.39, 0, 83, 37.72, 0.00%, 100.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 100.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 50.00%,0.00%, 50.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 311.0, 108.7, 4452.5, 45.9, 109.1, 0.8, 4869.3, 2.699, 12, 96.772302
3, P-SLICE, 3, 32.07, 8960, 0,1.00,28.000,2, 2 1 0 , -, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 1.78%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.85%, 8.06%, 0.00%, 0.00%, 0.00%, 0.49%, 0.00%, 0.00%, 46.26%, 35.57%, 6.99%, 0.00%, 5194.01, 2066.69, 1330.40, 5309.86 , 0, 75, 19.06, 0, 2, 1.00, 0, 2, 1.00, 0.00%, 98.20%,0.00%, 0.00%, 1.80%, 0.00%, 0.00%, 0.00%, 0.00%, 3.88%, 78.59%,0.00%, 0.00%, 17.59%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 50.00%,0.00%, 50.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 325.3, 107.0, 4382.1, 42.0, 120.6, 0.3, 4873.2, 3.109, 32, 96.342465
4, P-SLICE, 4, 33.00, 1344, 0,1.00,28.000,1, 3 2 1 , -, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 84.62%, 5.13%, 10.26%, 0.00%, 5367.38, 6588.09, 1414.01, 5367.38 , 0, 83, 41.50, 0, 83, 40.39, 0, 83, 37.72, 0.00%, 100.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 100.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 50.00%,0.00%, 50.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 340.3, 105.0, 4449.8, 38.0, 104.1, 1.5, 4876.8, 3.031, 3, 96.772302
5, P-SLICE, 5, 33.00, 1392, 0,1.00,28.000,0, 4 3 2 , -, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 84.62%, 5.13%, 10.26%, 0.00%, 4589.78, 2066.69, 1335.80, 4589.78 , 0, 75, 19.06, 0, 2, 1.00, 0, 2, 1.00, 0.00%, 100.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 100.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 50.00%,0.00%, 50.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%,0.00%, 356.9, 100.5, 4385.9, 34.3, 101.7, 0.0, 4880.9, 3.062, 3, 96.794083
Summary Command, Date/Time, Elapsed Time, FPS, Bitrate, Y PSNR, U PSNR, V PSNR, Global PSNR, SSIM, SSIM (dB), I count, I ave-QP, I kbps, I-PSNR Y, I-PSNR U, I-PSNR V, I-SSIM (dB), P count, P ave-QP, P kbps, P-PSNR Y, P-PSNR U, P-PSNR V, P-SSIM (dB), B count, B ave-QP, B kbps, B-PSNR Y, B-PSNR U, B-PSNR V, B-SSIM (dB), MaxCLL, MaxFALL, Aggregate VMAF score, Version " -o input/output.hevc --recon input/recon.yuv --input-res 4096x2160 --fps 25 --log-level full --csv-log-level 2 --csv out.csv input/out_4096x2160_10b.yuv", Fri Apr 5 21:25:07 2024, 30.86, 0.19, 548.60, -, -, -, -, -, -, 1 , 33.48, 1683.40 , -, -, -, -, 5 , 32.72, 321.64 , -, -, -, -, -, -, -, -, -, -, -, 83 , 30 , 99.462032, 3.6+1-dd1ef69b2 0, I-SLICE, 0, 33.48, 67336, 0,25.087,5, -, -, 0.00%, 0.00%, 0.00%, 0.76%, 0.00%, 35.10%, 0.00%, 0.00%, 60.89%, 0.00%, 0.00%, 3.25%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00% 0, I-SLICE, 0, 33.48, 67336, 0,25.087,5, -, -, 0.00%, 0.00%, 0.00%, 0.76%, 0.00%, 35.10%, 0.00%, 0.00%, 60.89%, 0.00%, 0.00%, 3.25%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00% 1, P-SLICE, 1, 32.54, 50304, 0,28.000,4, 0 , -, 0.00%, 0.00%, 0.00%, 1.46%, 0.02%, 37.96%, 0.42%, 0.01%, 48.59%, 0.00%, 0.01%, 9.59%, 0.00%, 0.00%, 0.00%, 0.06%, 0.01%, 0.00%, 0.00%, 0.57%, 0.00%, 0.00%, 0.00%, 1.32%, 0.00% 2, P-SLICE, 2, 33.00, 2328, 0,28.000,3, 1 0 , -, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 44.06%, 49.21%, 6.73%, 0.00% 3, P-SLICE, 3, 32.07, 8960, 0,28.000,2, 2 1 0 , -, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 1.78%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.85%, 8.06%, 0.00%, 0.00%, 0.00%, 0.49%, 0.00%, 0.00%, 46.26%, 35.57%, 6.99%, 0.00% 4, P-SLICE, 4, 33.00, 1344, 0,28.000,1, 3 2 1 , -, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 84.62%, 5.13%, 10.26%, 0.00% 5, P-SLICE, 5, 33.00, 1392, 0,28.000,0, 4 3 2 , -, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 0.00%, 84.62%, 5.13%, 10.26%, 0.00%
Summary Command, Date/Time, Elapsed Time, FPS, Bitrate, Y PSNR, U PSNR, V PSNR, Global PSNR, SSIM, SSIM (dB), I count, I ave-QP, I kbps, I-PSNR Y, I-PSNR U, I-PSNR V, I-SSIM (dB), P count, P ave-QP, P kbps, P-PSNR Y, P-PSNR U, P-PSNR V, P-SSIM (dB), B count, B ave-QP, B kbps, B-PSNR Y, B-PSNR U, B-PSNR V, B-SSIM (dB), Aggregate VMAF score, Version " -o input/output.hevc --recon input/recon.yuv --input-res 4096x2160 --fps 25 --log-level full --csv-log-level 1 --csv out.csv input/out_4096x2160_10b.yuv", Fri Apr 5 21:25:53 2024, 4.24, 1.41, 548.60, -, -, -, -, -, -, 1 , 33.48, 1683.40 , -, -, -, -, 5 , 32.72, 321.64 , -, -, -, -, -, -, -, -, -, -, -, 99.462032, 3.6+1-dd1ef69b2
I would suggest opening an issue at x265 mentioning this one, and we can try to help with the fix and maybe with upgrading to the newer libvmaf API to avoid the incompatibility with v3.0.0.
Here is what my vcd
definition looked like after both changes:
static const x265_vmaf_commondata vcd[] = { { (char*)"yuv420p10le", (char *)"/usr/local/share/model/vmaf_v0.6.1.json", NULL, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 1, 0 } };
Thankyou so much @nilfm99 now i can able to run without any error . I have one question : if they removed compute_vmaf from the v3.0.0 , so whats the new API to calculate vmaf score in libvmaf. whats the alternative?
@uthay45 The new API is here: https://github.com/Netflix/vmaf/blob/master/libvmaf/include/libvmaf/libvmaf.h
You can see an example usage in the vf_libvmaf
ffmpeg filter here: https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_libvmaf.c
init
, it calls vmaf_init
to initialize the VmafContext
, and calls parse_models
and parse_features
parse_models
, it calls vmaf_model_load
/vmaf_model_load_from_path
to load the VmafModel
and vmaf_use_features_from_model
to register the corresponding feature extractorsparse_features
, it calls vmaf_use_feature
to register the corresponding additional feature extractorsdo_vmaf
, it calls copy_picture_data
to fill up the VmafPicture
buffers, and vmaf_read_pictures
to extract the feature scoresuninit
, it calls vmaf_score_pooled
to get the pooled score across all frames. If you wanted the score at one frame, you would call vmaf_score_at_index
instead.For x265, this should be simpler because they are only interested in one hardcoded model, and no extra features.
Leaving aside the new API, I do see some complications with fixing the current state of x265 <-> vmaf interaction. Most importantly, if x265_max_bit_depth
does not match the source bit depth, the encode and reconstructed videos will be a different bit depth from the source, and will need to be reconciled to some common bit depth before passing the data to libvmaf.
now i can able to run without any error
note that the results will only be correct (assuming no other errors in the x265 code that I may have missed) if you use videos with the same bit depth that you compiled with.
Thanks For your information @nilfm99
[mcw@localhost linux]$ ./x265 --input /mnt/Cajon/testsequences/BasketballDrive_3840x2160_50.yuv --input-res 3840x2160 --fps 50 --recon recon.yuv -o out.hevc --csv out.csv yuv [info]: 3840x2160 fps 50000/1000 i420p8 frames 0 - 500 of 501 yuv [info]: reconstructed images 3840x2160 fps 50000/1000 i420 raw [info]: output file: out.hevc x265 [info]: HEVC encoder version 3.5+119-e112940 x265 [info]: build info [Linux][GCC 12.2.0][64 bit] 10bit x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 x265 [info]: Main 10 profile, Level-5.1 (Main tier) x265 [info]: Thread pool 0 using 44 threads on numa nodes 0 x265 [info]: Thread pool 1 using 44 threads on numa nodes 1 x265 [info]: Slices : 1 x265 [info]: frame threads / pool features : 6 / wpp(34 rows) 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 : 25 / 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 libvmaf INFO
compute_vmaf()
is deprecated and will be removed in a future libvmaf version Segmentation fault (core dumped)someone please help me to resolve this error. i used vmaf_v0.6.1.json file for model file beoz from vmaf v2.x they deprecated .pkl file instead they told to use .json format file. I enabled libvmaf using cmake.