Log in

View Full Version : What is the exact meaning of the video bit rate and how video encoders deal with it ?


guista
20th October 2010, 14:20
Hi all,

I explain my case:

At home I have an USB 2.0 multimedia disk (connected to my TV with an HDMI plug). The box has no internal disk drive : it just contains the video decoder electronics. The hard disk drive is connected to the box through a USB 2.0 port.
I can not play the 1920x1080 Bluray rips because the video bit rate is probably too high (about 40 Mb/s).

If I try to do it, the pictures freeze or block all the time whereas the audio continues playing normally.
I think this is mostly due to the USB 2.0 low transfer limit compared to the required bandwith for playing Bluray's videos.

In order to play my movies on my multimedia box, I have to reencode them to 4 Mb/s (which matches my box limit) then everything is fine.

* So I understand that the video bit rate is the data rate of the data coming out of the video decoder. Am I right ?

I am surprised because the encoders (x264/XVid) allow the user to set the max video bit rate. When I play the video, I can notice that the required video bit rate is well observed.

* How can the encoder respect the specified video data rate since the compression rate is not a constant value ?
* How does the encoder deal with it ? Does it play with compression quality or other parameters ?

Thanks in advance for your replies.

Ghitulescu
20th October 2010, 15:54
40Mb/s is much less than the maximum of 60MB/s that USB2.0 can carry. See another cause :) Besides 40Mb/s is a maximum, like 9800 for DVD, the actual bitrate being lower.

Groucho2004
20th October 2010, 16:02
40MB/s is 2/3 of the maximum of 60 that USB2.0 can carry. See another cause :) Besides 40MB/s is a maximum, like 9800 for DVD, the actual bitrate being lower.

I think you should look up the difference between M(bits)/s and M(byte)/s.

USB bandwidth is 480 Mbit/s.

guista
20th October 2010, 16:10
40MB/s is 2/3 of the maximum of 60 that USB2.0 can carry. See another cause :) Besides 40MB/s is a maximum, like 9800 for DVD, the actual bitrate being lower.

Groucho2004 is right, the max USB 2.0 data rate is 480 Mbit/s and the Bluray encoder video output is 40 Mbit/s so I deduce the USB port is not the problem. I suppose my box processor is not fast enough for decoding my Bluray rip.

Anyway, that's not a problem for me because this is a known limit (can not play rips encoded over 4 Mbit/s) and I can deal with it.

This was just for introducing my questions about video bit rate and how x264/XVid encoders encode according to the user-specified max bit rate ?

Ghitulescu
20th October 2010, 16:29
I know the difference between one and the other, I just got nerved by another thread while typing this one and made a mistake.
I'll correct the post accordingly.

pandy
20th October 2010, 17:28
* So I understand that the video bit rate is the data rate of the data coming out of the video decoder. Am I right ?


No, video bitrate is the bitrate of compressed video stream produced by the encoder or bitrate at the input of the decoder
(also additional data not related directly to the video can be present in such stream)


I am surprised because the encoders (x264/XVid) allow the user to set the max video bit rate. When I play the video, I can notice that the required video bit rate is well observed.


max bitrate is value that fulfill requirement for limitation of transmission channel (max sped of transmission medium - like in network this can be for example 10 Mbps for normal Ethernet)



* How can the encoder respect the specified video data rate since the compression rate is not a constant value ?
* How does the encoder deal with it ? Does it play with compression quality or other parameters ?


So encoder trying to chose such parameters of the compression that will fulfill this requirement - ie max bitrate will be not higher than specified - but if even with hardest compression strategy bitrate is higher than maximum allowable then codec is overloaded (or oversaturated).

Encoder must change various parameters to fulfill required limitations (max bitrate, average bitrate) - it must decide how compress the data that compressed stream will fulfill requirements.

at the input of the decoder and output of the decoder amount of data is exactly the same - amount of pixels in frame not change and amount of frames in time not change (at least in normal TV brodacast - variable frame rate codecs exist on market - they can change amount of frames in time), also capacity of the transmission medium is limited (network bitrate, cpacity of disc etc).

