aullman / opentok-camera-filters Goto Github PK
View Code? Open in Web Editor NEWlibrary which lets you add visual filters to your OpenTok Publisher
License: MIT License
library which lets you add visual filters to your OpenTok Publisher
License: MIT License
Hi,
Will you consider to let the client to set the desired framerate rather than staying with the default one?
I noticed when the resolution is high, says 1280x720, the filters are pretty slow. Reducing the framerate does help a little bit.
Something like this:
const fps = 30;
let then = Date.now();
let fpsInterval = 1000 / fps;
// Draws a frame on the specified canvas after applying the selected filter every
// requestAnimationFrame
const drawFrame = function drawFrame() {
if (!ctx) {
ctx = canvas.getContext('2d');
}
if (!tmpCanvas) {
tmpCanvas = document.createElement('canvas');
tmpCtx = tmpCanvas.getContext('2d');
tmpCanvas.width = canvas.width;
tmpCanvas.height = canvas.height;
}
const now = Date.now();
const elapsed = now - then;
if (elapsed > fpsInterval) {
// Get ready for next frame by setting then=now, but also adjust for your
// specified fpsInterval not being a multiple of RAF's interval (16.7ms)
then = now - (elapsed % fpsInterval);
// Put your drawing code here
tmpCtx.drawImage(videoElement, 0, 0, tmpCanvas.width, tmpCanvas.height);
const imgData = tmpCtx.getImageData(0, 0, tmpCanvas.width, tmpCanvas.height);
const data = selectedFilter(imgData);//ImageData
ctx.putImageData(data, 0, 0);
}
if (!stopped) {
requestAnimationFrame(drawFrame);
} else {
tmpCanvas = null;
tmpCtx = null;
ctx = null;
}
};
Usually, when we use opentok if we leave that connection tab basically communication tab open we can move to next tab on a same browser but the stream is continues to upload. when using the these filters when we move to next tab on a same browser the stream stops uploading.
Is there any way to fix that?
Thanks,
Hari
Tokboxjs Stop screen share is also not working when I using this API. When I try to stop screen share the chrome "stop sharing" popup will not close automatically.
https://github.com/auduno/clmtrackr
It can detect more specific features of the face than tracking.js and it has a really impressive demo which is really responsive.
Result: The video in the publisher ends up getting stretched or pinched.
We should detect when the video dimensions change and then update the dimensions of the publisher Canvas.
Hi,
When I change my browser tab my video stream not working and showing blank screen to other publisher on the session and when I come back on same tab it works fine.
Screenshare still not working I have pulled updated code and it's not closing "stop screenshare" automatically.
Also, when I start screen share it gives below error:
peer_connection.js:596 Error while setting RemoteDescription OperationError: Failed to set remote answer sdp: Called in wrong state: STATE_INPROGRESS in state
ot_error_class.js:779 OT.exception :: title: Unable to Publish (1500) msg: OT.Publisher PeerConnection Error: Error while setting RemoteDescription OperationError: Failed to set remote answer sdp: Called in wrong state: STATE_INPROGRESS
And when I stop screenshare It gives below error:
OT_NOT_FOUND: The stream does not exist.
OT.exception :: title: undefined (undefined) msg: The stream does not exist.
The publisher ca3c9ac1-4d61-42ea-8f90-fba740be028a is trying to unpublish from a session 1_MX40NTc0NzM3Mn5-MTUwOTQzMDExNDExNn5ZYitRS1N0SzB1TnNoUVFSV3JFTkQzYVV-fg it is not attached to (it is attached to no session)
The publisher 1560f7a9-a8b3-44d5-b7e8-f5635a6bf6c0 is trying to unpublish from a session 1_MX40NTc0NzM3Mn5-MTUwOTQzMDExNDExNn5ZYitRS1N0SzB1TnNoUVFSV3JFTkQzYVV-fg it is not attached to (it is attached to no session)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.