Replace MediaRecorder video export with WebCodecs + custom WebM muxer
MediaRecorder/captureStream kept crashing the Chrome renderer (STATUS_BREAKPOINT). Video is now encoded offline with VideoEncoder (VP9 with VP8 fallback) and muxed by a dependency-free EBML/Matroska writer. Adds precise export controls: video fps (24/30/60), exact length (1-8 loops or 5-60s), and a GIF loop-forever/play-once toggle. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+6
-4
@@ -186,10 +186,12 @@ var GIFEnc = (function () {
|
||||
out.byte(col[0]); out.byte(col[1]); out.byte(col[2]);
|
||||
}
|
||||
|
||||
/* NETSCAPE loop forever */
|
||||
out.byte(0x21); out.byte(0xFF); out.byte(11);
|
||||
out.string("NETSCAPE2.0");
|
||||
out.byte(3); out.byte(1); out.short(0); out.byte(0);
|
||||
/* NETSCAPE loop extension: 0 = forever. Omitted entirely -> play once. */
|
||||
if (opts.loop !== false) {
|
||||
out.byte(0x21); out.byte(0xFF); out.byte(11);
|
||||
out.string("NETSCAPE2.0");
|
||||
out.byte(3); out.byte(1); out.short(0); out.byte(0);
|
||||
}
|
||||
|
||||
var delay = Math.max(2, Math.round(100 / fps));
|
||||
var indices = new Uint8Array(w * h);
|
||||
|
||||
Reference in New Issue
Block a user