Suggested Compression Ratio with H.264?

后端 未结 5 2019
眼角桃花
眼角桃花 2021-01-29 22:17

Note bene: I realize this is an immensely complicated question with about a million levels of nuance that I\'m trying to reduce to a single number...

I\

5条回答
  •  时光说笑
    2021-01-29 22:51

    It will vary dramatically depending on the content of the source videos. I'll get to that in a bit.

    640x360 is not that large. 512kbps is very reasonable and arguably standard. Maybe 768kbps if you are really interested in quality.

    How is this possible? A simplified answer: There are a couple of techniques and facts about video compression that make this possible:

    1. Not every video frame data structure in an common H.264 (or other CODECs for that matter) is a full image. Instead there are two types which are colloquially referred to as
      1. Key Frames: a full rendering of the entire video image
      2. Intra-frames: a description of changes to the previous frame. These frames generally make up the vast majority (80%-99%) of frames in a video.
    2. H.264 is "lossy", as are many other CODECs. They do not reproduce a pixel-by-pixel, frame-by-frame exact duplicate of the original source video. Example: Lossy blocks: If all but one pixel in an area is the same color, the CODEC 'loses' the one pixel. So, instead of having to store information about every single pixel in a frame, the CODEC just says "x1, y1 to x2, y2 are all color x". Very efficient.

    It is all wildly more complex than that, with zillions of different approaches, techniques and algorithms within specific CODECs and between CODECs to make this happen.

    So, back to the "It will vary dramatically depending on the content of the source videos" comment: The compression ratio you'll see, and the resulting quality, will depend significantly upon:

    • the contents of the video
    • your tolerance for artifacts (blocks, loss of color, loss of definition)
    • the CODEC parameters you set, and how you set them

    Example: A video of a door in a room (like a security camera) with one key frame every ten minutes is going to have an amazingly high compression ratio. My back-of-the-napkin calculations put that scenario at 15,000:1 compression.

    Since you are starting on a large video encoding project, I would recommend a couple of things to determine what your compression ratio is going to be:

    • take a sample of the source videos you are going to encode. 100 or more being statistically relevant.
    • encode them at various bit rates, with various parameters, to determine what resulting characteristics meets your needs

    Changing the parameters of the encoder to make the videos smaller can have other impacts too:

    • higher play back CPU requirements
    • player CODEC expectations. Not all H.264 encoded videos can be played back by all players
    • longer encoding times
    • various degrading of quality

    It's a big complicated subject. Good luck. My experienced "thumb-to-the-wind" test says you'll be more than happy with 512-768kbps for your project.

提交回复
热议问题