Comments (6)
sindresorhus/Gifski#1 (comment)
width * height * frames / 3 * (quality + 1.5) / 2.5
from gifski.
No problem :)
from gifski.
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.
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.
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 :
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.
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)
- feature: support longer lists of input files HOT 3
- update version on `crates.io`?
- Upgrade shlex to version 1.3.0 HOT 3
- The issue of memory explosion HOT 1
- Version 1.14 notifiying that new version available HOT 3
- Here are some shadows on white background gif. HOT 1
- Update fails HOT 1
- please rename 1.31.1 tag to 1.13.1 HOT 3
- Allow end_pause when looping HOT 2
- Commands do not work on Windows 11 HOT 1
- GUI does not allow changing FPS beyond default values HOT 1
- No Windows binaries in CLI binary release? HOT 2
- Error in example script for FFMPEG usage of yuv4mpegpipe HOT 1
- Add option to install command line tool with winget
- Fails to build with 'video' feature enabled HOT 3
- Feature request: generate gif as palindrome HOT 1
- No CLI builds for Windows. HOT 1
- About err code 3 (GIFSKI_QUANT) HOT 2
- Gifski only opens as a background process on Windows 10
- Pipe frames to gifski using stdin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gifski.