← Home ← Back to /g/

Thread 105989788

37 posts 52 images /g/
Anonymous No.105989788 [Report] >>105989798 >>105990258 >>105990327
Can the now popular VP9 video hardware decoder be tricked into decoding an "image"?

All this "Webp bad!" talk recently has me curious about something. Since the slop image codec is based on the VP8 video codec, wouldn't it then be possible to also punk out another format like this using VP9? Webp 2 seems to point to this but apparently it's an abandoned project.

https://chromium.googlesource.com/codecs/libwebp2/

Anyway how could this work? I doubt it's as simple as

ffmpeg in.png c:v libvpx-vp9 out.webm
Anonymous No.105989798 [Report] >>105989824
>>105989788 (OP)
>I doubt it's as simple as
well? have you fucking tried?
Anonymous No.105989824 [Report] >>105990472
>>105989798
Yes and my CPU gets raped to smithereens so obviously there's a lot missing into this hack. I want the VP9 hardware decoder to do the decoding not the CPU. Obviously the thing is expecting video not a fucking image so something must be done to trick it...
Anonymous No.105989915 [Report]
I'm gonna try this, convert the image into a webp file and then use that as the input...
Anonymous No.105989960 [Report]
FUCK. Didn't work.

Failed to initialize encoder: ABI version mismatch
[vost#0:0/libvpx-vp9 @ 0x7d8a897780] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
Anonymous No.105990241 [Report]
An image that looks like a regular VP9 video that's decoded by hardware decoders instead of the CPU. Maybe there's some kind of minimum duration expected by the hardware decoder????
Anonymous No.105990258 [Report] >>105990287
>>105989788 (OP)
Av1 and AVIF killed this
Anonymous No.105990287 [Report]
>>105990258
Yes but this shit hole of a website doesn't support anything good so we have to hack it like sharty did.
Anonymous No.105990327 [Report] >>105990354 >>105996762
>>105989788 (OP)
You mean like this? This is all old stuff.
Anonymous No.105990354 [Report] >>105990474
>>105990327
This doesn't play at all. We have to bullshit the VP9 hardware decoder into thinking it's decoding actual legitimate video somehow.
Anonymous No.105990363 [Report] >>105990392
You know you can create video files that are 1-frame in length and endlessly loop. Right?
Anonymous No.105990392 [Report]
>>105990363
Yes but they rape the CPU so it's not bullshitting the hardware VP9 decoder "enough".

My best guess so far is the input image MUST be a lossy .webp file because this is in fact a hacked VP8 video stream. BUTT it's not being hardware decoded...
Anonymous No.105990472 [Report]
Here's a quality 100 Webp of >>105989824

https://files.catbox.moe/wvhrx3.webp

Now it just needs to somehow become a "valid" VP9 video stream for the hardware decoder somehow.

BUTT HOW DOE...
Anonymous No.105990474 [Report] >>105990564
>>105990354
That's cus your hw decoder sucks and lacks support for 12-bit. Anyway, your research is useless as all of this has been superseded by avif as already mentioned.
Anonymous No.105990564 [Report]
>>105990474
Nope, this is still not it. CPU goes into overrdrive. A 2 minute duration SHOULD be bullshitting the hardware decoder but yet it's still not enough...
Anonymous No.105990663 [Report]
Maybe the hardware decoder just doesn't like iterating through a single video frame over and over again. I looked up online and I found this, maybe this is the key?

https://ottverse.com/how-to-loop-videos-using-ffmpeg-step-by-step-tutorial/
Anonymous No.105990877 [Report]
I think I got it, setting the stream loop to 1 and framerate to 1 at the beginning seems to bullshit the hardware decoder enough.

ffmpeg -framerate 1 -stream_loop 1 -i in.webp -c:v libvpx-vp9 -y out.webm

4chan only allows 2048x2048 video res max which is a huge shame since VP9 hardware decoders support 4096x2048, right?

So again this only seems to work if you open your image in something like GIMP and save it to a 100 quality .webp file first FYI.
Anonymous No.105991024 [Report]
Here's a 2048 x 2048 crop of this nasa image:
https://upload.wikimedia.org/wikipedia/commons/9/91/Bruce_McCandless_II_during_EVA_in_1984.jpg

Saved as a 100 quality Webp file:
https://files.catbox.moe/d70lo0.webp
Anonymous No.105991153 [Report]
When I calculate the SSIM compared to the massively bloated JPG of 3.6 MB I get 0.98 SSIM. A high quality score is 0.99 SSIm or greater so default VP9 settings aren't the best, tuning that will be next.

ffmpeg.exe -i out.webm -i in.jpg -lavfi ssim=stats_file=ssim_logfile.txt -f null -
Anonymous No.105991414 [Report]
Trip on daiz
Anonymous No.105991455 [Report]
Getting a quality setting to stick seems to be very tricky but I think I managed to force it to stay consistent for images. With a q? min/max + crf value of 5, it produces 0.99 SSIM against the quality 100 .webp input file. VP9 webm file size is roughly 30% smaller than the webp so that aligns with compression efficiency gains expectations as well.

Anyway here's the new webp to vp9 webm conversion params that also focus on the best quality possible and not just the default "good" quality.

ffmpeg -framerate 1 -stream_loop 1 -i in.webp -c:v libvpx-vp9 -quality best -crf 5 -qmin 5 -qmax 5 -y out.webm
Anonymous No.105991684 [Report]
One more image before I go find something to eat but yeah pretty cool that if your autism so desired it, it is possible to get highly compressed images on 4chan that are also VP9 hardware decoded through this somewhat convoluted process.

https://files.catbox.moe/03940h.webp
Anonymous No.105991698 [Report]
It's interesting to note that converting an image into a "video" doesn't affect black and white images. Only color images are actually affected.
Anonymous No.105993162 [Report]
So why doesn't using a normal image format like PNG work? I tried to make one and it won't even play on my phone.
Anonymous No.105994065 [Report] >>105998064
I wonder if transparency works, VP9 supports yuva420p (but not yuva444p sadly).
Anonymous No.105994070 [Report]
test
Anonymous No.105994103 [Report] >>105998064
test2 with -auto-alt-ref 0
Anonymous No.105994191 [Report] >>105998064
test3 with the old vp8 encoder + -auto-alt-ref 0
Anonymous No.105995806 [Report] >>105998064
>alpha mode 1 missing from 4chan webm after upload
Hmm so it seems 4chan strips the transparency metadata from webms you upload here. That fucking blows, this bullshit thread could have been exponentially more useful otherwise. On a related note it seems that ffmpeg supports webp natively now so all of this can be done through 1 line, like this:

for %f in (*.png) do ffmpeg -i "%f" -quality 100 "%~nf.webp" & ffmpeg -framerate 1 -stream_loop 1 -i "%~nf.webp" -c:v libvpx-vp9 -quality best -crf 10 -qmin 10 -qmax 10 "%~nf.webm"

I'm not sure what resolution would be ideal but I'll try to stick with 720p since that seems like the minimum resolution VP9 was intended for and fits nicely on a 1080p display. Also crf 5 seems kinda overkill imho, I don't notice a huge improvement over crf 10 so I'll be using the latter.
Anonymous No.105996586 [Report]
Man, this isn't going to be anywhere near as fun because webp transparency is disabled.
Anonymous No.105996762 [Report]
>>105990327
This would cut down on the phoneposters shitting up our boards with twitter screenshots. I wouldn't mind desu.
Anonymous No.105997167 [Report] >>105999296
OP how many stimulants have you consumed today?
Anonymous No.105998064 [Report] >>105999339
>>105994065
>>105994103
>>105994191
>>105995806
Fucking stupid newfag
Anonymous No.105999296 [Report]
>>105997167
Tell that to the dev team that won't allow for better image formats. This is a solution to that problem.
Anonymous No.105999339 [Report] >>105999899
>>105998064
I still don't get why they decided to remove it. Does Jay™ really have that much say in the tech stuff?
Anonymous No.105999899 [Report]
>>105999339
People were hiding pizza in the metadata. 4chinz started scrubbing it all over 3 years ago. Go back.
Anonymous No.106000168 [Report]