W3C home > Mailing lists > Public > public-media-capture@w3.org > June 2012

: Can getUserMedia return multiple mediastreams?

From: Sunyang (Eric) <eric.sun@huawei.com>
Date: Mon, 04 Jun 2012 01:18:28 +0000
To: Stefan Hakansson LK <stefan.lk.hakansson@ericsson.com>, "public-media-capture@w3.org" <public-media-capture@w3.org>
Message-id: <9254B5E6361B1648AFC00BA447E6E8C32A506D4B@szxeml501-mbx.china.huawei.com>
Hi Stefan

Thanks for your reply

Yes, I know we can construct MediaStream using existing MediaStreamTrack in other MediaStream.
But from existing demo in internet, Ericsson webrtc browser, Google Chrome, it seems that we can only choose 1 camera at the same time.
This is the first limitation.

And getUserMedia only return 1 MediaStream, let's assume we can get 2 camera MediaStreamTrack in 1 stream, we need to execute extra step 
by construct MediaStream using existing MediaStreamTrack, what's more the 2 camera MediaStreamTrack are not needed to be synchronized(only
synchronized MediaStreamTrack should be placed inside 1 MediaStream), 1 camera is for <video> element rendering, another camera is for face detection/authorization etc..

What I am requesting is :

Can we let getUserMedia optionally to return a MediaStreamList type value so that JS can iterate through the list and pick the right one for video element rendering, right one 
For face detection/authorization.

MediaStream can contain quality information to help JS to judge which one to choose for different purpose?

Yang
-----ʼԭ-----
: Stefan Hakansson LK [mailto:stefan.lk.hakansson@ericsson.com] 
ʱ: 201261 20:26
ռ: public-media-capture@w3.org
: Re: Can getUserMedia return multiple mediastreams?

I think it is not yet fully specified how many video tracks the stream
generated by getUserMedia can contain, and this has been discussed a bit.

However, there is always the possibility to create a new MediaStream,
containing all the video tracks you want, from tracks in existing
MediaStream's.

Stefan

On 06/01/2012 04:31 AM, Sunyang (Eric) wrote:
> now there is navigator.getUserMedia() function for html5
> 
> But JavaScript can only return 1 stream returned by getUserMedia can capture
> 
> the stream by successCallback.
> 
> For example:
> 
> getUserMedia({video:true},successCallback,errorCallback)
> 
> function successCallback(stream)
> 
> {
> 
> video.src = URL.createObjectURL(stream)
> 
> }
> 
> Now when we develop some face detection feature using html5, we have 2 
> or more
> 
> camera connect to browser, but only by browser UI can we choose which 
> one camera
> 
> can we use. We can not let JS to choose which camera can use, or use all 
> the cameras
> 
> at the same time to manipulate the camera chosen for face detection.
> 
> So, can we in future media capture draft let getUserMedia return 
> references for all available
> 
> cameras connect to browser in a array, so we can iterate streams and let 
> JS to
> 
> choose the one we want for later processing, Or in some 3D scenario, to
> 
> manipulate multiple streams from cameras to show some 3D scene. for 
> example a
> 
> better quality camera for face detection.
> 
> And streams Array returned by getUserMedia can contain quality 
> information 1
> 
> standard for 1 mega-pixel, 5 standard for mega-pixel or optionally the
> 
> description of the camera, so JS can choose by filtering or comparision.
> 
> For example:
> 
> getUserMedia({video:true},successCallback,errorCallback)
> 
> function successCallback(MediaStreamList or MediaStream[] type etc)
> 
> {
> 
> while(i<MediStreamList.length
> 
> {
> 
> if MediaStreamList(i).quality>5
> 
> video.src=url.createObjectURL(MediaStreamList(i))
> 
> break;
> 
> ......
> 
> }
> 
> }
> 
> Thanks a lot
> 
> Expecting for feedback.
> 
> ------------------------------------------------------------------------
> 
> 
> Ϊ޹˾Huawei Technologies Co., Ltd.
> Company_logo
> 
> Phone: +86 25 56622934
> Fax: +86 25 56624081
> Mobile: +86 13851889004
> Email: eric.sun@huawei.com
> ַϾ껨101 ΪϾ ʱࣺ210012
> Huawei Technologies Co., Ltd.
> No 101,Software Avenue, Yuhua District,Nanjing 518129, P.R.China
> http://www.huawei.com

> 
> ------------------------------------------------------------------------
> 
> ʼ丽лΪ˾ıϢڷ͸ַгĸ˻ 
> Ⱥ顣
> ֹκκʽʹãȫ򲿷ֵй¶ơɢ 
> ʼ
> Ϣ˱ʼ绰ʼ֪ͨ˲ɾʼ
> This e-mail and its attachments contain confidential information from 
> HUAWEI, which
> is intended only for the person or entity whose address is listed above. 
> Any use of the
> information contained herein in any way (including, but not limited to, 
> total or partial
> disclosure, reproduction, or dissemination) by persons other than the 
> intended
> recipient(s) is prohibited. If you receive this e-mail in error, please 
> notify the sender by
> phone or email immediately and delete it!
> 


Received on Monday, 4 June 2012 01:20:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:24:35 UTC