一本清日本在线视频精品,亚洲日本va午夜在线影院,国产精品麻花传媒二三区别,色屁屁www免费看欧美激情

010-68421378
當(dāng)前您所在的位置:首頁(yè)>新聞中心>新品發(fā)布

Wowza :如何獲得輸入流的音視頻編碼信息?

發(fā)布時(shí)間:2021/01/28 瀏覽量:3816
需要Wowza Media Server? 3.0.0 及更高版本的支持

注意:需要Wowza Media Server® 3.0.0 及更高版本的支持。

新版的IMediaStreamActionNotify 接口IMediaStreamActionNotify3 增加了對(duì)以下功能的支持:

Code:

voidonCodecInfoVideo(IMediaStream stream, MediaCodecInfoVideo codecInfoVideo);

voidonCodecInfoAudio(IMediaStream stream, MediaCodecInfoAudio codecInfoAudio);

這個(gè)新的事件將監(jiān)聽(tīng)音視頻流的編碼信息。

Code:

package test;

 

importcom.wowza.wms.amf.*;

importcom.wowza.wms.application.*;

importcom.wowza.wms.module.*;

importcom.wowza.wms.stream.*;

importcom.wowza.wms.media.model.*;

 

public classModuleMediaStreamActionNotify3Example extends ModuleBase

{

 

        class StreamListener implementsIMediaStreamActionNotify3

        {

               public voidonMetaData(IMediaStream stream, AMFPacket metaDataPacket)

               {

                       System.out.println("onMetaData["+ stream.getContextStr() + "]: " + metaDataPacket.toString());

               }

 

               public voidonPauseRaw(IMediaStream stream, boolean isPause, double location)

               {

                       System.out.println("onPauseRaw["+ stream.getContextStr() + "]: isPause:" + isPause + " location:"+ location);

               }

 

               public void onPause(IMediaStreamstream, boolean isPause, double location)

               {

                       System.out.println("onPause["+ stream.getContextStr() + "]: isPause:" + isPause + "location:" + location);

               }

 

               public void onPlay(IMediaStreamstream, String streamName, double playStart, double playLen, int playReset)

               {

                       System.out.println("onPlay["+ stream.getContextStr() + "]: playStart:" + playStart + "playLen:" + playLen + " playReset:" + playReset);

               }

 

               public void onPublish(IMediaStreamstream, String streamName, boolean isRecord, boolean isAppend)

               {

                       System.out.println("onPublish["+ stream.getContextStr() + "]: isRecord:" + isRecord + "isAppend:" + isAppend);

               }

 

               public void onSeek(IMediaStreamstream, double location)

               {

                       System.out.println("onSeek["+ stream.getContextStr() + "]: location:" + location);

               }

 

               public void onStop(IMediaStreamstream)

               {

                       System.out.println("onStop["+ stream.getContextStr() + "]: ");

               }

 

               public void onUnPublish(IMediaStreamstream, String streamName, boolean isRecord, boolean isAppend)

               {

                       System.out.println("onUnPublish["+ stream.getContextStr() + "]: streamName:" + streamName + "isRecord:" + isRecord + " isAppend:" + isAppend);

               }

 

               public voidonCodecInfoAudio(IMediaStream stream,

                               MediaCodecInfoAudiocodecInfoAudio) {

                       System.out.println("onCodecInfoAudio["+ stream.getContextStr() + " Audio Codec" +codecInfoAudio.toCodecsStr() + "]: ");

               }

 

               public voidonCodecInfoVideo(IMediaStream stream,

                               MediaCodecInfoVideocodecInfoVideo) {

                       System.out.println("onCodecInfoVideo["+ stream.getContextStr() + " Video Codec" +codecInfoVideo.toCodecsStr() + "]: ");

               }

        }

 

        public void onStreamCreate(IMediaStreamstream)

        {

               getLogger().info("onStreamCreate["+stream+"]:clientId:" + stream.getClientId());

               IMediaStreamActionNotify2actionNotify = new StreamListener();

 

               WMSProperties props =stream.getProperties();

               synchronized (props)

               {

                       props.put("streamActionNotifier",actionNotify);

               }

               stream.addClientListener(actionNotify);

        }

 

        public void onStreamDestroy(IMediaStreamstream)

        {

               getLogger().info("onStreamDestroy["+stream+"]:clientId:" + stream.getClientId());

 

               IMediaStreamActionNotify2 actionNotify= null;

               WMSProperties props =stream.getProperties();

               synchronized (props)

               {

                       actionNotify =(IMediaStreamActionNotify2)stream.getProperties().get("streamActionNotifier");

               }

               if (actionNotify != null)

               {

                       stream.removeClientListener(actionNotify);

                       getLogger().info("removeClientListener:" + stream.getSrc());

               }

        }

 

}

 

Wowza Streaming Engine 4是業(yè)界功能強(qiáng)大、API接口豐富的流媒體Server產(chǎn)品,采用它作為流媒體服務(wù)器產(chǎn)品的案例很多,直播、在線教育、IPTV都有它的用武之地。

下一篇:創(chuàng)建Web應(yīng)用的UI控件Kendo UI正式發(fā)布R2 2020 SP1
上一篇:報(bào)表服務(wù)器全新發(fā)布Telerik Report Server發(fā)布

                               

 京ICP備09015132號(hào)-996 | 違法和不良信息舉報(bào)電話:4006561155

                                   © Copyright 2000-2026 北京哲想軟件有限公司版權(quán)所有 | 地址:北京市海淀區(qū)西三環(huán)北路50號(hào)豪柏大廈C2座11層1105室

                         北京哲想軟件集團(tuán)旗下網(wǎng)站:哲想軟件 | 哲想動(dòng)畫

                            華滋生物