Video Bitrate Scaling

I have here a 10-second clip encoded in 4 different resolutions using this formula for the bitrate; (Width*Height)/1024=Bitrate. I'm calling this Bit Per Pixel for this thread (although to be truly 1 bit per pixel the bitrate would have to be multiplied by the framrate, i.e. 30 times higher).

At 1080p the details are quite good, but going down the resolutions that detail is lost even though it should still have an equal bitrate for its resolution to work with, or am I wrong?

Is there some tweak to make it scale linearly?

The last video is 360p resolution with 1080p bitrate, just to see how good it looks.

Other urls found in this thread:

rarbg.to/torrent/a5gwofdu86z1x7hsmkjrnlbt32c4pv9eiqy45krt6zmos7v2ijn8gd13w9pclufbqxyeah
twitter.com/NSFWRedditImage

...

If that is your formula, the bitrate goes down if you decrease resolution. What exactly is the problem here?

Yes, the point is that bitrate goes down if I decrease resolution, but I still have the same amount of "Bits Per Pixel" since a lower resolution should demand a lesser bitrate for a comparable amount of detail, but following the formula the detail is obviously lost in the lower resolution, and I'd like to know why.

I might be retarded.
I think I got why... the framerate doesn't change.

Sauce?

Even if it was a linear function they have constants. So instead of being f(x) = x, it may be something like f(x) = x + k, for some k, see oekaki.
Still I really doubt it is a linear function, there may be some variables you are missing.

rarbg.to/torrent/a5gwofdu86z1x7hsmkjrnlbt32c4pv9eiqy45krt6zmos7v2ijn8gd13w9pclufbqxyeah

Thanks m8

I believe it's the framerate.
Whatever resolution I use, the framerate stays the same.
I'm trying to figure out a new formula that uses the framerate to get a consistent BPP.

Fore example, using the current formula (W*H)/1024 yields me a bitrate of 2025 at 1080p, so divide that by the framerate (30) and I get 67.5, that's the BPP of a single frame.
If I do the same with 720p I get 30, that's less than half the BPP of 1080p, and it gets worse the further down I go;

1080p - 67.5
720p - 30
480p - 13.3
360p - 7.5

I need a formula that takes an acceptable BPP (let's say 65, since the quality at 1080p is quite good) and applies it to a resolution and framerate to get the bitrate I want.

I'm trying to work it out now, but I truly suck at math, so any help is appreciated.

((W*H)/1024)/30 gives you bits-per-frame, not bits-per-pixel.

The amount of detail probably just doesn't scale linearly, in addition to some overhead most codecs have.

You can try something like this for bpp 3.25-log(W*H)/6.5.
So for bitrate it could look like this:
W*H*(3.25-log(W*H)/6.5)
-------------------------------------
1024

I found a value in MediaInfo called "Bits/(Pixel*Frame)" which seems to be bits-per-pixel.

All the three clips here have the same value (0.033) but the quality obviously dips the further down I go (I'm using MP4 this time since MediaInfo can't seem to get the value out of WebMs).


Huh....
You might have missed this in the thread before, but I suck at math.

Sorry, I took it that you suck at figuring out math, not copying and pasting formulas.

Is that a natural log or log base 10?
Also, are order of operations assumed?

Natural. Normal mathematical precedence is assumed. Any half decent program/language does that correctly anyway.

btw it's entirely possible that the formula for bpp isn't all that good.. still better than constant bpp though.

I think I got it, it's the reverse of "Bits/(Pixel*Frame)".

((Pixel*Frame)*BPP)/1000

Example: 2073600*29.97=62145792*0.050=3107289,6/1000=3107

A file with a resolution of 1080p and a framerate of 29.97 encoded with a bitrate of 3107 wil produce a file with a BPP of 50 (0.050 kilobits).

Aside from the ugliness, is there anything wrong with this formula?

Unless higher fps means more movement, it doesn't linearly translate into bitrate. The same video with 2 bitrates will have smaller deltas between frames (=> less bits/frame needed) for the higher fps encode. I'd try something like 2.9*(fps^0.7). You might want to adjust the constants.

Well, it is video, you could do 2pass and have the codec allot more bits where needed. This is just for a baseline quality.

If you want just constant quality, than vp9 can do that. You could test that, without bothering with bitrate.

Indeed it can, but my use for this is find an equilibrium between filesize and quality when making WebMs. If I have a file of a certain length and the bitrate for hitting 8MB falls below the limit for acceptable quality I'll lower the resolution.

I've already done this using a method similar to yours.
This is a product of it.

As said, it's not linear with frame resolution, and it's a pretty dumb way of going about creating webm's.
That being said, it's good enough for fast conversions, especially if you run your encoder on strong hardware.

For VP8:
Use output file size, and desired audio bitrate to estimate video bitrate, then use the video bitrate to resize the video to achieve a specific BPP. Have the script/program adjust qmin/qmax according to some preset voodoo, and set slices according to output resolution.

I haven't messed with VP9 yet, but since it's gotten multi-threaded encoding, it's worth the time.

...

...