Trying to stuff an entire movie into 8MB

I have an 1920x808 MP4 of about 1.5GB, and I want to export it as an 8MB video file, without regard to video or audio quality.

What I’m currently doing with the aim of accomplishing the goal:

  • exporting as WebM VP9
  • using software encoding
  • downscaling to 128x54
  • using Lanczos (best) interpolation
  • setting video average bitrate to 12kbps
  • setting audio average bitrate to 12kbps
  • speeding up the video (the intro is 2x, the rest is 8x)

However in the end I get a 50MB file, which is much too large for me. And this is even though the video is only about 1065 seconds long (because it is sped up).
Any tips?

I’ve had success with similar procedures before, so I think the weird aspect ratio may be causing some difficulty in this case?

Wow, I think my hunch that the issue is related to the “ugly” aspect ratio was right: now I’m using 192x84 instead of 128x54 and the encoded file is turning up around 8MB!

I’d still like it if someone could explain this, is this some limitation inherent to the theory, or is it just an implementation issue? Is it possible to use some other encoder that wouldn’t have this issue?

In theory, using the AV1 codec from libaom could get better compression than VP9. This codec already exists inside of Shotcut. Or, it’s possible to use the SVT-AV1 encoder outside of Shotcut, directly with FFmpeg command line, and get smaller file sizes than VP9. Or, you could try using av1an for per-scene compression tuning.

As for why 192x84 works better than 128x54, my guess would be the macroblock sizes involved. At 128x54, it isn’t possible to encode with a 64x64 superblock. Well, technically it’s possible by padding the input image with 10 extra lines of blackness, but adding hidden lines defeats the goal of shrinking the file size. Both VP9 and AV1 have 64x64 support, so both would lose some theoretical efficiency at a 128x54 resolution.

See: https://tools.ietf.org/id/draft-grange-vp9-bitstream-00.html#rfc.section.2.1

Another possibility could be the level of detail/contrast that the codec is trying to maintain. When the source video is shrunk down to 128x54, neighboring pixels will be very different colors from each other. The higher the resolution, the more that neighboring pixels become similar in color (because they are sampling areas that are spatially closer to each other in the scene), and similar colors are easier to compress than high-contrast neighbors.

So, lower-contrast neighbors plus 64x64 superblocks could in theory make for some pretty big efficiency gains, leading to smaller file sizes.

The 8MB goal sounds like you’ve already visited the max compression crowd at https://www.reddit.com/r/AV1, so you might already know that some great tips can be found in that group.

2 Likes

I actually am confused, VSDC (video editor) is doing completely something out of my mind. Even my 10 min HD and sometimes even 4k video take less than ~9mb (with literally a lot of files, some even the bigger ones) . Can you explain it to me, That really solves the storage issue, and also the videos come out crisp somehow. Although tbe editing features and UI is not that good, but the exporting software they use is future somehow.

Without having a file to analyze, it’s hard to guess. Could you upload one of those files somewhere that I could analyze it? Is the video fairly static like a screen capture recording, or is there a lot of motion like live camera action? Screencasts can compress extremely small because very little is moving from frame to frame.

It was a live action video, due to some contracts, I can’t share that video. I was just using different editors to see the export quality difference. Davinci Resolve won according to me, but VSDC was really good at maintaining the crisp and size. The original video was 4k 5 mins, and 1.09GB.

This topic was automatically closed after 90 days. New replies are no longer allowed.