guista
21st October 2010, 13:59
at the input of the decoder and output of the decoder amount of data is exactly the same - amount of pixels in frame not change and amount of frames in time not change (at least in normal TV brodacast - variable frame rate codecs exist on market - they can change amount of frames in time), also capacity of the transmission medium is limited (network bitrate, cpacity of disc etc).

I do not agree.
If I compare JPEG compression to MPEG : for example, a 167 KB JPEG image can produce a raw size of 4300 KB.
On the same way, for a compressed input, MPEG will produce a large amount of raw uncompressed data and that's the reason why compression exist.
One second of raw HD movie is 1920 x 1080 x 24bits (per pixels) * 24 img/sec = 1 194 393 600 so the raw output HD video bit rate is 1194 Mb/s whereas I can have 4 Mb/s (or less) on the input.


So encoder trying to chose such parameters of the compression that will fulfill this requirement - ie max bitrate will be not higher than specified - but if even with hardest compression strategy bitrate is higher than maximum allowable then codec is overloaded (or oversaturated).
Encoder must change various parameters to fulfill required limitations (max bitrate, average bitrate) - it must decide how compress the data that compressed stream will fulfill requirements.

OK so if I take my practical real case:

Intially, I have a 10 Mb/s x264 MKV file which size is 12 GB (called 10000.mkv) => compression ratio is 1194/10 = 119
I reencoded it to a 4 Mb/s x264 MKV file so size became 3.7 GB (called 4000.mkv) => compression ratio is 1194/4 = 298

What I understand is video bit rate determines the compression ratio of the codec.
If the codec is working fine : like me, you will hardly see the difference between 4000.mkv and 10000.mkv

Ghitulescu
21st October 2010, 16:49
I do not agree.
Pandy mistyped decoder instead of encoder.

see excerpts from his message:

No, video bitrate is the bitrate of compressed video stream produced by the encoder or bitrate at the input of the decoder
(also additional data not related directly to the video can be present in such stream)
...

at the input of the decoder and output of the decoder amount of data is exactly the same - amount of pixels in frame not change and amount of frames in time not change (at least in normal TV brodacast - variable frame rate codecs exist on market - they can change amount of frames in time), also capacity of the transmission medium is limited (network bitrate, cpacity of disc etc).

guista
22nd October 2010, 08:42
Pandy mistyped decoder instead of encoder.

OK, this is clear to me now but I still do not understand how the x264 encoder handles the user-specified video bit rate and how it is correlated with the encoder compression ratio.
Why 4 Mb/s bit rate videos can be played by my box whereas 10 Mb/s can not ?
This is not logical because the first one is much more compressed than the second one so the box CPU should work much more in first case.

Any web link is welcomed !

kypec
22nd October 2010, 09:32
You didn't tell us what are the real encoding specs of your original (10Mbps) and re-encoded (4Mbps) MKV files. Please use MediaInfo and post the resulting info here. There is a lot more options for encoder than raw bitrate you know.
What application are you using for re-encoding of problematic MKV files? Plain x264 with command line? Or some GUI like MeGUI or StaxRip perhaps?

guista
22nd October 2010, 10:06
You didn't tell us what are the real encoding specs of your original (10Mbps) and re-encoded (4Mbps) MKV files. Please use MediaInfo and post the resulting info here. There is a lot more options for encoder than raw bitrate you know.
What application are you using for re-encoding of problematic MKV files? Plain x264 with command line? Or some GUI like MeGUI or StaxRip perhaps?

I posted the screenshot of the information I got from MediaInfo:

The original 12 Mbps MKV MediaInfo encoding info (http://www.cijoint.fr/cj201010/cijq3Suvak.jpg)

My 4 Mbps MediaInfo reencoding info (http://www.cijoint.fr/cj201010/cij6sklWaj.jpg)

Please notice that the big 12 Mbps MKV file itself is not problematic since I can play it perfectly on my computer. The problem comes from the limitations of my HD box.

* Do you know which file is harder to uncompress for my box, is it the 12 or 4 Mbps ?
* Do you have an idea why I can play the 4 Mbps file whereas I can not play the 12 Mbps ?

Thanks in advance for the replies.