1 2 Previous Next 69 Replies Latest reply on Nov 17, 2012 4:03 AM by Saša Bruvo

    Bitrate in H.264 encoding

    Saša Bruvo Level 1

      Which (target & maximum) bitrate is quality lossless when using Main Profile with VBR to encode 1280x720 50p video in H.264 ?

        • 1. Re: Bitrate in H.264 encoding
          Harm Millaard Level 7

          None. If you want lossless, encode to uncompressed or visually uncompressed like Lagarith or UT.

          • 2. Re: Bitrate in H.264 encoding
            Saša Bruvo Level 1

            When I said lossless, I ment lossless in the context of re-encoding 1920x1080 50p 28 Mbps to 1280x720 50p ??? Mbps.

            • 3. Re: Bitrate in H.264 encoding
              Jim_Simon Level 8

              The context is video production, and in that context lossless means without any loss of information.  You just can't get there with H.264 out of PP.  You need Uncompressed or one of the codecs Harm recommended.  (And you really can't change resolution at all if you want truly lossless.)

               

              The point is, you're going to lose some data in the encode, no way around it.  You can experiment to see which bitrates serve the quality needs on this project.  I gnerally find the default settings quite good, myself.

              • 4. Re: Bitrate in H.264 encoding
                Harm Millaard Level 7

                The highest bitrate allowed on the export medium with the duration of your timeline. See http://dvd-hq.info/bitrate_calculator.php#Calculator

                • 5. Re: Bitrate in H.264 encoding
                  Saša Bruvo Level 1

                  Let me rephrase the question once more.

                  What bitrate in 1280x720 50p corresponds to 28 Mbps in 1920x1080 50p ?

                  • 6. Re: Bitrate in H.264 encoding
                    Jim_Simon Level 8

                    You're looking for a correlation that doesn't really exist here.

                    • 7. Re: Bitrate in H.264 encoding
                      Saša Bruvo Level 1

                      Is it really unreasonable to expect the bitrate to be lower for smaller number of resulting pixels ?

                      • 8. Re: Bitrate in H.264 encoding
                        Jim_Simon Level 8

                        You can set the bitrate to anything you want within the limits of the codec and your delivery medium.  But as the quality of the video will depend on several different factors, not just bitrate, no there is no direct correlation here.

                        • 9. Re: Bitrate in H.264 encoding
                          Saša Bruvo Level 1

                          If I have original clip at 28 Mbps I suppose it would not be so clever to produce output at 100 Mbps just because my export medium allows it ?

                          • 10. Re: Bitrate in H.264 encoding
                            Jim_Simon Level 8

                            That depends.  Going to such a high bitrate can ensure that very little degradation occurs during the transcode.  For example, exporting with AVC-I 100 will provide Mastering quality, with little if any visible difference between the export and the original.

                             

                            So yes, there are times when you might want to do that.

                            1 person found this helpful
                            • 11. Re: Bitrate in H.264 encoding
                              Saša Bruvo Level 1

                              Let me try this way:

                               

                              What would be the file sizes for lossless compression:

                                   - 10 sec 1920x1080 50p

                              and

                                   - 10 sec 1280x720 50p

                              • 12. Re: Bitrate in H.264 encoding
                                Jim_Simon Level 8

                                Not predictable.  Lossless isn't constrained by anything, so the size will depend on the material and efficiency of the codec used.

                                • 13. Re: Bitrate in H.264 encoding
                                  Saša Bruvo Level 1

                                  For the same clip using the same codec in different resolutions file sizes must be exact numbers - bigger for higher resulution, smaller for lower resolution ?!?

                                  • 14. Re: Bitrate in H.264 encoding
                                    Jim_Simon Level 8

                                    Generally, no.  File size isn't dependant upon resolution at all.  Only bitrate and duration will have a significant impact on file size.

                                     

                                    Think of it this way.  Files are measured in bits.  So...bits per second x seconds = size.

                                    • 15. Re: Bitrate in H.264 encoding
                                      Saša Bruvo Level 1

                                      Still talking about lossless compression ?

                                       

                                      Bits = data. Each pixel with it's color is "1 data".

                                       

                                      less bits(pixels) per second x seconds = smaller size

                                       

                                       

                                      This is the way how I understand the process of re-encoding to smaller resolution:

                                      Encoder must "scale" or "resize" or "resample" each original frame before encoding. Then it encodes, let's say two times smaller frame - accoarding to the chosen rules of compression, producing the video with quality that results from the chosen bitrate and type of compression.

                                      Higher output bitrate (50 Mbps) on smaler resolution can not produce quality that does not exist in original (bigger) frame encoded at lower bitrate (28 Mbps).

                                       

                                      Where do I go wrong ?

                                      • 16. Re: Bitrate in H.264 encoding
                                        Harm Millaard Level 7

                                        Filesize = (size per frame) x (number of frames).

                                         

                                        Number of frames is a given, so the determining factor is size per frame. Size per frame is only bitrate dependent, not resolution dependent. You can have 1920 x 1080 frames with X as the size or 1280 x 720 frames with 2X as size, it all dependws on the bitrate PER FRAME.

                                        • 17. Re: Bitrate in H.264 encoding
                                          Saša Bruvo Level 1

                                          I absolutely agree that the size per frame is only bitrate dependent.

                                          But what is bitrate dependent on ?

                                           

                                          Don't tell me that it is value for bitrate that I choose.

                                          Bitrate is quantity of information per second stored in a file.

                                           

                                          Let's take this example:

                                          I have lossless compressed video 1920x1080 50p. Video itself consists of one clip made from still photo with the duration of 10 secs.

                                          No movement, no nothing.

                                          Let's say the size of this file is 100 of something.

                                          When I recode it to lossless compressed 1280x720 50p, resulting file size must be smaller then 100 just because it has less pixels, less data to process, less data to store.

                                          So - resolution must have some influence in resulting file size.

                                          Bitrate determines how much quality will be sacrificed.

                                          Higher bitrate - higher quality - bigger file.

                                          And now we are at the beginning of this discussion - what is approximate correlation in bitrates between 1920 / 1280 for approximately same loss in quality of video.

                                          And of course I understand that 1920 is better video then 1280 - with the approximate same quality I mean the approximate same absence of artifacts in reproduction.

                                          • 18. Re: Bitrate in H.264 encoding
                                            Jim_Simon Level 8

                                            Still talking about lossless compression ?

                                             

                                            Nope, all compression.

                                             

                                             

                                            Bits = data. Each pixel with it's color is "1 data".

                                             

                                            It doesn't always work out that way.  In fact, with most compression schemes there ends up being less than 1 bit/pixel.  MPEG encoders use blocks of pixels encoded as a group.

                                             

                                            less bits(pixels) per second x seconds = smaller size

                                             

                                            Well, the less bits part is true, but pixels doesn't play a factor with file size.

                                             

                                             

                                             

                                            Higher output bitrate (50 Mbps) on smaler resolution can not produce quality that does not exist in original (bigger) frame encoded at lower bitrate (28 Mbps).

                                             

                                            You're right.  But during compression, data is thrown out.  Higher bitrates means less data is thrown out.  So while no extra quality is added with higher bitrates, more of the original quality is kept in.

                                            • 19. Re: Bitrate in H.264 encoding
                                              Jim_Simon Level 8

                                              But what is bitrate dependent on ?

                                               

                                              Your settings.

                                               

                                               

                                              Don't tell me that it is value for bitrate that I choose.

                                               

                                              Bit...it is.

                                               

                                               

                                              When I recode it to lossless compressed 1280x720 50p, resulting file size must be smaller then 100 just because it has less pixels, less data to process, less data to store.

                                               

                                              With lossless compression, it probably will be smaller.  Lossless doesn't have any bitrate constraints, there are no bitrate settings.  Lossless uses whatever bits it needs to make sure the file can be reconstructed exactly.  MPEG is a different situation.

                                               

                                               

                                              So - resolution must have some influence in resulting file size.

                                               

                                              It's not so much the resolution that's affecting fie size, at least not directly.  It's that with lossless, the lower resolution simply means fewer bits are needed.  It's still the bitrate that's the important factor here.

                                               


                                              And now we are at the beginning of this discussion - what is approximate correlation in bitrates between 1920 / 1280 for approximately same loss in quality of video.

                                               

                                              With the same answer.  There is no direct correlation.  Too many factors come into play.

                                              1 person found this helpful
                                              • 20. Re: Bitrate in H.264 encoding
                                                Saša Bruvo Level 1

                                                Ok, thank you - no is also a good answer.

                                                Can not say that I understand, I'll try to beleive that 1920x1080 50p video with bitrate of 5 Mbps, could have same file size and video quality as 5 Mbps 400x224 50p video.

                                                • 21. Re: Bitrate in H.264 encoding
                                                  Jim_Simon Level 8

                                                  It might have the same size, but likely won't have the same quality.  Two very different aspects of encoding without a direct connection.

                                                   

                                                  Bitrate and duration affect the size.

                                                   

                                                  Resolution, frame rate, and other settings affect quality.

                                                   

                                                  Getting the best of both is an entire industry in itself not easily leearned in a forum.

                                                  • 22. Re: Bitrate in H.264 encoding
                                                    Saša Bruvo Level 1

                                                    I did some reading on the subject.

                                                     

                                                    1. I think you will not say that this statement is wrong:

                                                    "The bitrate (data rate) affects the quality of a video clip and the audience that can download the file given their bandwidth constraints."

                                                    Your can read this here:

                                                    http://help.adobe.com/en_US/mediaencoder/cs/using/WSb8e30982e628fbecc0e59e6131255b4dd2-800 0.html

                                                     

                                                    2. I beleive that we can agree upon the fact that 1080p50 video from my last example would have poor quality because of low bitrate.

                                                    If the same clip would be encoded with higher bitrate quality would be better ?

                                                     

                                                    3. I can not accept that these files "might have the same size" if they have the same bitrate and "Bitrate and duration affect the size."

                                                     

                                                    4. On the following page you can notice that in "Levels" paragraph there is a tabel that shows direct correlation between bitrate and resolution.

                                                    http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC

                                                     

                                                    5. Offcourse that "Bitrate and duration affect the size."

                                                    But - with reducing the bitrate you reduce the file size only by means of reducing the quality because in the smaller file you can store less information.

                                                    • 23. Re: Bitrate in H.264 encoding
                                                      Saša Bruvo Level 1

                                                      I do not want to have irrationally large file.

                                                      Let's try to go from the beginning.

                                                      1. Camera's sensor captures light converting it to number of frames that I choose - let's say it is 50 fps.
                                                      2. Camera's firmware/software encodes captured frames according to settings I have chosen.
                                                      3. Sequence of frames are encoded and stored in camera's memory.

                                                       

                                                      At this point there is no way back - clip is memorized with the best quality at given settings.

                                                      If camera encoded and memorize it as 720p50 @ 18 Mbps this is the top and maximum quality that can be "sucked out" of it.

                                                      Let's say the size of this clip is 100.

                                                      If I would recode this clip to 720p50 @ 24 Mbps the file will be considerably larger - let's say 180, without any quality gain - I would only have irrationally larger file.

                                                      Why should anyone want to have 5 GB video file which in reproduction gives the same video quality as 2 GB version of the same video ?

                                                       

                                                      If what I sad is correct, the conclusion is that there is a bitrate "threshold"

                                                           - everything under that threshold lowers the file size and video quality,

                                                           - everything over that threshold produces bigger files without any quality gain.

                                                       

                                                      Simple as that.

                                                       

                                                      I hoped to be advised what should this "threshold" be for 725p50 clip recoded from the source clip that was 1080p50 with "threshold" at 28 Mbps.

                                                      • 24. Re: Bitrate in H.264 encoding
                                                        Fuzzy Barsik Level 4

                                                        The truth is:

                                                        - everything under original bitrate lowers the file size;

                                                        - whatever bitrate for H.264 you choose - either 28 Mbps, 100 Mbps or 200 Mbps - it lowers original quality.

                                                         

                                                        Run the following test or whatever similar one:

                                                        - import your original footage into After Effects and set working space to linearised 32 bit;

                                                        - re-encode your original footage to H.264 with whatever bitrate you like, reimport new file into the project, drop into the composition over the layer with the original footage and set Blending Mode to 'Difference' - you'll always see artifacts, and the lower was the bitrate, the more extensive artifacts you can see.

                                                         

                                                        Since those losses are not always visible for human eyes, it's up to you to decide which level of loss to compromise.

                                                        1 person found this helpful
                                                        • 25. Re: Bitrate in H.264 encoding
                                                          Saša Bruvo Level 1

                                                          Thank you, this I can understand.

                                                           

                                                          Just for my curiosity, any idea why H.264 encoded clip when re-encoded with H.264 with same bitrate_and_everything "to itself" ends up with artifacts/lower quality ?

                                                          • 26. Re: Bitrate in H.264 encoding
                                                            Fuzzy Barsik Level 4

                                                            Just because it's not a rewrapping, but re-encoding with the lossy codec.

                                                            • 27. Re: Bitrate in H.264 encoding
                                                              Harm Millaard Level 7

                                                              It is RE-compressed. Just like 2-nd or 3-rd generation DV files. You lose quality on every generation because of the re-compression that takes place.

                                                              1 person found this helpful
                                                              • 28. Re: Bitrate in H.264 encoding
                                                                Saša Bruvo Level 1

                                                                And there is nothing but my eyes to help in decision which bitrate gives the best results in size/quality ratio.

                                                                • 29. Re: Bitrate in H.264 encoding
                                                                  Saša Bruvo Level 1

                                                                  Jim Simon wrote:

                                                                   

                                                                  It might have the same size, but likely won't have the same quality.  Two very different aspects of encoding without a direct connection.

                                                                   

                                                                  Bitrate and duration affect the size.

                                                                   

                                                                  Resolution, frame rate, and other settings affect quality.

                                                                   

                                                                  Getting the best of both is an entire industry in itself not easily leearned in a forum.

                                                                  Please try this:

                                                                  Take any 1080p50 clip with bitrate higher then 14 Mbps.

                                                                  Encode it with same resolution and frame rate on bitrate of 12 Mbps.

                                                                  Encode it again with same resolution and frame rate on bitrate of 0,5 Mbps.

                                                                   

                                                                  Both files have identical resolution, frame rate, and other settings.

                                                                  Both files have same duration.

                                                                  Files have dramatically different file sizes.

                                                                  File with 0,5 Mbps is catastrophe.

                                                                   

                                                                  BITRATE/FILE SIZE AFFECTS QUALITY !

                                                                  • 30. Re: Bitrate in H.264 encoding
                                                                    Jim_Simon Level 8

                                                                    1. I think you will not say that this statement is wrong:

                                                                    "The bitrate (data rate) affects the quality of a video cli

                                                                     

                                                                    Correct.

                                                                     

                                                                     

                                                                    2. I beleive that we can agree upon the fact that 1080p50 video from my last example would have poor quality because of low bitrate.

                                                                    If the same clip would be encoded with higher bitrate quality would be better ?

                                                                     

                                                                    If reencoded, no.  If originally encoded with a higher bitrate, yes.

                                                                     

                                                                     

                                                                    3. I can not accept that these files "might have the same size" if they have the same bitrate and "Bitrate and duration affect the size."

                                                                     

                                                                     

                                                                    Well...it took humans a few thousand years to accept the fact the the earth was not the 'center of the universe'.  However, what people accept doesn't always alter what is.

                                                                     

                                                                     

                                                                     

                                                                    4. On the following page you can notice that in "Levels" paragraph there is a table that shows direct correlation between bitrate and resolution.

                                                                     

                                                                    That paragraph is showing the allowable parameters for a particular level.  Not the same thing you're asking about here.

                                                                     

                                                                     

                                                                     

                                                                    5. Off course that "Bitrate and duration affect the size."

                                                                    But - with reducing the bitrate you reduce the file size only by means of reducing the quality because in the smaller file you can store less information.

                                                                     

                                                                     

                                                                    Generally yes.  But there are more parameters than just bitrate involved here.  It is possible to get a smaller file with better quality if you know what you're doing.  In fact doing precisely that is the very goal of the entire compression industry.

                                                                    • 31. Re: Bitrate in H.264 encoding
                                                                      Jim_Simon Level 8

                                                                      Why should anyone want to have 5 GB video file which in reproduction gives the same video quality as 2 GB version of the same video ?

                                                                       

                                                                      A fair question.  Because that 5 GB file may well have the same quality as the original.  But if you're reencoding, then a 2GB copy will almost certainly have less quality than the original.

                                                                      • 32. Re: Bitrate in H.264 encoding
                                                                        Jim_Simon Level 8

                                                                        If what I sad is correct, the conclusion is that there is a bitrate "threshold"

                                                                             - everything under that threshold lowers the file size and video quality,

                                                                             - everything over that threshold produces bigger files without any quality gain.

                                                                         

                                                                        Simple as that.

                                                                         

                                                                        It's not quite that simple.  Like I said, it is possible to get a smaller file with better quality, if you know what you're doing.

                                                                         

                                                                        And reencoding "over that threshold" won't add to the quality, but it will keep more of that quality, which you generally lose some of every time you reencode.

                                                                        • 33. Re: Bitrate in H.264 encoding
                                                                          Jim_Simon Level 8
                                                                          I hoped to be advised what should this "threshold" be for 725p50 clip recoded from the source clip that was 1080p50 with "threshold" at 28 Mbps.

                                                                           

                                                                          It doesn't exist.

                                                                          • 34. Re: Bitrate in H.264 encoding
                                                                            Jim_Simon Level 8

                                                                            BITRATE/FILE SIZE AFFECTS QUALITY !

                                                                             

                                                                            You're correct.  I will rephrase.

                                                                             

                                                                            Bitrate and duration affect the size.

                                                                             

                                                                            Bitrate, resolution, frame rate, etc. affect the quality.  But of those parameters that affect quality, the only one that also affects the size is bitrate.

                                                                            • 35. Re: Bitrate in H.264 encoding
                                                                              Saša Bruvo Level 1

                                                                              Yes, now we understand each other !

                                                                              Thank you for the patience.

                                                                              Funny animal that H.264 .... :-(

                                                                              • 36. Re: Bitrate in H.264 encoding
                                                                                Saša Bruvo Level 1

                                                                                Like I said, it is possible to get a smaller file with better quality, if you know what you're doing.

                                                                                 

                                                                                And please, just one more thing - what should I know and do to get a smaller file with better quality ?

                                                                                • 37. Re: Bitrate in H.264 encoding
                                                                                  Harm Millaard Level 7

                                                                                  Same duration and smaller size means lower quality.

                                                                                   

                                                                                  It is either or, not and.

                                                                                   

                                                                                  Bigger size means better quality, smaller size means lower quality. EOS.

                                                                                  • 38. Re: Bitrate in H.264 encoding
                                                                                    Saša Bruvo Level 1

                                                                                    That's what I thought, but Jim Simon seems to know something I don't...

                                                                                    • 39. Re: Bitrate in H.264 encoding
                                                                                      Harm Millaard Level 7

                                                                                      Of course with a given number of frames and a given bitrate per frame, and thus a total filesize, there are differences in quality based on the efficiency of the codec used. I think that is what Jim alluded to.

                                                                                       

                                                                                      With a certain filesize, (frames and bitrate/frame), MPEG1 will deliver far less quality than H.264, due to the efficiency of the codec used.

                                                                                      1 2 Previous Next