1

我开发了一个 Flash 视频录像机(使用 AS3,Flex),它可以捕获实时网络摄像头并流到 Wowza 媒体服务器。

我正在尝试对正在捕获的实时视频应用锐度、对比度、饱和度和锐度滤镜。

我可以对屏幕上捕获的视频应用滤镜效果。我们如何应用过滤器以使其反映在正在发布的流中?

提前谢谢拉杰什

4

1 回答 1

0

此代码来自用于研究 adobe stratus 功能的测试应用程序,它重复了 Skype 的基本功能,

这里是处理类:

public class RecievingObject extends Object
    {        
        public function RecievingObject(){

        }        
        public function message(str: String):void {
            ChatWindow.addText('>> ' + str);
        }
    }

以及它如何附加到流(除了NetStatusEvent什么都不做的处理程序之外的整个类):

    public final class Streams
    {

        private static var streamOut: NetStream;
        private static var streamIn: NetStream;

        public static function initIn(id: String): void {
            streamIn = new NetStream(Main.connection, id);
            streamIn.client = new RecievingObject();
            streamIn.addEventListener(NetStatusEvent.NET_STATUS, onInStatus);
            streamIn.receiveVideo(true);
            streamIn.receiveAudio(true); 
            streamIn.play('media');
            VideoWindow.initIn(streamIn);
            Mixer.initSound(streamIn);
        }

        public static function initOut(): void {
            streamOut = new NetStream(Main.connection, NetStream.DIRECT_CONNECTIONS);
            var peerConnected:Object = new Object();
                peerConnected.onPeerConnect = function(subscriberStream : NetStream) : Boolean {
                    var oo:RecievingObject = new RecievingObject();
                    subscriberStream.client = oo;
                    if(!streamIn){ initIn((subscriberStream as NetStream).farID); }                    
                    return true;
                }
            streamOut.client = peerConnected;            
            streamOut.addEventListener(NetStatusEvent.NET_STATUS, onOutStatus);            
            streamOut.attachCamera(Camera.getCamera());
            streamOut.attachAudio(Microphone.getMicrophone());
            streamOut.publish('media'); 
        }


        public static function send(data: String): void {
            if(streamOut) { streamOut.send('message', data); }
            ChatWindow.addText('<< ' + data);
        }
   }
于 2010-12-06T19:33:02.060 回答