Comments (2)
You are totally correct, all of this is working as it should, thank you for the reply.
from webm-muxer.
I actually do call close
in my demo code! Here:
// ...
const encodeVideoFrame = () => {
let elapsedTime = document.timeline.currentTime - startTime;
let frame = new VideoFrame(canvas, {
timestamp: framesGenerated * 1e6 / 30
});
framesGenerated++;
let needsKeyFrame = elapsedTime - lastKeyFrame >= 10000;
if (needsKeyFrame) lastKeyFrame = elapsedTime;
videoEncoder.encode(frame, { keyFrame: needsKeyFrame });
frame.close(); // <=== THIS LINE HERE
recordingStatus.textContent =
`${elapsedTime % 1000 < 500 ? 'π΄' : 'β«'} Recording - ${(elapsedTime / 1000).toFixed(1)} s`;
};
// ...
The warning you're talking about is typically benign and just wants to encourage the programmer to manually GC video frames for better memory management.
In your line:
this.videoEncoder.encode(new VideoFrame(frame, { timestamp: time * 1000 }), {
keyFrame: !(frameIndex % 50),
});
you'll need to keep a reference to the frame to garbage collect it later on:
let frame = new VideoFrame(frame, { timestamp: time * 1000 });
this.videoEncoder.encode(frame, {
keyFrame: !(frameIndex % 50),
});
frame.close();
from webm-muxer.
Related Issues (20)
- Help getting audio from audio context working HOT 8
- Recording a <canvas> and audio stream HOT 12
- Need help with YouTube Live Ingest using HLS HOT 1
- Support transparency / alpha by encoding stream HOT 8
- Timeline for Firefox VideoEncoder support HOT 4
- Can microphone audio be synthesized when recording screen? HOT 2
- Are there plans to support demux webm fileοΌ HOT 2
- Provide package as ESM module HOT 2
- VideoDecoder? HOT 1
- Using with nodejs fs HOT 12
- How to use with PHP? HOT 10
- Writing to disk via node HOT 3
- Help with multimedia file (muxing audio and video) HOT 12
- is one chunk equals to one segment ? HOT 23
- webmmuxer throws Matroska cluster too big error even with 10 seconds keyframe interval. HOT 8
- Dynamic browser support HOT 6
- StreamTarget onDone not available anymore since v4.0.0 HOT 1
- Stream to web storage HOT 2
- Video is flickering, seems to be related to slow Android device HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webm-muxer.