在透過 FMS 撥放 rtmp 串流影音時,若你的 CLIENT 端除了撥放,還要抓圖作處理的話,會遇到如下的例外…
SecurityError: Error #2123: Security sandbox violation:
BitmapData.draw: file:///xxx/xxx/xxx.swf
cannot access rtmp://xxx.xxx.xxx/live. No policy files granted access.
解決方式如下…
1. COPY 安裝範例 C:\Program Files\Adobe\Flash Media Server 3.5\samples\applications\vod 到你自己的應用程式。(有興趣可以研究看看其寫法)
2. 修改 Application.xml 檔,在 <client></client> 區間加入…
<Access>
<VideoSampleAccess enabled="true">/</VideoSampleAccess>
</Access>
3. 修改 main.asc (即 Server-side-code)…
找到 application.onConnect = function( p_client, p_autoSenseBW )
這邊是用來處理當有 client 連到這個 server app 時的對應函式,幾個相關參數設定如下…
writeAccess:
若你有用到 shared object 或 live streams,就把它註解掉
//p_client.writeAccess = ""; // prevents creating shared object or live streams.
audioSampleAccess:
允許 client side 直接抓取音效 raw data,利用 SoundMixer.computeSpectrum() 處理音效
p_client.audioSampleAccess = "/";
audioSampleAccess:
允許 client side 直接抓取影片 raw data,利用 BitmapData.draw() 抓圖
p_client.videoSampleAccess = "/";
參考這篇: http://www.thebluepipe.com/Developer/tutorials/as3/Crossdomain-Video-Snapshot-Fixing-BitmapData-draw-Security-Sandbox-Violation.html
訂閱:
張貼留言 (Atom)
更高效處理 micro second 的方式
更高效處理 micro second 的方式… 以 STM32 為例… __IO unsigned long sys_tick = 0; void SysTick_Handler(void) { HAL_IncTick(); sys_tick += (SysTi...
-
rails blog -d mysql 建立一個名為 blog 的網站app,使用 mysql cd blog 進去 gen 好的網站 config/database.yml 編輯資料庫設定 rake db:create 自動建立資料庫 ruby script/generate ...
-
https://github.com/ljean/modbus-tk/ install pip… sudo apt-get install python-pip install... download modbus_tk-x.x.x.tar.gz tar zxvf...
-
DMX protocol… # 1:break + 1:start + 512:channel python: import serial class DMX512: def __init__(self, port): self.seria...
沒有留言:
張貼留言