Galène videoconferencing server discussion list archives
 help / color / mirror / Atom feed
* [Galene] Filtering outgoing video
@ 2021-01-12  1:45 Juliusz Chroboczek
  2021-01-12 16:02 ` [Galene] " Toke Høiland-Jørgensen
  2021-01-12 19:27 ` Antonin Décimo
  0 siblings, 2 replies; 9+ messages in thread
From: Juliusz Chroboczek @ 2021-01-12  1:45 UTC (permalink / raw)
  To: galene

Dear all,

One of my colleagues is using a pocket mirror in front of her laptop's
webcam in order to stream her (physical) desktop.  Teaching during
lockdown when you've got no blackboard at home is *hard*.

Obviously, if you use a mirror, then your writing comes out mirrored, so
you need to mirror it again before sending it out.  She's been using some
proprietary webcam software to do that, so I've just added the ability to
filter the outgoing video through an arbitrary Javascript function.

There's no user interface yet.  At the chat prompt, type

  /set filter "mirror-h"

or

  /set filter "mirror-v"

*before* you hit Ready.  The video should come out mirrored.

Known limitation: the filtering is unconditionally done at 30fps rather
than being synchronised with the webcam's framerate.  If anyone knows how
to fix that, please let me know.

I'd be grateful if somebody competent at Javascript could check my code.

-- Juliusz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Galene] Re: Filtering outgoing video
  2021-01-12  1:45 [Galene] Filtering outgoing video Juliusz Chroboczek
@ 2021-01-12 16:02 ` Toke Høiland-Jørgensen
  2021-01-12 17:29   ` Juliusz Chroboczek
  2021-01-12 19:27 ` Antonin Décimo
  1 sibling, 1 reply; 9+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-01-12 16:02 UTC (permalink / raw)
  To: Juliusz Chroboczek, galene

Juliusz Chroboczek <jch@irif.fr> writes:

> Dear all,
>
> One of my colleagues is using a pocket mirror in front of her laptop's
> webcam in order to stream her (physical) desktop.  Teaching during
> lockdown when you've got no blackboard at home is *hard*.
>
> Obviously, if you use a mirror, then your writing comes out mirrored, so
> you need to mirror it again before sending it out.  She's been using some
> proprietary webcam software to do that, so I've just added the ability to
> filter the outgoing video through an arbitrary Javascript function.
>
> There's no user interface yet.  At the chat prompt, type
>
>   /set filter "mirror-h"
>
> or
>
>   /set filter "mirror-v"
>
> *before* you hit Ready.  The video should come out mirrored.

It's quite common for other video conferencing solutions to mirror your
own view of yourself, without affecting what is sent to others (so it
looks like you're looking in a mirror when you see yourself). Any chance
this could be extended to allow that as well?

-Toke

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Galene] Re: Filtering outgoing video
  2021-01-12 16:02 ` [Galene] " Toke Høiland-Jørgensen
@ 2021-01-12 17:29   ` Juliusz Chroboczek
  2021-01-12 18:12     ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 9+ messages in thread
From: Juliusz Chroboczek @ 2021-01-12 17:29 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen; +Cc: galene

> It's quite common for other video conferencing solutions to mirror your
> own view of yourself, without affecting what is sent to others (so it
> looks like you're looking in a mirror when you see yourself).

We already do that.  (Except in full-screen and in PiP mode, there's
a pull request for that.)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Galene] Re: Filtering outgoing video
  2021-01-12 17:29   ` Juliusz Chroboczek
@ 2021-01-12 18:12     ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 9+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-01-12 18:12 UTC (permalink / raw)
  To: Juliusz Chroboczek; +Cc: galene

Juliusz Chroboczek <jch@irif.fr> writes:

>> It's quite common for other video conferencing solutions to mirror your
>> own view of yourself, without affecting what is sent to others (so it
>> looks like you're looking in a mirror when you see yourself).
>
> We already do that.  (Except in full-screen and in PiP mode, there's
> a pull request for that.)

Hah, yes indeed, so it seems! Seems I didn't even notice that, even
though I spent two hours in a video meeting today :D

-Toke

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Galene] Re: Filtering outgoing video
  2021-01-12  1:45 [Galene] Filtering outgoing video Juliusz Chroboczek
  2021-01-12 16:02 ` [Galene] " Toke Høiland-Jørgensen
@ 2021-01-12 19:27 ` Antonin Décimo
  2021-01-12 20:56   ` Juliusz Chroboczek
  2021-01-13 11:14   ` Juliusz Chroboczek
  1 sibling, 2 replies; 9+ messages in thread
From: Antonin Décimo @ 2021-01-12 19:27 UTC (permalink / raw)
  To: Juliusz Chroboczek, galene

Cool !

> I'd be grateful if somebody competent at Javascript could check my code.

