[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


Janitor applications are now open. Apply here!


[Advertise on 4chan]


I am 90% sure I have fixed my windows batch SSIM AV1 auto-encoder script. I'll be posting AV1 webms here: https://umigalaxy.com/explore/general/629-ssimav1-script-v21

@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
>>
File: ssim-1024x851.png (97 KB, 1024x851)
97 KB PNG
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/
>>
File: 4chan.mp4 (3.85 MB, 1280x720)
3.85 MB
3.85 MB MP4
Holy fucking fuck.

MP4= 18518 KB
AV1= 3891 KB
**** 78% filesize reduction achieved with AV1 ****


https://media.umigalaxy.com/general/1780117866426.webm
>>
>>108939200
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:
[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)


Script SSIM result is valid.
>>
File: 4chan.mp4 (1.03 MB, 1280x720)
1.03 MB
1.03 MB MP4
SSIM: 0.990 @ CRF 58

MP4= 3350 KB
AV1= 1042 KB
**** 68% filesize reduction achieved with AV1 ****


https://macaulaylibrary.org/asset/456444101
>>
>>108939404
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:
[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)


Script SSIM result is valid.
>>
File: 1779981143094328.jpg (125 KB, 774x896)
125 KB JPG
>>108939404
Forgot to link to AV1 on umigalaxy: https://media.umigalaxy.com/general/1780120567280.webm

WEW, everything looks good so far. I'll continue tomorrow.
>>
File: 1569920189543.jpg (329 KB, 936x931)
329 KB JPG
Can anyone convert this to bash?
>>
>>108938759
Whats wrong with just using crf36 and calling it a day? Looks ok
>>
File: 1780137051130.jpg (374 KB, 1425x1957)
374 KB JPG
>windows batch
>>
File: x264 non dogshit encode.mp4 (3.05 MB, 1280x720)
3.05 MB
3.05 MB MP4
>>108939200
very misleading dogshit x264 encode for your comparison
I fixed that for you here, dumbass
>>
File: x264 non dogshit encode2.mp4 (1.01 MB, 1280x720)
1.01 MB
1.01 MB MP4
>>108939404
and here
>>
File: 1772483570266.png (117 KB, 1200x630)
117 KB PNG
>>108940166
The CRF scale on x264 and AV1 encoders aren't compatible with each other, you need to run a SSIM to double check quality/compression ratio to make sure you're not wasting 10 Mbps on 1% quality improvement vs 6 Mbps. If they were, mpeg-la kikes would sue for trillions of dollars. I'm not even exaggerating, after the farce that was HEVC, they're getting desperate as fuck now and increasing H.264 royalty payment requirements.

https://www.tomshardware.com/service-providers/streaming/h264-streaming-license-fees-jump-from-100000-to-4-5-million
>>
>>108940166

it might be good as is if in doubt ask seniors about preferred keyframe interwall
>>
>>108940980
This one looks worse, it's not as blocky, but now it's a blur fest.

>>108940990
This one looks kinda okay.
>>
>>108941088
a blind person typed those words
>>
>>108941152
Nope, I have a pretty big 32 inch 1080p IPS monitor. You definitely used some kind of aggressive smoothing filter on >>108940980

The blocky H.264 on >>108939200 has much more crisp/clear detail on the bird feathers.
>>
File: avidemux.png (451 KB, 1143x867)
451 KB PNG
>>108941195
zero filter, it's just x264 preset veryslow, target size 3MB, using avidemux (outdated x264 lib)
you got exposed for your misleading bullshit, take the L, buy some glasses and move on.
>>
File: btfod.png (1.7 MB, 1280x2160)
1.7 MB PNG
AV1 is even blurrier than base x264 on the feathers
>>
File: Untitled.png (144 KB, 1855x1080)
144 KB PNG
>>108941227
>>108941238
Not OP and use ffmpeg you retard, all the cool psy-rd stuff that doesn't blur the shit out of H264 video is on the latest libx264 not the one from 2012. What are you, a 4chan developer? Your H.264 video both objectively and subjectively, looks like blurry shit.
>>
>>108941303
>Not OP
so subtle, blindanon
>>
File: 4chan.mp4 (853 KB, 1280x720)
853 KB
853 KB MP4
SSIM: 0.992 @ CRF 50

MP4= 3230 KB
AV1= 856 KB
**** 73% filesize reduction achieved with AV1 ****


https://macaulaylibrary.org/asset/445103041

umi AV1: https://media.umigalaxy.com/general/1780147926013.webm
>>
>>108941517
another dogshit misleading encode, i wonder why you feel the need to lie so much, is av1 THAT disappointing?
>>
if av2 is so good why is this nigga still using av1?
>>
File: output264.mp4 (730 KB, 1280x720)
730 KB
730 KB MP4
>>108941517
>>108941532
here, a normal x264 encode
>>
What’s the point of shilling streaming trash that’s made purely to save a few bucks on streaming costs? You’ll spend more on electricity converting shit to av1 vs just buying another hdd, even if the reencoding would preserve the quality (it doesn’t)
>>
>>108941652
Yeah I have no idea. It's all low bitrate trash instead of what you'd want for a movie encode.
>>
File: ssimnorm-vs-crf-value.png (71 KB, 1254x800)
71 KB PNG
>>108941618
Because I'm not a fucking nigger and care about hw support. Widespread AV2 hw support is like what, 10 years away at best?

https://en.wikipedia.org/wiki/AV1#Hardware_encoding_and_decoding_support

Even AV1 is only 70% there when you factor in all the phone CPUs that lack AV1 hw support.

>>108941652
>>108941669
This thread is stress testing AV1 with 0.99 SSIM encodes with only a tiny reduction in quality. This wasn't really possible before because when AV1 launched it could only achieve 30-50% better compression efficiency over H264 at low to medium quality, at high quality it was 10-20% better compression efficiency over H264. From my limited testing SVT-AV1 with tune 0 and variance boost enabled can be used for high quality encodes now.

Keep in mind that I'm testing 1280x720 not 4K where AV1 achieves like 80% better compression efficiency over H.264 due to more adaptive/extensive use of giant 128x128 superblocks.

>video frames aren’t processed as a whole. In AV1 video encoding, they are divided into same-sized blocks called "superblocks", which can be either 128x128 or 64x64 pixels. These superblocks can then be split into smaller blocks using different partitioning patterns. These blocks are then processed at a smaller level."

https://imagekit.io/blog/av1-codec/

So low resolution video + 0.99 SSIM = AV1 torture test
>>
>>108941733
>at high quality it was 10-20% better compression efficiency over H264

so it's really 0% since you had to fake your shit h264 encodes so that AV1 could beat them by 10%
>>
File: 1779693573148511.mp4 (2.09 MB, 576x1024)
2.09 MB
2.09 MB MP4
>>108941824
I'm not testing against the MP4 files I upload here, I'm testing against the ones in:

https://macaulaylibrary.org/

I might do another thread with a 0.99 SSIM H.264 vs 0.99 SSIM AV1 encodes but for this thread I want to focus on ripping existing bloated MP4 videos on the internet to 0.99 SSIM AV1 and making sure my SSIM/AV1 script is working. Last thread it was giving out completely wrong SSIM results. Forcing in/out to -r 30 seems to have fixed this but I want to do a couple more test videos just to be sure...

I can start using ultrafast x264 vbr instead of x264 fast vbr for the 4chan uploads here if you'd like.
>>
>>108941915
There's not enough difference in encode time for a 15sec video between slower presets and the poor ones you use.
You're just dishonest because AV1 doesn't make any meaningful difference without it.
>>
File: CHQ1I0PUwAEawq5.jpg (33 KB, 595x414)
33 KB JPG
>>108942158
K, well I'm not doing a AV1 0.99 SSIM vs H.264 0.99 SSIM thread right now. I'll take that into consideration when I do that but I don't think anything less than a blu-ray 20 Mbps mux is going to satisfy that kind of testing so I'm not in hurry to get that done.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.