2

I like to do many comparisons and check before picking a codec and selecting its settings.

Settings with HuffYUV are few but more importantly I'm having trouble determining video file sizes.

Given pixel width, height and pixel format, is it possible to predict a file size for a video encoded with the HuffYUV lossless codec?

I would like to prepare a simple converter to get an estimate of how much space it takes hours, minutes, seconds ;)

Which formula can I use? I'm OK even if you throw me out a complex model, I'm kinda a math guy.

ps: I know my english is poor and is also a bit late so if you good guys think this question could be edited in a better way feel free to do it ;D

2 Answers 2

3

The answer is No. Besides the frame dimensions, there's the matter of content complexity. Without scanning the video and doing a first-pass as it were, it's not possible to predict the output size. A video consisting of a slideshow of very simple text slides will be much easier to compress than scenes of busy city life..etc.

The closest you may come to making some sort of prediction is to encode a few representative segments from the source file and compare those bitrates. If there isn't a large difference among the bitrates of the various encoded segments, then you may assume a bitrate in that range for the final output. Of course, this method can't account for anomalous segments in the video of very high or low complexity compared to the rest of it, so sample selection is important.

10
  • I see, so in this case I think will be need a different approach: grab tons of segments of videos of any different kinds, all of the same size eg: full hd would be a good starting point. Batch convert them all with huffyuv for a small amount of time, let's say not more than 3 min, do a statistical analysis of the file sizes getting a plain average, a maximum and a sort of "flavored average" for video with text, heavy media, and different categories content. Get your coefficients, prepare a simple calculator based on this coefficients. :) Commented Nov 1, 2015 at 8:16
  • My approach requires encoding multiple segments of the same duration from within the same video to a) check resulting bitrates and b) variance of bitrate across the segments. HuffYUV uses intraframe compression, so no need to use segment size of 3 minutes. In fact, make it closer to a few seconds.
    – Gyan
    Commented Nov 1, 2015 at 8:29
  • Thank you for the suggestion, I'm tempted to bring some media here and do the tests. Yeah, your approach is the most correct for obtain the result of a single video, and better fit the original question. My final goal however was understand how in average a Huffyuv video will take. Commented Nov 1, 2015 at 8:32
  • Would be nice if you could help me setup the test environment, what is your recommendation ? 5 seconds could work ? or 10 in order to sample more frames ? there's a way for start a chat here or i have to reach like 7-8 comments ? Commented Nov 1, 2015 at 11:38
  • 5 seconds is good. I'm not a coder, but if you are, you can write a script to pick N random numbers from 0 to D-5 where D is the duration of your input file. Then just execute ffmpeg -ss T -t 5 -i input -c:v huffyuv -an "input-T.avi" where T are the numbers you generated, one by one. It's upto you what statistical analysis you wish to perform with the resulting files, but mean and SD comes to mind. Consult the stats SE, maybe.
    – Gyan
    Commented Nov 1, 2015 at 11:54
1

For 1080p, I often stick with.. (80 secs) - equals close to the 4gb limit.

1
  • It's realistic to assume so around 3.0 - 3.2 GB per min at 1080p I guess.. Commented Mar 14, 2017 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.