Coder Social home page Coder Social logo

Comments (3)

renpytom avatar renpytom commented on May 22, 2024 1

That's convicing. I've re-enabled MMX for now.

from renpy-build.

gojira667 avatar gojira667 commented on May 22, 2024

Of course I forgot that the test VP9 video is YUV444... You still get a nice reduction in CPU usage with VP9 and YUV420 movies.

from renpy-build.

gojira667 avatar gojira667 commented on May 22, 2024

I made a sample 4k project using Tears of Steel as that's what Google uses in their examples. Downloaded it and took a short clip near the start:

ffmpeg -ss 00:00:09 -to 00:00:25 -i tearsofsteel_4k.mov -c copy tearsofsteel_4k_09s-25s.mov

Butchered it to 60 FPS, YUV420 and transcoded to VP8, VP9 then later AV1 both at 4k & 1080p (encodes are not equivalent to each other & may contain unused options):

ffmpeg transcodes:
ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=3840x2160 -tile-columns 3 -g 240 -c:v libvpx -r 60 -row-mt 1 -crf 12 -b:v 23552K -pass 1 -pix_fmt yuv420p -an -f null /dev/null && ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=3840x2160 -tile-columns 3 -c:v libvpx -row-mt 1 -crf 12 -b:v 23552K -pass 2 -pix_fmt yuv420p -g 240 -r 60 -c:a libopus tearsofsteel_4k_09s-25s-60.webm

ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=3840x2160 -tile-columns 3 -g 240 -c:v libvpx-vp9 -r 60 -row-mt 1 -crf 12 -b:v 23552K -pass 1 -pix_fmt yuv420p -an -f null /dev/null && ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=3840x2160 -tile-columns 3 -c:v libvpx-vp9 -r 60 -row-mt 1 -crf 12 -b:v 23552K -pass 2 -pix_fmt yuv420p -g 240 -c:a libopus tearsofsteel_4k_09s-25s-vp9-60.webm

ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=3840x2160 -g 300 -c:v libaom-av1 -r 60 -row-mt 1 -tiles 4x1 -crf 16 -b:v 23552K -pass 1 -pix_fmt yuv420p -an -f null /dev/null && time ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=3840x2160 -c:v libaom-av1 -row-mt 1 -tiles 4x1 -crf 16 -b:v 23552K -pass 2 -pix_fmt yuv420p -g 300 -r 60 -c:a libopus tearsofsteel_4k_09s-25s-av1-60.webm

ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=1920x1080 -tile-columns 3 -g 240 -c:v libvpx -r 60 -row-mt 1 -crf 12 -b:v 23552K -pass 1 -pix_fmt yuv420p -an -f null /dev/null && ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=1920x1080 -tile-columns 3 -c:v libvpx -row-mt 1 -crf 12 -b:v 23552K -pass 2 -pix_fmt yuv420p -g 240 -r 60 -c:a libopus tearsofsteel_1080_09s-25s-60.webm

ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=1920x1080 -tile-columns 3 -g 240 -c:v libvpx-vp9 -r 60 -row-mt 1 -crf 12 -b:v 23552K -pass 1 -pix_fmt yuv420p -an -f null /dev/null && ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=1920x1080 -tile-columns 3 -c:v libvpx-vp9 -r 60 -row-mt 1 -crf 12 -b:v 23552K -pass 2 -pix_fmt yuv420p -g 240 -c:a libopus tearsofsteel_1080_09s-25s-vp9-60.webm

ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=1920x1080 -g 300 -c:v libsvtav1 -preset 1 -r 60 -row-mt 1 -tiles 4x1 -crf 16 -b:v 23552K -pass 1 -pix_fmt yuv420p -an -f null /dev/null && time ffmpeg -i tearsofsteel_4k_09s-25s.mov -vf scale=1920x1080 -c:v libsvtav1 -preset 1 -row-mt 1 -tiles 4x1 -crf 16 -b:v 23552K -pass 2 -pix_fmt yuv420p -g 300 -r 60 -c:a libopus tearsofsteel_1080_09s-25s-av1-stv-60.webm

Well -vf scale= didn't do quite what I was expecting. Played via renpy.movie_cutscene looping once each time; playback order 4k:VP8-VP9-AV1, 1080:VP8-VP9-AV1:

renpy.movie_cutscene()
    $ renpy.movie_cutscene("images/tearsofsteel_4k_09s-25s-60.webm", loops=1)
    $ renpy.movie_cutscene("images/tearsofsteel_4k_09s-25s-vp9-60.webm", loops=1)
    $ renpy.movie_cutscene("images/tearsofsteel_4k_09s-25s-av1-60.webm", loops=1)
    $ renpy.movie_cutscene("images/tearsofsteel_1080_09s-25s-60.webm", loops=1)
    $ renpy.movie_cutscene("images/tearsofsteel_1080_09s-25s-vp9-60.webm", loops=1)
    $ renpy.movie_cutscene("images/tearsofsteel_1080_09s-25s-av1-stv-60.webm", loops=1)

New Ryzen system (Debian sid)

Default renpy-8.1.1-sdk lib:

4kt-lib-def-Zen4-8 1 1-sdk

MMX
4kt-lib-mmx-Zen4-8 1 1-sdk

As you can see both the VP8 & VP9 playback see a significant reduction in CPU with a MMX enabled build. AV1 is largely unaffected with this CPU.

Then I actually read the Tears of Steel about page. I did not include the credit scroll, so I'm not entirely certain how kosher it is to share it like this.

But it's trivial to reproduce as it applies to all VP8/VP9 videos.

from renpy-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.