Re: [rtcweb] Mute implementations (Re: More Comments ondraft-ietf-rtcweb-use-cases-and-requirements-07)

Stefan Hakansson LK <stefan.lk.hakansson@ericsson.com> Sun, 17 June 2012 14:33 UTC

Return-Path: <stefan.lk.hakansson@ericsson.com>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6241F21F8533 for <rtcweb@ietfa.amsl.com>; Sun, 17 Jun 2012 07:33:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.769
X-Spam-Level:
X-Spam-Status: No, score=-5.769 tagged_above=-999 required=5 tests=[AWL=-0.120, BAYES_00=-2.599, HELO_EQ_SE=0.35, J_CHICKENPOX_55=0.6, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W0wukOqumCAO for <rtcweb@ietfa.amsl.com>; Sun, 17 Jun 2012 07:33:12 -0700 (PDT)
Received: from mailgw7.ericsson.se (mailgw7.ericsson.se [193.180.251.48]) by ietfa.amsl.com (Postfix) with ESMTP id 20C6C21F852B for <rtcweb@ietf.org>; Sun, 17 Jun 2012 07:33:11 -0700 (PDT)
X-AuditID: c1b4fb30-b7f606d0000002be-37-4fddeaa68417
Received: from esessmw0247.eemea.ericsson.se (Unknown_Domain [153.88.253.125]) by mailgw7.ericsson.se (Symantec Mail Security) with SMTP id 86.B7.00702.6AAEDDF4; Sun, 17 Jun 2012 16:33:10 +0200 (CEST)
Received: from [127.0.0.1] (153.88.115.8) by esessmw0247.eemea.ericsson.se (153.88.115.94) with Microsoft SMTP Server id 8.3.264.0; Sun, 17 Jun 2012 16:33:09 +0200
Message-ID: <4FDDEAA4.5090809@ericsson.com>
Date: Sun, 17 Jun 2012 16:33:08 +0200
From: Stefan Hakansson LK <stefan.lk.hakansson@ericsson.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1
MIME-Version: 1.0
To: rtcweb@ietf.org
References: <5A2F246E-9D77-4B72-B3F1-681B00FA99FD@cisco.com><AAB6A6B6-BEC7-436C-B1EB-2C117596C7C6@cisco.com><F3D4ABD6AB47084B84337CF4F3446A464B2F2631AC@ESESSCMS0362.eemea.ericsson.se><9F33F40F6F2CD847824537F3C4E37DDF021B53@MCHP04MSX.global-ad.net><CA+9kkMCL1k3x2hYi632nDU2g6CtOq3O7risDi38+7FTeWkxcGA@mail.gmail.com><9F33F40F6F2CD847824537F3C4E37DDF0223ED@MCHP04MSX.global-ad.net><4FD89773.3090506@ericsson.com><9F33F40F6F2CD847824537F3C4E37DDF02594D@MCHP04MSX.global-ad.net><4FD9AD1E.6060504@alvestrand.no> <4FD9E2BE.2080907@ericsson.com><CAOJ7v-18EynuscX3tLRryzqKxyXwYzES9K4zroE-5=FL4o8WzA@mail.gmail.com><4FDB9E20.8070408@jesup.org><CABkgnnVqeyuayFsiA7YD+OFnyCi8tqode6VdypeaHKT+Z73KWw@mail.gmail.com><4FDBA6AC.2080107@jesup.org> <4FDCE4D4.7070909@alvestrand.no> <E17CAD772E76C742B645BD4DC602CD8106581BE5@NAHALD.us.int.genesyslab.com> <4FDCEDC2.2040903@alvestrand.no> <E17CAD772E76C742B645BD4DC602CD8106581BEA@NAHALD.us.int.genesyslab.com> <4FDD2706.3040202@jesup.org>
In-Reply-To: <4FDD2706.3040202@jesup.org>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBJMWRmVeSWpSXmKPExsUyM+Jvre6yV3f9DU4t0rJY+6+d3YHRY8mS n0wBjFFcNimpOZllqUX6dglcGY2HprEXfNSq+DtxJksD41KlLkZODgkBE4mmjj8sELaYxIV7 69m6GLk4hAROMUocXdrDDOEsZ5RoOv+JCaSKV0BbYta07WAdLAKqEru33mEFsdkEbCTWdk8B quHgEBUIk1j9QAOiXFDi5MwnYOUiAsISW1/1go0RFiiQ+HPjDNSyk+wSi/ffYwHp5RTQlPg7 1xPEZBawl3iwtQyknFlAXqJ562xmEFtIQFfi3et7rBMYBWYh2TALoWMWko4FjMyrGIVzEzNz 0svN9VKLMpOLi/Pz9IpTNzECQ+/glt8GOxg33Rc7xCjNwaIkzqunut9fSCA9sSQ1OzW1ILUo vqg0J7X4ECMTB6dUA+O0hLhfpbMCmISsbPYaTBHzr6hdsGeyY0qnD3/d/dMtvkL3Xnx02Tqz 7mnqzvUpdg+ZPPn7l0x5l/Zm6su921rW2mz3/ufW4if01qaqJto/SOJX8rLw17czOqNcNs7n iM60trSblxmyYJEDk3BKcvza1BmHliunbFA45R2SkT2t+lqeiuAmFiWW4oxEQy3mouJEAFdD rt0LAgAA
Subject: Re: [rtcweb] Mute implementations (Re: More Comments ondraft-ietf-rtcweb-use-cases-and-requirements-07)
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <rtcweb.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rtcweb>
List-Post: <mailto:rtcweb@ietf.org>
List-Help: <mailto:rtcweb-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Jun 2012 14:33:13 -0000

For the fun of it I thought a little while about what options that are 
currently available with the APIs that are in the W3C docs as is. The 
list is in no way exhaustive, there are other ways to do it.

Perhaps this is not sufficient for what people want to do, but at least 
there are some things you can do already:

1. Replace video with the display of an image
=============================================
One solution: Use the “poster” attribute of the video element. Quote 
from the html spec: “The poster attribute gives the address of an image 
file that the user agent can show while no video data is available.”. We 
can spec it such that if no video track of a MediaStreamis active, that 
counts “as no data available”. This way, as soon as the user “mutes” the 
video, an image will replace it at display. The site can supply the 
image (either a default by the site or one “profile” pic selected by the 
user), or it can be provided over the data channel (as a blob).

Another solution: A signal is sent on the data channel (possibly 
accompanied by the image) on the data channel, the peer’s app overlays 
the image on top of the video element as result (and switches back on 
another signal).

A third (similar) solution: The app at the receiving end listens to 
“onunmute” of the video track in question; once it fires an image is 
overlayed.

A fourth: The peer’s app analyzes the video using canvas, and overlays 
an image when there is no data in the video.

2. Switch between front and rear camera
========================================
One solution: create a MediaStream (e.g. by calling getUserMedia twice 
immediately after each other, or by combining existing tracks into a new 
MediaStream) containing two video tracks (front+back cam). The video 
shown is toggled by enabling/disabling video tracks (the video element 
plays the first active one in the case of several video tracks).

Another: use add/removeTrack to switch video track being sent.

3. Play music on hold
=====================
One solution (audio only case): The site provides an URL to a (music) 
file to play when on hold. The peer’s app registers an event listener 
that listens to “onmute” on the incoming audio track. When “onmute” 
fires, the app changes the source of the audio element to the URL of the 
music file.

One solution if the communication is audio+video, and the intent is to 
just replace the audio (but continue playing video): assume a 
MediaStream with one audio and one video track is used. Play the audio 
in an audio element, the video in a (muted) video element. At on hold, 
replace the source of the audio element with the music file.

A solution if the communication is audio+video, and the intent is to 
replace audio and video: either “mute” the tracks (at sending side); 
receiving end gets “onmute” event and replaces the .src of the video 
element with the URL to a video file, or signal on the data channel 
something that makes the other end replace the src of the video element 
with an URL to a file

Another solution is that the sending end does “removeStream” from 
PeerConnection. This fires “onremovestream” at the receiving side; that 
event can trigger the change of src to the video element. This solution 
frees up resources.

Note that once the recording function has been specced (in such a way 
that the recorded file can be the source of a MediaStream) more options 
will become available.

--Stefan

On 06/17/2012 02:38 AM, Randell Jesup wrote:
> On 6/16/2012 5:58 PM, Jim Barnett wrote:
>> It's capturing the requirement accurately that I'm concerned with.  I
>> think "To be able to change the source of a video stream after its
>> creation" is too broad, in the sense that someone might interpret it to
>> mean that the system could shift from the front to the rear camera
>> without asking permission.  For mute and hold, we want something like
>> "switch to a dummy source and back".  The source that we switch to in
>> cases like this is not a 'first-class' video source, but rather a
>> place-holder.  That's very different from switching to another live
>> source.
>
> Which, by the way, we should be able to do.
>
> MediaStreams need to be able to be repointed, switched, processed, etc,
> OR you need to be able to replace a MediaStream in the inputs to
> PeerConnection with another one transparently without renegotiation (and
> that misses a bunch of uses).
>
> The MediaStream Processing provides a mechanism to do this for both
> audio and video, plus the ability to do more complex operations
> (cross-fades audio-and-video, frame-accurate source switches, etc).
>
> If you don't have or use that, you need the ability to replace a track
> in a MediaStream with another track.
>
> All we're talking about are mechanisms to shuffle existing or creatable
> tracks/streams; a new camera source would require a call to
> getUserMedia() and a dialog.  Once you had front and back, you could
> switch sources without effectively shutting down all media and restarting.
>
> Simple one camera ->  one video stream mechanisms are insufficient for
> application using these features.  If you force people, they'll roll
> their own using canvases, etc.
>
> I want something generic and usable in lots of interesting ways, not a
> few special-purpose pre-coded mechanisms (for example, a
> track.setMuteImage() method).
>