Firefox raises an exception:

    Uncaught (in promise)
    Exception { name: "NS_ERROR_NOT_INITIALIZED", message: "", result: 3253927937, filename: "https://localhost:8443/galene.js", lineNumber: 807, columnNumber: 0, data: null, stack: "Filter@https://localhost:8443/galene.js:807:38\naddLocalMedia@https://localhost:8443/galene.js:937:17\nasync*gotJoined@https://localhost:8443/galene.js:1638:23\nServerConnection.prototype.connect/</this.socket.onmessage@https://localhost:8443/protocol.js:293:33\nEventHandlerNonNull*ServerConnection.prototype.connect/<@https://localhost:8443/protocol.js:257:9\nServerConnection.prototype.connect@https://localhost:8443/protocol.js:224:18\nserverConnect@https://localhost:8443/galene.js:2521:32\n@https://localhost:8443/galene.js:2422:9\nEventHandlerNonNull*@https://localhost:8443/galene.js:2413:10\n" }


    this.canvas = document.createElement('canvas');

    /** .... */
    this.captureStream = this.canvas.captureStream(0);

The problem is that the context isn't created before captureStream.


Have you considered using WebGL and shaders for filters instead? We
may benefit from acceleration and we could add trippy shaders too!

-- Antonin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Galene] Re: Filtering outgoing video
  2021-01-12 19:27 ` Antonin Décimo
@ 2021-01-12 20:56   ` Juliusz Chroboczek
  2021-01-13 11:14   ` Juliusz Chroboczek
  1 sibling, 0 replies; 9+ messages in thread
From: Juliusz Chroboczek @ 2021-01-12 20:56 UTC (permalink / raw)
  To: Antonin Décimo; +Cc: galene

> The problem is that the context isn't created before captureStream.

Grr.  I wonder what happens if I destroy and recreate the context.

> Have you considered using WebGL and shaders for filters instead?

Anything you can do in Javascript in less than 30ms, you can put in the
filter.  Before you go wild, wait until I implement pacing (dropping
frames if you go over 30ms -- right now, you might hang the UI.)

-- Juliusz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Galene] Re: Filtering outgoing video
  2021-01-12 19:27 ` Antonin Décimo
  2021-01-12 20:56   ` Juliusz Chroboczek
@ 2021-01-13 11:14   ` Juliusz Chroboczek
  2021-01-13 13:11     ` Juliusz Chroboczek
  2021-01-14  9:38     ` Michael Ströder
  1 sibling, 2 replies; 9+ messages in thread
From: Juliusz Chroboczek @ 2021-01-13 11:14 UTC (permalink / raw)
  To: Antonin Décimo; +Cc: galene

>> I'd be grateful if somebody competent at Javascript could check my code.

> Firefox raises an exception:

Grr.  Firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=1257440

(I'll work around it, just wanted to share my bad mood with the list.)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Galene] Re: Filtering outgoing video
  2021-01-13 11:14   ` Juliusz Chroboczek
@ 2021-01-13 13:11     ` Juliusz Chroboczek
  2021-01-14  9:38     ` Michael Ströder
  1 sibling, 0 replies; 9+ messages in thread
From: Juliusz Chroboczek @ 2021-01-13 13:11 UTC (permalink / raw)
  To: Antonin Décimo; +Cc: galene

> Grr.  Firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=1257440

I've worked around another firefox bug, this should be fixed now.  I've
also added a user interface.

If you want to play with WebGL, set contextType to 'webgl2'.

-- Juliusz

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Galene] Re: Filtering outgoing video
  2021-01-13 11:14   ` Juliusz Chroboczek
  2021-01-13 13:11     ` Juliusz Chroboczek
@ 2021-01-14  9:38     ` Michael Ströder
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Ströder @ 2021-01-14  9:38 UTC (permalink / raw)
  To: galene

On 1/13/21 12:14 PM, Juliusz Chroboczek wrote:
>>> I'd be grateful if somebody competent at Javascript could check my code.
> 
>> Firefox raises an exception:
> 
> Grr.  Firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=1257440

Ah, already five years with status "NEW"...

Did you find a solution? With recent git HEAD firefox 84.0.2 just shows
colored stripes when enabling one of the filters.

Ciao, Michael.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-14  9:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12  1:45 [Galene] Filtering outgoing video Juliusz Chroboczek
2021-01-12 16:02 ` [Galene] " Toke Høiland-Jørgensen
2021-01-12 17:29   ` Juliusz Chroboczek
2021-01-12 18:12     ` Toke Høiland-Jørgensen
2021-01-12 19:27 ` Antonin Décimo
2021-01-12 20:56   ` Juliusz Chroboczek
2021-01-13 11:14   ` Juliusz Chroboczek
2021-01-13 13:11     ` Juliusz Chroboczek
2021-01-14  9:38     ` Michael Ströder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox