Git Product home page Git Product logo

Comments (6)

kornelski avatar kornelski commented on September 28, 2024 1

sindresorhus/Gifski#1 (comment)

width * height * frames / 3 * (quality + 1.5) / 2.5

from gifski.

kornelski avatar kornelski commented on September 28, 2024 1

No problem :)

from gifski.

kornelski avatar kornelski commented on September 28, 2024 1

The estimate is inaccurate, because the actual file size depends on amount of color, noise an movement in the clip, which isn't known in advance.

If you have actual data, you can come up with a better estimate :)

from gifski.

jalba69 avatar jalba69 commented on September 28, 2024

Fantastic, thanks a lot for the quick reply.

Did not had the idea to look on the gifski-app git not using any apple device but I'll do the next time i'll have some other questions before bothering you here.

You can't imagine how helpful this will be for me.

Thanks again for all :)

closing this -

from gifski.

jalba69 avatar jalba69 commented on September 28, 2024

Hello Kornelski,

Sorry for re-opening this but before i go further i need to be sure i am not doing something wrong.

Finished my powershell thing and started to run intensive tests but something is not adding up with estimation of size, so i added some more functions to log in sizes estimations in my script vs sizes really created and well... i'm wondering now ...

Formula i use for bytes is this :
$Bytes_Size = [math]::Round(((([int]$Width * [int]$Height * [int]$framecount) / 3) * (([int]$quality_setting_Input / 100 ) + 1.5)) / 2.5)

To be more clear it's
( ( ( (Width * Height * Number of Frames) /3) * ( (Quality /100) +1.5) ) /2.5 )

If i made no errors the quality setting is from range 0.1 to 1 , not 1 to 100 like i use in my input parameters for the .exe, this is why i do the (quality /100).

Anyways i run some semi automated testings with logging to csv and after a bit of analyze it seems totally off as you can see here :

2018-03-06_005543
( Click to enlarge )

All done with quality 100 for those first initial tests, the resizes are made before creating the frames, it ain't gifski managing this in those tests. Just 256 frames from 4 video sources, resized in Staxrip with a avisynth filter then the avisynth script sent to ffmpeg for the frames extraction ,then gifski does his job.

Looked into the link you provided and there the discussion seems to be for videos directly feeding GifSki and results seems accurate for what i understood, so i'm wondering if the formula is also valid when feeding it with png's created with ffmpeg like i do ( they are 24 bits png's if i make no error )

There is a few results not too bad for the HQcartoon at mid sizes resolutions, the cartoon in higher resolution or in tiny one the values are off by a good margin, when it comes to real videos footage it's totally off by a large margin.

Not sure if you have any guess on this, maybe it is normal and best accuracy i can get guessing the sizes, or if using png's messes the formula compared to feeding it with videos directly .

My work is almost done but this isn't adding up for me so i need to be sure that either i did not interpreted the formula wrong or that the png's or something else gives some funky results, then i'll start to run some testings with quality changes and log this to see results too.

Thanks again and sorry for bothering you with this :)

from gifski.

jalba69 avatar jalba69 commented on September 28, 2024

Thanks a lot,

That's what i was afraid of :p

The ones that were more accurate were a HD cartoon with very low movement and while the cartoon is having a lot of details there isn't a lot of colors compared to some of the videos i tested.

I'll do some more testing with logging and might try to come up with something a bit more accurate if i find a pattern in the results, then i can add a simple select setting on my script like

Movement - Scenes changes "slow/medium/very_high"
Colors " Cartoon - low colors/ low res video- medium colors/ HQ res video - High colors " 

And selected a mulitiplicator for the calculated size, this is if i manage to get a half decent pattern after running many tests on various footage to start with :p

--
Or maybe avisynth can come up handy for this with global motion tools plugins and some plugins for colors detection that might be able to perform an analyze uphill, this analyze can then be automated in Staxrip/avisynth script and get a value that will serve as adjustment value for the size estimation i guess.

Well... a lot of things to study and test and load of work but it's an interesting option to explore :)

Thanks again

Closing this for good now, will take me some time to explore those possible options, my powershell script is ready and works inside Staxrip, the good thing is that used in Staxrip i can change the video fps, add some overlays/ text on the gif easily, add some color or video filters or whatever is possible with avisynth before sending the result to ffmpeg then to Gifski, and get very nice HQ Gifs in a few clicks only :)

Thanks a lot for your help :)

from gifski.

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.