GithubHelp home page GithubHelp logo

aullman / opentok-camera-filters Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 9.0 16.4 MB

library which lets you add visual filters to your OpenTok Publisher

License: MIT License

JavaScript 88.26% Shell 11.74%

opentok-camera-filters's People

Contributors

aiham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

opentok-camera-filters's Issues

Let user to set the frame rate

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.

const drawFrame = function drawFrame() {

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;
  }
};

Stream stops uploading when moving to next tab

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

Tokbox Stop screen share not working

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.

Many issues with screenshare

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.