Skip to content

Commit

Permalink
fixed multiple encode problem, and keyframe flagging
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbankoski committed May 10, 2021
1 parent 913c854 commit 371939d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions samples/capture-to-file/capture-to-file.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@
encoder.configure(config);
frameReader.read().then(function processFrame({done, value}) {

if(done) {
self.postMessage("Stream is done.");
if(done||stop) {
value.close();
frameReader.releaseLock();
encoder.close();
frame_counter = 0;
return;
}

Expand All @@ -120,7 +120,7 @@
}
async function main() {
video = document.getElementById("src");
let constraints = { audio: false, video: { width: 1280, height: 720, frameRate: 30 } };
let constraints = { audio: false, video: {width: 1280, height: 720, frameRate: 30}};
stream = await window.navigator.mediaDevices.getUserMedia(constraints);
video.srcObject = stream;
}
Expand Down
1 change: 1 addition & 0 deletions samples/capture-to-file/webm-writer2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,7 @@ let WebMWriter = function(ArrayBufferDataStream, BlobBuffer) {
addFrameToCluster({
frame: new Uint8Array(frame.data),
intime: frame.timestamp,
type: frame.type,
});
return;
}
Expand Down

1 comment on commit 371939d

@guest271314
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.