thenickdude / webm-writer-js

JavaScript-based WebM video encoder for Google Chrome
272 stars 43 forks source link

my webm videos are really big,why?(26 MB for a 10 second animation) #9

Closed tariqazmat101 closed 4 years ago

tariqazmat101 commented 4 years ago

Hello, Does anyone else have the same problem as me?

Background info: -The videos were rendered at 60fps,1920x1080, and at the lowest possible quality setting. -I am using CCapture,a library for replaying canvas based animations. It uses this project for webm video rendering. (Perhaps CCapture is the culprit)

thenickdude commented 4 years ago

That sounds about right, what resolution are your videos? This project only supports keyframes so it's basically just a series of JPEG-equivalents.

In an earlier version of this project there was a bug where the quality option did nothing - does your filesize change when you change the quality parameter?

On Sat, 30 Nov 2019, 4:11 PM kapooky, notifications@github.com wrote:

Hello, Does anyone else have the same problem as me?

Background info: -The videos were rendered at 60fps, and at the lowest possible quality setting. -I am using CCapture,a library for replaying canvas based animations. It uses this project for webm video rendering. (Perhaps CCapture)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thenickdude/webm-writer-js/issues/9?email_source=notifications&email_token=AAOVDA2HDAVGDNHNGVO2U6TQWHKXBA5CNFSM4JTEVT22YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H47FUAQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOVDA3K5XXL3ZZDDDVN3OLQWHKXBANCNFSM4JTEVT2Q .

thenickdude commented 4 years ago

Ah yep it looks like CCapture uses 0.2.0, where the quality setting is non-functional. Try replacing that with https://github.com/thenickdude/webm-writer-js/releases/tag/v0.2.4

tariqazmat101 commented 4 years ago

thanks, I'll swap the versions soon and report back the results.

I render at 1080 p resolution.

for version webm-writer 0.2.0, playing around with the webm quality had a minor effect on file size. The file size shrunk by 7% when switching from highest to lowest quality setting.

tariqazmat101 commented 4 years ago

Swapping out to the newest version of webmwriter reduced file size from 26mb(highest quality) to 11mb(at 10 percent quality)!

It's a decent solution, but the video quality does degrade as you lower bit rate. I will have to find a fine balance between videoquality and size, haha.

Thanks! EDIT: Oh, I understand why these WEBM files are so massive, it's because it's using intraframe compression, and not interframe.

from https://github.com/antimatter15/whammy,

"The cool thing about WebP which was exploited in Weppy is that it's actually based on the same codec as WebM, On2's VP8. That means the actual image data, when the container formats are ignored, are virtually interchangable. With a catch: it's intraframe only.

So it's a video encoder in that it generates .webm files which should play in just about any program or device which supports the WebM format. But interframe compression is actually a fairly important thing which could reduce the file size by an order of magnitude or more."

thenickdude commented 4 years ago

Thanks for the test, I'll submit a pull request to them to get it updated.