Flex WebCam參數調整

使用工具:

Flex3
羅技 HD Pro 網路攝影機 C910

原本在測試WebCam時,發現沒有使用下面三個參數設定的話,在畫質上有非常大的差別

官方說明:

Camera.setMode(width,height,fps)
設定攝影機捕捉模式為最能符合特定要求的原生模式。如果攝影機沒有能夠符合您傳送之所有參數的原生模式,Flash 會選取最能夠合成要求模式的捕捉模式。這項操作可能會牽涉到裁切影像和丟棄影格。

width 要求捕捉的寬度,以像素為單位。預設值為 160。

height>要求捕捉的高度,以像素為單位。預設值為 120。

fps攝影機捕捉資料所需要的速率,以每秒影格數為單位。預設值為 15。

SetMode的第一個參數Width和第二個參數Height,最好與前端顯示的界面大小一樣,太大會造成鋸齒,太小又會模糊,ex若我使用VideoDisplay來顯示Camera,那麼VideoDisplay的大小就最好跟setMode的大小一樣

[as3]
camera.setMode(240,180,15)

[/as3]

指定進行完整傳輸而不由視頻壓縮法進行處理

[as3]
camera.setKeyFrameInterval(60)

[/as3]

據官方說法如下,可是當使用下列方法,再去使用Camera.quality測得的品質確實有所改變,所以是人眼看不出的改變?

這個方法通常只適用於使用 Flash Media Server 來傳輸視訊的狀況。

[as3]
camera.setQuality(144,85 )

[/as3]

官方API


bandwidth:int
 — Specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. To specify that the video can use as much bandwidth as needed to maintain the value of quality, pass 0 for bandwidth. The default value is 16384.  -->預設值16384,也可以輸入0

			

2 thoughts on “Flex WebCam參數調整

  1. camera.setQuality(144,85 );
    係FLASH:
    左面係BANDWIDTH, default係大約144000,你SET做144…
    自動最高頻寬係0
    ,右邊係0-100既質素

Leave a Reply to RoadMan Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>