
I am 90% sure I have fixed my windows batch SSIM AV1 auto-encoder script.@echo off & setlocal enabledelayedexpansion & set "crf=60" & set "mincrf=20" set "base_av1=-c:v libsvtav1 -preset 4 -pix_fmt yuv420p10le -svtav1-params" set "psy_av1=keyint=5s:lookahead=120:tune=0:enable-variance-boost=1:variance-boost-strength=3:variance-octile=4" set "opus=-c:a libopus -b:a 128k" & set "ffquiet=-hide_banner -loglevel quiet" echo Weclome to my auto-SSIM AV1 encoder, only input.mp4 accepted, choose desired SSIM: echo 1= 0.995 (autism quality) & echo 2= 0.990 (very high quality) & echo 3= 0.980 (high quality) choice /c 123 /m "Enter number option on keyboard: " if errorlevel 3 set ssim_target=980 if errorlevel 2 set ssim_target=990 if errorlevel 1 set ssim_target=995 echo: :loop ffmpeg !ffquiet! -i input.mp4 -crf !crf! !base_av1! !psy_av1! !opus! -y AV1_CRF-!crf!.webm 2>nul for /f "delims=" %%A in ('ffmpeg -nostdin -r 30 -i AV1_CRF-!crf!.webm -nostdin -r 30 -i input.mp4 ^ -filter_complex "[0:v]format=yuv420p10le[v0];[1:v]format=yuv420p10le[v1];[v0][v1]ssim" -f null - 2^>^&1 ^| findstr "All:"') do set "a=%%A" set "a=!a:*All:0.=!" & set "ssim=!a:~0,3!" & echo SSIM: 0.!ssim! @ CRF !crf! & echo: if !ssim! lss !ssim_target! (if !crf! gtr !mincrf! (del /s /q AV1_CRF-!crf!.webm >nul 2>&1 & set /a crf-=2 & goto loop) ) :end for %%Y in ("input.mp4") do set /a kb_mp4=(%%~zY+1023)/1024 & for %%Y in ("AV1_CRF-!crf!.webm") do set /a kb_webm=(%%~zY+1023)/1024 set /a saved_pct=(kb_mp4-kb_webm)*100/kb_mp4 & echo MP4= !kb_mp4! KB & echo AV1= !kb_webm! KB echo **** !saved_pct!%% filesize reduction achieved with AV1 **** pause

Also I've been thinking about 2 testing areas.
The first is since AV1's SSIM cheating can be disabled by tune 0/variance boost and allow AV1 to encode video at high quality, what SSIM should I aim for? 0.98 is arguably already high quality but 0.99 preserves existing MP4 videos on the web much better with only a tiny reduction in existing quality and it's also why most people stick with H.264 because they believe AV1 is only useful for streaming slop quality. I've settled on 0.99 but just keep in mind that you may not see the usual 30-50% better compression efficiency over H.264 because high entropy is a bitch. Still 0.99 SSIM will be a pretty cool torture test for AV1 when you factor how in picrel.
The second is sourcing high quality MP4 video samples. 4chan's /wsg/ ones are usually pretty terrible in quality even when the MP4 itself has a bloated bitrate. Tiktok/Snapchat/Twitter aren't much better. I've thought about sourcing blu-ray H.264 muxes but I'm obviously going to get 90% filesize reduction there and it's too much work.
I think I found a good middle ground: https://macaulaylibrary.org/

Holy fucking fuck.MP4= 18518 KB AV1= 3891 KB **** 78% filesize reduction achieved with AV1 ****
>>636
Forgot video source: https://macaulaylibrary.org/asset/628618802
Also converted in/out video to .y4m and ran this:ffmpeg -r 30 -i output.y4m -r 30 -i input.y4m -lavfi ssim -f null -
Got:Script SSIM result is valid.[Parsed_ssim_0 @ 0000021bd8402300] SSIM Y:0.988474 (19.383303) U:0.993845 (22.107487) V:0.993815 (22.086437) All:0.990259 (20.114142)

https://macaulaylibrary.org/asset/456444101SSIM: 0.990 @ CRF 58 MP4= 3350 KB AV1= 1042 KB **** 68% filesize reduction achieved with AV1 ****
>>638
Converted in/out video to .y4m and ran this:ffmpeg -r 30 -i output.y4m -r 30 -i input.y4m -lavfi ssim -f null -
Got:Script SSIM result is valid.[Parsed_ssim_0 @ 00000200c3fa0740] SSIM Y:0.988085 (19.239099) U:0.994359 (22.486277) V:0.994747 (22.795538) All:0.990241 (20.105928)

https://macaulaylibrary.org/asset/445103041SSIM: 0.992 @ CRF 50 MP4= 3230 KB AV1= 856 KB **** 73% filesize reduction achieved with AV1 ****
>>629 (OP)
Very nice, anon, good job
>>640
I love this color
>>640
Converted in/out video to .y4m and ran this:ffmpeg -r 30 -i output.y4m -r 30 -i input.y4m -lavfi ssim -f null -
Got:Script SSIM result is valid.[Parsed_ssim_0 @ 0000017f15ef1300] SSIM Y:0.991726 (20.822658) U:0.994994 (23.005166) V:0.994861 (22.890891) All:0.992793 (21.422383)

https://i.4cdn.org/wsg/1780247723462520.mp4SSIM: 0.990 @ CRF 48 MP4= 4528 KB AV1= 1630 KB **** 64% filesize reduction achieved with AV1 ****
>>644
Testing known problem MP4 giving me wrong SSIM result.
Converted in/out video to .y4m and ran this:ffmpeg -r 30 -i output.y4m -r 30 -i input.y4m -lavfi ssim -f null -
Got:Script SSIM result is valid.[Parsed_ssim_0 @ 000002521fe389c0] SSIM Y:0.988880 (19.538991) U:0.992380 (21.180455) V:0.992690 (21.360996) All:0.990098 (20.042968)