10 Replies Latest reply: Oct 27, 2013 10:58 AM by Steven L. Gotz RSS

    Bit rate required when changing resolution

    Guy Burns Community Member

      I'd like some suggestions as to what bit rate should be used when changing the size of a clip so as to not degrade the quality. Let me make up some variables:

       

       

      B1: Bit rate of orginal clip. e.g. 1 Mbps

       

      S: Scale factor (double, half…)

       

      B2: Bit rate of scaled clip.

       

      Is there a relationship between B1, S and B2 so as not to lose quality? For example, if a clip is scaled up by 2.0, should B2 be twice B1? Or does it go up as the square to accommodate the pixel increase, so if you double the size the bit rate should increase four times?

       

      I have done some tests with a jpeg image in Photoshop to see how jpegs operate. Starting with a tiff image and altering its resolution (0.33, 0.5, 1.0, 2.0, 3.0), I saved as jpeg with three quality settings and then looked at the file size. The relationship between resolution and file size was somewhere between linear and square (power around 1.3). Results have been normalised to the original resolution. The three quality settings gave similar results:

       

      Resolution     File Size

      0.33               0.27

      0.5                 0.42       

      1.0                 1.00

      2.0                 2.71

      3.0                 5.00

       

       

      Might the same apply to video clips? i.e. if I triple the size I don't need nine times the bit rate (as the number of pixels would indicate), but possibly only about five times.

        • 1. Re: Bit rate required when changing resolution
          shooternz Community Member

          IMO

           

          Changing the bit rate will not have any positive affect (regarding quality) on uprezzing or down rezzing.

           

          Less recompression via codec choice would be  better "solution" but uprezzing is an unavoidable  quality hit.

          • 2. Re: Bit rate required when changing resolution
            J. Simon Community Member

            Is there a relationship between B1, S and B2 so as not to lose quality?

             

            There is no correlation there.  The only way not to lose quality from the transcode process is to transcode to a lossless format.  This applies to all transdode situations.

             

            Of course, there are other ways to lose quality, such as scaling up, that are unavoidable no matter what you do.

            • 3. Re: Bit rate required when changing resolution
              Steven L. Gotz Community Member

              You asked the question in an odd way, and both of the answers previous to mine are correct. However, I don't think they answered the question that you meant to ask. Maybe, but I have my doubts.

               

              So, let's spell this out a little better.

               

              If you take video to over 100% of the original size, no amount of increasing the bitrate is going to improve your quality. That is the issue shooternz is pointing out. The higher the bitrate, the more it will look like what you see in Premiere Pro on the timeline. But you can't increase it to make it look better than what you see on the timeline.

               

              You are always going to lose one generation of quality when you export to a lossy codec. That is what Jim is pointing out.

               

              If, on the off chance, I am correct in assuming that you asked the question in a way that didn't really address your real question, let me answer the question that I think might have been what you wanted to know.

               

              If you have an HD sequence at 1920X1080 and you want to export to use it on a web site, and, let's say the original was captured on the camera at 50Mb/s. (That option is available on my camera.)

               

              If you export to 960X540, you could theoretically use a bitrate of one fourth the original (just under 13Mb/s), and get approximately the same quality as you see on the timeline. Not quite, but generally close enough to make most users happy if you use a decent codec like H.264. You have dropped the number of pixels that the data has to support, so the amount of data required is reduced. Therefore the data rate can be reduced.

               

              Drop the size to 480X270 and even less bitrate is required to communicate the same video since there are so few pixels that have to be communicated.

               

              So, yes, there is a correlation on the side of scaling down, but scaling up? Not so much. You can't make up pixels where there were none before and expect a great result.

              • 4. Re: Bit rate required when changing resolution
                Guy Burns Community Member

                Thanks for the responses, but I think the point of my question was missed. I was not asking how to improve quality when upscaling. Of course that may not be possible (sometimes it is though; see below). I asked: "so as not to degrade quality". I probably should have said: "so as not to visibly degrade quality"

                 

                Upscaling Stills

                Let me go back to stills. It is possible to improve quality of the final output when upscaling stills – by interpolating. I've done it. If you want to print an upscaled image, it is not desirable for the printer (or the upscaling software) simply to magnify everything, because that will make the pixellation more obvious. If the software or the printer interpolates between pixels, the final image will look better. So it is possible to upscale and improve the look. When you save that upscaled image (or downscaled image), the amount of pixels needed for the same jpeg quality changes. For the image I choose in my original post, the file size followed a power function with an exponent of 1.3. Upscale by a factor of three and you need about 5 times the file size for the same quality jpeg. Under final viewing conditions the image will look better because of interpolation, but degraded because of upscaling and compression. I haven't tested different images, but I will do so to see if the exponent of 1.3 still holds.

                 

                Upscaling DVDs

                Now to video. A similar situation exists for video. If I drive my 1920 x 1080 projector from a DVD played on my iMac, and enter full-screen mode so the image on the iMac is 1920 x 1080, that image is simply magnified with no interpolation (as far as I can tell). When I view the image from the iMac on my 3 metre home-theatre screen, I can see blockiness. When the same DVD is played via my Oppo Blu-ray player (which has a specialist chip for real time upscaling), the blockiness disappears and the image is improved. Upscaling with interpolation has occured and final output has improved.

                 

                All-I Video

                If I set a Lumix GH3 to capture All-I frames at a low resolution setting, it will output 24 jpegs a second. And if my understanding is correct, they are simply jpegs, same as a still. If my video consisted of a static frame of the same scene I used for my test image in my original post, and I wanted to upscale it in Premiere and not degrade the visible image quality on output, I reckon I'd have to choose a bit rate based on the power function I proposed. That's assuming that when Premiere upscales, it interpolates. Does it?

                 

                A real-life example

                I'm looking for a guide as to what bit rate to use when altering resolution so as not to degrade the image. As an example, I am playing around with cigarette commercials at the moment, such as this little gem from 1948 from the Prelinger Archives:

                 

                http://archive.org/details/0210_Lucky_Strike_Cigarette_Commercial_Square_Dance_M01761_05_1 7_08_00

                 

                Quicktime tells me that the 23.7 MB file is H.264, 640 x 480, 3.1 Mbps. MediaInfo tells me the Bits/(Pixel*Frame) is 0.325. Maybe the latter is the parameter I'm looking for.

                 

                Anyway, I upscaled this particular clip 150% to almost fill the HD frame vertically. Clips like this become part of my "before interval" setup when I put on a movie night. You get all the same stuff "before interval" as you did at the cinema in the 1950s (home-theatre promo, newsreels, ads, shorts of mine, vintage documentaries or instructional videos, cartoons, and so on). All the "before interval" clips are individually edited in Premiere, upscaled, and exported in 1920 x 1080 format ready for importing into Encore without requiring further transcoding. I've got hundreds of them now. When I want to generate a "before interval" sequence I select the ones I want, import into Encore, add a menu, press Build, and in less than real time I can generate a Blu-ray folder on a USB stick, plug that into the Oppo (which has the ability to play a Blu-ray folder), and I have a seamless "before interval" sequence, just like at the cinema.

                 

                What I haven't worked out is the optimum bit rate to use for the individual clips when exported from Premiere. Parameters that come into play are:

                 

                • Original codec
                • Original bit rate
                • Scaling factor

                 

                The output is always the same: 1920 x 1080, H.264.

                 

                For the clip in question, my theory says that the bit rate to use should be 3.1*(1.5^1.3) = 5.25 Mbps. That way I have probably not visibly degraded the image. I actually exported as 12Mbps because I exported that clip many months ago before I began thinking of optimising bit rate.

                 

                Mpeg Originals

                Things become more complicated when changing codecs. For mpeg originals, I reckon I could half the figure obtained from the 1.3 power function because I've read somewhere that H.264 compresses better by a factor of about two. Is that correct?

                 

                Finally

                There must be some way to work out an approximate bit rate to use so that when a clip is scaled the visible quality is not degraded. Is Bits/(Pixel*Frame) a suitable parameter? Until I have a better solution, I think I'll use my power function.

                • 5. Re: Bit rate required when changing resolution
                  shooternz Community Member

                  There must be some way to work out an approximate bit rate to use so that when a clip is scaled the visible quality is not degraded. Is Bits/(Pixel*Frame) a suitable parameter?

                   

                  Bit rates have nothing to do with pixels.

                  • 6. Re: Bit rate required when changing resolution
                    Guy Burns Community Member

                    I must be missing something here. If bit rates have nothing to do with pixels, why does Vimeo recommend different bit rates for videos of different sizes (https://vimeo.com/help/compression)

                    • 7. Re: Bit rate required when changing resolution
                      shooternz Community Member

                      They are not discussing scaling of pixels.

                       

                      Simplified...in any "video size"...eg SD or HD...one can use what ever data rate  one chooses but the pixels are fixed.  ie Fixed resolution.  

                       

                      The data (bit) rate will determine the "smoothness " in  playback of the movie.  Higher data rate = smoother playback of the moving images.

                       

                      Pixels are just pixels and are an element of frame / image resolution.  The source pixels is fixed in resolution.

                       

                      One can have low resolution (pixellated) with high bit rate or low bit rate.

                       

                      One can have high resolution with high bit rate or low bit rate.

                       

                      High resolution with High bit rate ( data rate) = best quality.

                      • 8. Re: Bit rate required when changing resolution
                        J. Simon Community Member

                        If you export to 960X540, you could theoretically use a bitrate of one fourth the original (just under 13Mb/s), and get approximately the same quality as you see on the timeline.

                         

                        Those are entirely arbitrary numbers, Steven, and I believe misleading to readers.  There's no direct correlation between resolution and required bitrate.  The quality of an encode depends on many interrelated variables.  It is entirely possbile to have a higher birtate with less quality, and conversely, a lower bitrate with greater quality.

                        • 9. Re: Bit rate required when changing resolution
                          J. Simon Community Member

                          I probably should have said: "so as not to visibly degrade quality"

                           

                          It wouldn't have helped much, because what's 'visible' is very subjective.  I see artifacts in broadcast, cable and satellite feeds quite frequently that drive me nuts, but are quite 'invisible' to most of my friends and family.

                           

                           

                          What I haven't worked out is the optimum bit rate to use

                           

                          You will have to experiment, using your own eyes as a judge.  There is no mathematical formula here.

                           

                          Having said that, you may want to wait until the October update hits.  It will bring Photoshop quality upscaling to video.

                          • 10. Re: Bit rate required when changing resolution
                            Steven L. Gotz Community Member

                            Hardware players have features to upscale video that the software alone can't compete with.

                             

                            There is software available that is designed to upscale to HD that does a better job than Premiere Pro.

                             

                            If you shoot low quality on a GH3 you get what you deserve. Shoot using all I-Frame at the highest resolution using RAW and not JPEG. Then you can edit in Photoshop using the Camera RAW filter recently added to Photoshop. But since it is already 1920X1080 there is no real point in doing so unless you have a need to change it because you shot it wrong, in regards to shadows or highlights, etc. Or you need effects that are not available yet in Premiere Pro.

                             

                            Vimeo recommends different bit rates for different sized video for exactly the reason I already stated. I understand why Jim disagrees, but I have studied this issue in depth (work related requirement in the test equipment field). The more pixels, the higher the bitrate has to be to keep the quality up. If you want 8 bits per pixel, you have to multiply the pixels by the number of bits per pixel to get the bitrate required to support it.

                             

                            But you can't get great interpolation with Premiere Pro. You can do better with hardware, and you can do better with other software designed for the task. Instamt HD is one example.

                             

                            Your best bet? Export to as high a bitrate as you can reasonable use. For example, 25Mb/s is usually playable by most players. You may not be happy with the results, but in most cases, going higher just isn't going to help.

                             

                            Test it out for yourself. Don't rely on anything we have to say. Export to various bitrates and see what you can live with. Compression is more art than science. Back in the days of exporting tiny videos to the web to save storage and bandwidth requirements, we used to say that you should export to as low a bitrate and as small a frame size as you can live with. Reduce the bitrate until you hate it, then raise it back up a bit.

                             

                            In your case? Just export to the highest bandwidth you can play on your player and live with it.