Кодирование видео: насколько размер видеофайла увеличивается с частотой кадров в секунду?

14934
knweiss

Учитывая, что следующие блокбастеры, например, Питера Джексона («Хоббит») и Джеймса Кэмерона («Аватар 2»), будут сниматься с частотой кадров 48 кадров в секунду (или даже больше), то есть больше, чем обычные 24 кадра в секунду, мне было интересно: Насколько увеличивается размер файла закодированного видео с частотой кадров ?

С увеличением fps разница между кадрами становится все меньше и меньше . Поэтому я предполагаю, что размер файла растет меньше, чем линейный. Это правда? Есть ли эмпирическое правило? Или у кого-нибудь есть примеры размеров файлов того же видео, закодированных в 24, 48, 60 и 96 кадров в секунду (с современным видеокодеком)?

(Дополнительный вопрос: насколько размер видеофайла увеличивается с размерами изображения, превышающими Full HD - например, с Full HD до 4k?)

6
Быстрый ответ на ваш побочный вопрос: прямо пропорционален количеству пикселей одного изображения. Итак, если вы собираетесь увеличить разрешение в 1920x1080 раз, как по ширине, так и по высоте, то вы в четыре раза увеличите скорость передачи данных. Главный вопрос гораздо сложнее :) Bora 12 лет назад 1
На размер файла влияют только фактические кадры (не выдерживающие накладные расходы контейнера), а не частота кадров. Вы можете закодировать в видео 24 физических кадра в секунду, но при этом оно будет отображаться как и / или воспроизводиться со скоростью 48 кадров в секунду (проигрыватель пропускает все остальные кадры), в то время как, наоборот, вы можете воспроизводить 48 кадров в секунду при 24 (проигрыватель проигрывает каждый вдвое дольше). 48 @ 24 будет иметь больший размер, чем 24 @ 48, потому что в нем больше кодированных кадров. Synetech 10 лет назад 1

3 ответа на вопрос

4
Uninspired

The ONLY thing that impacts filesize is bitrate. You can do 1fps or 120fps, and if your bitrate is 1000Mbs, the filesize will be exactly the same. By definition, the bitrate defines the filesize. Feel free to test -- take a video and output it in 10 different dimensions and 10 different fps, and you're going to end up with identical (or negligible difference) filesizes.

This is a simplification, however, if you want to discuss filesize versus quality, then it's a whole different discussion.

Это очень хороший момент. Итак, ради обсуждения можем ли мы предположить постоянное качество (не постоянный битрейт) для всех версий? knweiss 12 лет назад 1
3
slhck

I will try the theoretic approach. I would love to see some real-world examples that would prove or disprove my theory. Good question! If you have any comments or find some flaws, feel free to comment.


For any current encoder (let's take MPEG-4/AVC/h.264 as an example) frame rate does not matter as much as you think. Let's just assume there is no rate control and every picture is encoded with the same base QP (quantization parameter).


You are right with the following: The motion difference (as defined in ITU-R P.910, good read) between two frames of an 48 fps video will be lower than for the same video in 24 fps. This is due to the fact that the frames won't differ as much from each other. Note that the whole temporal motion doesn't increase. In the end, an object moves from point A to B, so its motion vector will be the same length no matter how many frames per second.

As the encoder looks for the difference between two (or more) frames and only encodes the residual values, that means it will have to code less residual per picture. In average, this will be half of the residual. So you're right with that. (We must not forget that only half of the residual does not mean half of the data needed to store it. It depends on the algorithmic coding implemented.)

Then again, you have twice as many pictures per second, which means that – in average – the encoded information doubles again.

To summarize, nothing much changes on that side. The encoder will do its best job to encode all the motion in the video, which in sum is the same (just in smaller steps, if you know what I mean). The only overhead we have to add is the overhead from small residuals that can't be arithmetically coded in an efficient way.


The above only applies to B- or P-pictures, which depend on others. However, we have to insert an intra-coded picture every once in a while which isn't dependent on any other picture. If this rate of intra-coded pictures doesn't increase, we could assume a linear growth in file size, maybe a bit more.

However if you decrease the distance of intra-coded pictures in order to compensate for possible packet-loss or bitstream errors, you will carry more overhead and therefore the increase is more than linear, not much, but probably noticeable.

0
DanMan

Это действительно зависит от типа кодировки. Если вы снимаете видео в формате RAW, то да: больше изображений требуют большего объема памяти в линейном режиме.

Если вы кодируете захваченные изображения непосредственно в какой-то сжатый формат, то все зависит от того, как работает этот кодек.

Что касается размеров файлов, это определяется bitrate × duration. Так что частота кадров напрямую не задействована. Чтобы достичь того же качества, что и у того же видео, закодированного с более низкой частотой кадров, вам, вероятно, придется немного увеличить битрейт. На сколько - опять же - зависит от используемого вами кодека.

Похожие вопросы