heisenberg
27th June 2019, 03:16
Long winded, sorry, but want to make sure all details are given.
I ripped a BD to uncompressed yuv422. I chose that format because it was easiest to work with in my NLE. After editing, I saved the result also as uncompressed yuv422 in MXF format. I extracted a 15m clip of the darkest scene to avi container using ffmpeg with -c:v copy. Here's what ffmpeg says about the clip:
Stream #1:0: Video: rawvideo (Y42B / 0x42323459), yuv422p, 1920x816, 601047 kb/s, SAR 1:1 DAR 40:17, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
I did many different test encodes using handbrake on mac. Here's what ffmpeg says about the encodes:
Stream #0:0: Video: wrapped_avframe, yuv420p, 1920x816 [SAR 1:1 DAR 40:17], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
I then used ffmpeg (again on mac) to do a libvmaf analysis, using the default model. The results are quite poor. Some selected samples:
psnr vmaf data rate
crf12 44.283 75.858 30.5
crf17 42.622 74.751 11.4
crf20 41.723 73.444 5.2
If you are knowledgable about vmaf, you know that the training model is limited to crf22. not exceptional. so at least i expect to be at 96+. The peak ranges for crf17 are there. For crf20 it's closer to 92. Here's where things get interesting. Here's the pattern I see on a frame-by-frame basis:
frame adm2 motion2 vmaf-psnr vmaf
0 0.99415 0 51.48603 96.04917
1 0.98217 0 46.51105 92.86528
2 0.86527 0 25.305 41.55384
3 0.88616 5.47273 24.02293 50.6055
4 0.98737 4.50818 47.7387 100
5 0.98205 0 46.20227 92.81662
6 0.8591 0 25.63469 43.84714
7 0.98358 4.90082 46.8299 99.65214
8 0.98082 0 46.06436 92.55462
9 0.81607 0 25.2691 31.84736
10 0.8323 5.02721 26.03205 39.83634
11 0.97943 4.01224 45.83572 97.3602
12 0.98223 0 46.05179 92.76931
13 0.85919 0 26.81215 39.87247
Note that the ffmpeg psnr filter calculates values that vary with this same pattern. (not shown above). So, I don't think this is some anomaly with the libvmaf psnr.
The frames are definitely not a stuttering motion. It's a live-action film, and not telecined etc.
Am I doing something wrong with the encoding? I'm using
subme=10:deblock=-1,-1:me=umh:merange=32:mbtree=0:dct-decimate=0:fast-pskip=0:aq-mode=2:
psy-rd=1,0.15:vbv-maxrate=62500:level=4.1:ref=5:bframes=16:b-adapt=2:direct=auto:analyse=all:trellis=2:
vbv-bufsize=78125:rc-lookahead=60
The deblock and psy-rd are from "film tune". I have tested other values as well but these don't generally change the vmaf/psnr/motion2 scores.
I've tried level 5.1 in case i'm being buffer limited but i think crf17 is making that have no effect.
I've tested up to crf 9 and I only get up to about 76 vmaf, and with the same motion2/psnr pattern.
Lastly, if I reduce the ref.avi to yuv420p, i get the exactly same frame-by-frame scores for all metrics. This is what you'd expect since vmaf only considers luma.
I've got myself fairly well convinced this is an encoding problem, not a vmaf analysis problem. Any ideas?!?
I ripped a BD to uncompressed yuv422. I chose that format because it was easiest to work with in my NLE. After editing, I saved the result also as uncompressed yuv422 in MXF format. I extracted a 15m clip of the darkest scene to avi container using ffmpeg with -c:v copy. Here's what ffmpeg says about the clip:
Stream #1:0: Video: rawvideo (Y42B / 0x42323459), yuv422p, 1920x816, 601047 kb/s, SAR 1:1 DAR 40:17, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
I did many different test encodes using handbrake on mac. Here's what ffmpeg says about the encodes:
Stream #0:0: Video: wrapped_avframe, yuv420p, 1920x816 [SAR 1:1 DAR 40:17], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
I then used ffmpeg (again on mac) to do a libvmaf analysis, using the default model. The results are quite poor. Some selected samples:
psnr vmaf data rate
crf12 44.283 75.858 30.5
crf17 42.622 74.751 11.4
crf20 41.723 73.444 5.2
If you are knowledgable about vmaf, you know that the training model is limited to crf22. not exceptional. so at least i expect to be at 96+. The peak ranges for crf17 are there. For crf20 it's closer to 92. Here's where things get interesting. Here's the pattern I see on a frame-by-frame basis:
frame adm2 motion2 vmaf-psnr vmaf
0 0.99415 0 51.48603 96.04917
1 0.98217 0 46.51105 92.86528
2 0.86527 0 25.305 41.55384
3 0.88616 5.47273 24.02293 50.6055
4 0.98737 4.50818 47.7387 100
5 0.98205 0 46.20227 92.81662
6 0.8591 0 25.63469 43.84714
7 0.98358 4.90082 46.8299 99.65214
8 0.98082 0 46.06436 92.55462
9 0.81607 0 25.2691 31.84736
10 0.8323 5.02721 26.03205 39.83634
11 0.97943 4.01224 45.83572 97.3602
12 0.98223 0 46.05179 92.76931
13 0.85919 0 26.81215 39.87247
Note that the ffmpeg psnr filter calculates values that vary with this same pattern. (not shown above). So, I don't think this is some anomaly with the libvmaf psnr.
The frames are definitely not a stuttering motion. It's a live-action film, and not telecined etc.
Am I doing something wrong with the encoding? I'm using
subme=10:deblock=-1,-1:me=umh:merange=32:mbtree=0:dct-decimate=0:fast-pskip=0:aq-mode=2:
psy-rd=1,0.15:vbv-maxrate=62500:level=4.1:ref=5:bframes=16:b-adapt=2:direct=auto:analyse=all:trellis=2:
vbv-bufsize=78125:rc-lookahead=60
The deblock and psy-rd are from "film tune". I have tested other values as well but these don't generally change the vmaf/psnr/motion2 scores.
I've tried level 5.1 in case i'm being buffer limited but i think crf17 is making that have no effect.
I've tested up to crf 9 and I only get up to about 76 vmaf, and with the same motion2/psnr pattern.
Lastly, if I reduce the ref.avi to yuv420p, i get the exactly same frame-by-frame scores for all metrics. This is what you'd expect since vmaf only considers luma.
I've got myself fairly well convinced this is an encoding problem, not a vmaf analysis problem. Any ideas?!?