dmnsgn / canvas-record

Record a video in the browser or directly on the File System from a canvas (2D/WebGL/WebGPU) as MP4, WebM, MKV, GIF, PNG/JPG Sequence using WebCodecs and Wasm when available.
https://dmnsgn.github.io/canvas-record/
MIT License
328 stars 18 forks source link

Is. there any way to improve the quality of video? #10

Closed rmj723 closed 1 year ago

rmj723 commented 1 year ago

I was trying to export threejs scene into mp4, but the quality is not good. Please let me know if there is any way to improve it.

arcman7 commented 1 week ago

What was the resolution on this?

dmnsgn commented 5 days ago

One of the most important encoderOptions to improve quality is bitrate.

It is currently guestimated in estimateBitRate but it is really dependent on the type of video you are exporting (eg. animated vector graphics don't require the same bitrate as realistic scene with environment map).

arcman7 commented 4 days ago

In a hypothetical scenario, say we're rendering a real life video filmed in 4k (very realistic) to the canvas, and for whatever reason we want to re-export that video using canvas-record, we would aim to use the highest possible bitrate? If the canvas were of size 500x500 pixels, would we just need a bitrate capable of capturing the entirety of that canvas on each frame? Or is there some nifty tricks being done under the hood that utilize key-frames?