Search code examples
iosvideomp4bandwidthwebm

iOS Video File Sizes and Bandwidth Considerations


I'm building an app whose core functionality is centered around 1-10 second videos. Currently, I'm recording video using PBJVision with the preset set to AVCaptureSessionPresetMedium. A 10 second video is around ~3-5MB. Considering each user could theoretically download hundreds or even thousands of videos a day, I was wondering if there was a more bandwidth efficient way of packing these videos up.

Could WebM be a more suitable container format?

I searched across the web, but couldn't find any articles pertaining to this specific question.

Edit: this looks promising


Solution

  • Modern video codecs (include WebM VP8) usually has compression ratio around 1/50. By adjusting codec parameters we can archive ~ 1/100 (IMHO), but very difficult and horrible picture quality.

    Roughly, we can think of 1 camera pixel consist of 1.5 bytes (YUV 12 or 16 bits).
    If the resolution is 720x480 and the frame rate is 30/sec,

    720 x 480 x 1.5 x 30 = 15,552,000
    x 10 sec = 155,520,000
    / 50 = 3,110,400
    ~= 3MB

    It seems PBJVision doing good.

    Reducing resolution, or lowering frame rate would be the first consideration, I think.