<%@ Language=VBScript CODEPAGE=65001 %> Encoder Statistics Refresh <% if Request.Form("lstRunning")<>"" then%> <% dim SchemeAud dim SchemeVid dim StrIn1Aud dim StrIn2Aud dim StrIn1Vid dim StrIn2Vid dim SlctEnc dim AgentLoc dim EncAgent dim Enc dim Stat dim cntStream dim ElapTime dim OutStat dim FrameRate dim FramesDrp dim Str dim j dim State dim Pos dim SrcGrpCol dim SrcGrp dim PrfCol dim Prf dim PrfName dim SrcGrpColNew dim SrcGrpNew dim PrfColN dim PrfN dim Fail dim SrcGrpName dim DisplayText dim sMute dim SrcCnt dim Aud dim Vid dim ArchFile dim Path dim ArchStatus dim ArchFileStat dim ArchPath dim Brdcst dim Prt dim ErrorNum dim ErrorDesc on Error Resume Next StrIn1Aud="" StrIn2aud="" StrIn1Vid="" StrIn2Vid="" ErrorNum=0 ErrorDesc="" SlctEnc=Request.Form("lstRunning") MchName=Session("MchNameSess") set AgentLoc=Session("AgentLocSess") if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if set EncAgent=AgentLoc.GetAgent(MchName) if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if set Enc=EncAgent.GetEncoder(SlctEnc) if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if set DisInfo=Enc.DisplayInfo if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if set Stat=Enc.Statistics if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if set SrcGrpCol=Enc.SourceGroupCollection if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if SrcGrpCol.Count > 0 then set SrcGrp=SrcGrpCol.Active SrcCnt=SrcGrp.SourceCount(2) if SrcCnt>=1 then cntStream=stat.StreamOutputCount(2, 0) else cntStream=0 end if else cntStream=0 end if if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if Title=DisInfo.Title if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if Title="" then Title="-" end if Author=DisInfo.Author if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if Author="" then Author="-" end if Copyright=DisInfo.Copyright if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if Copyright="" then Copyright="-" end if Description=DisInfo.Description if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if Description="" then Description="" end if Rating=DisInfo.Rating if Rating="" then Rating="-" end if if Request.Form("Comm")=9 then SrcGrpName=Request.Form("tSrcGrp") set SrcGrpColNew=Enc.SourceGroupCollection if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if for Each SrcGrpNew in SrcGrpColNew if SrcGrpNew.Name=SrcGrpName then SrcGrpColNew.Active=SrcGrpNew exit for end if next end if if Enc.Runstate <> 5 then Set Brdcst = Enc.Broadcast Prt=Brdcst.PortNumber(1) if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if Prt<>0 and Prt<>"" then set NetStat=Stat.NetConnectionStats Connection=NetStat.ClientCount if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if end if if Request.Form("Comm")=2 then Enc.Stop if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if State="Encoder Stopped" %> <%else State="Encoder Running"%> <%end if else if Request.Form("Comm")=1 then PrfName=Request.Form("sProfile") SrcGrpName=Request.Form("tSrcGrp") set SrcGrpColNew=Enc.SourceGroupCollection if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if SrcGrpColNew.Count >= 1 then Fail=0 set PrfColNew=Enc.ProfileCollection if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if for Each SrcGrpNew in SrcGrpColNew if SrcGrpNew.Name=SrcGrpName then SrcGrpColNew.Active=SrcGrpNew exit for end if next if SrcGrpColNew.Count >= 1 then for each PrfNew in PrfColNew if UCase(PrfName)=UCase(PrfNew.name) then for each SrcGrpNew in SrcGrpColNew SrcGrpNew.Profile=PrfNew next if Err.number <> 0 then Fail=1 Err.Clear end if exit for end if next end if else Fail=1 end if If Fail<>1 then Enc.Start State="Encoder Running"%> <%else State="Encoder Stopped"%> <%end if else State="Encoder Stopped" %> <%end if end if set Stat=Enc.Statistics if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if set SrcGrpCol=Enc.SourceGroupCollection if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if SrcGrpCol.Count > 0 then set SrcGrp=SrcGrpCol.Active SrcCnt=SrcGrp.SourceCount(2) if SrcCnt>=1 then set Aud=SrcGrp.Source(1, 0) set Vid=SrcGrp.Source(2, 0) if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if SchemeAud=Aud.GetInput(CStr(StrIn1Aud),CStr(StrIn2Aud)) SchemeVid=Vid.GetInput(Cstr(StrIn1Vid),Cstr(StrIn2Vid)) Pos=InstrRev(SchemeAud,"\") SchemeAud=mid(SchemeAud,Pos+1) Pos=InstrRev(SchemeVid,"\") SchemeVid=mid(SchemeVid,Pos+1) else set Aud=SrcGrp.Source(1, 0) SchemeAud=Aud.GetInput(CStr(StrIn1Aud),CStr(StrIn2Aud)) Pos=InstrRev(SchemeAud,"\") SchemeAud=mid(SchemeAud,Pos+1) SchemeVid="-" end if else SchemeAud="-" SchemeVid="-" end if ElapTime=stat.EncodingTime if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if ElapTime<>"" then ElapTime=ElapTime*10000 ElapTime=ElapTime\1000 if ElapTime>=60 then Min=ElapTime\60 Sec=ElapTime mod 60 if Min >=60 then Hr=Min\60 Min=Min mod 60 ElapTime=Hr& "hours " & Min & "Mins" & Sec & "Secs" else ElapTime=Min & "Mins " & Sec & "Secs" end if else ElapTime=ElapTime & "Secs" end if else ElapTime="0 Secs" end if set OutStat=stat.WMFOutputStats FrameRate=0 if SrcCnt>=1 then FrameRate=OutStat.AverageSampleRate FrameRate=FrameRate\1000 end if AvgBitrate=OutStat.AverageBitrate AvgBitrate=AvgBitrate/1000 AvgBitrate=AvgBitrate & "kbps" ExpBitrate=OutStat.ExpectedBitrate ExpBitrate=ExpBitrate/1000 ExpBitrate=ExpBitrate & "kbps" Bandwidth=AvgBitrate & "[" & ExpBitrate & "]" FramesDrp=OutStat.DroppedSampleCount if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if Request.Form("Comm")=3 then if Enc.RecordingMute(0) = True then Enc.RecordingMute(0) = False sMute="Mute Off" else Enc.RecordingMute(0) = True sMute="Mute On" end if if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if Enc.RecordingMute(0)=true then sMute="Mute On" else sMute="Mute Off" end if%> <%end if If Request.Form("Comm")=4 then Enc.Archive 1,1 if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if ArchStatus="Archiving On" end if If Request.Form("Comm")=5 then Enc.Archive 1,2 if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if ArchStatus="Archiving Stopped" end if If Request.Form("Comm")=6 then Enc.Archive 1,3 if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if ArchStatus="Archiving Paused" end if set ArchFileStat=Enc.File ArchPath=ArchFileStat.LocalFileName ArchPath=Cstr(ArchPath) if ArchPath<>"" then%> <%if Enc.RunState=2 and Enc.ArchiveState(1)=1 then ArchStatus="Archiving On"%> <%end if if Enc.RunState=2 and Enc.ArchiveState(1)=2 then ArchStatus="Archiving Paused"%> <%end if if Enc.RunState=2 and Enc.ArchiveState(1)=3 then ArchStatus="Archiving Stopped"%> <%end if if Enc.RunState=5 and Enc.ArchiveState(1)=3 then ArchStatus="Archiving Stopped"%> <%end if else ArchStatus="Archiving Stopped"%> <%end if if Enc.EnableAutoArchive=false then ArchMode="Manual" else ArchMode="Auto" end if if Request.Form("Comm")=8 then if Enc.EnableAutoArchive=false then Enc.EnableAutoArchive=true ArchMode="Auto" else Enc.EnableAutoArchive=false ArchMode="Manual" end if if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if end if if Request.Form("Comm")=7 then set ArchFile=Enc.File if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if Path=Request.Form("tPath") ArchFile.LocalFileName=Path ArchPath=ArchFile.LocalFileName ArchPath=Cstr(ArchPath) end if Set Brdcst = Enc.Broadcast Prt=Brdcst.PortNumber(1) if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if%> <%if Request.Form("Comm")=0 then if SrcGrpCol.Count > 0 then%> <% for j=0 to cntStream-1 DisplayText="Stream " & j%> <%next set SrcGrpCol=Enc.SourceGroupCollection if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if if SrcGrpCol.Count > 0 then set SrcGrp=SrcGrpCol.Active SrcCnt=SrcGrp.SourceCount(2) if Enc.Runstate <> 5 then if SrcCnt >= 1 then set StreamStat=Stat.StreamOutputStats(2,0,0) AvgBitrate=StreamStat.AverageBitrate AvgBitrate=AvgBitrate/1000 AvgBitrate=AvgBitrate & "kbps" ExpBitrate=StreamStat.ExpectedBitrate ExpBitrate=ExpBitrate/1000 ExpBitrate=ExpBitrate & "kbps" StreamBandwidthVid=AvgBitrate & "[" & ExpBitrate & "]" StreamFrameRateVid=StreamStat.AverageSampleRate StreamFrameRateVid=StreamFrameRateVid/1000 set StreamStat=Stat.StreamOutputStats(1,0,0) AvgBitrate=StreamStat.AverageBitrate AvgBitrate=AvgBitrate/1000 AvgBitrate=AvgBitrate & "kbps" ExpBitrate=StreamStat.ExpectedBitrate ExpBitrate=ExpBitrate/1000 ExpBitrate=ExpBitrate & "kbps" StreamBandwidthAud=AvgBitrate & "[" & ExpBitrate & "]" StreamFrameRateAud=StreamStat.AverageSampleRate StreamFrameRateAud=StreamFrameRateAud/1000 else StreamBandwidthVid="-" StreamFrameRateVid="-" set StreamStat=Stat.StreamOutputStats(1,0,0) AvgBitrate=StreamStat.AverageBitrate AvgBitrate=AvgBitrate/1000 AvgBitrate=AvgBitrate & "kbps" ExpBitrate=StreamStat.ExpectedBitrate ExpBitrate=ExpBitrate/1000 ExpBitrate=ExpBitrate & "kbps" StreamBandwidthAud=AvgBitrate & "[" & ExpBitrate & "]" StreamFrameRateAud=StreamStat.AverageSampleRate StreamFrameRateAud=StreamFrameRateAud/1000 end if else StreamBandwidthVid="-" StreamFrameRateVid="-" StreamBandwidthAud="-" StreamFrameRateAud="-" end if end if if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if%> <%Cnt=SrcGrpCol.Count for Grp=0 to Cnt-1 set SrcGrp1=SrcGrpCol.Item(Grp) if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if If SrcGrp1.Name=SrcGrpCol.Active.Name then set Prf=SrcGrp1.Profile SrcCnt1=SrcGrp1.SourceCount(2) if SrcCnt1 >= 1 then set Aud1=SrcGrp1.Source(1, 0) set Vid1=SrcGrp1.Source(2, 0) SchemeAud1=Aud1.GetInput(Cstr(StrIn1Aud),Cstr(StrIn2Aud)) SchemeVid1=Vid1.GetInput(Cstr(StrIn1Vid),Cstr(StrIn2Vid)) Pos=InstrRev(SchemeAud1,"\") SchemeAud1=mid(SchemeAud1,Pos+1) Pos=InstrRev(SchemeVid1,"\") SchemeVid1=mid(SchemeVid1,Pos+1) SchemeVid=SchemeVid1 SchemeAud=SchemeAud1 else set Aud1=SrcGrp1.Source(1, 0) SchemeAud1=Aud1.GetInput(Cstr(StrIn1Aud),Cstr(StrIn2Aud)) Pos=InstrRev(SchemeAud1,"\") SchemeAud1=mid(SchemeAud1,Pos+1) SchemeVid1="-" SchemeVid=SchemeVid1 SchemeAud=SchemeAud1 end if %> <%else%> <%end if next else%> <%end if end if if Request.Form("Comm")=10 then sStreamVal=Request.Form("sStream") StreamPos=instrrev(sStreamVal,"m") StreamNum=mid(sStreamVal,CInt(StreamPos)+3) set SrcGrpCol=Enc.SourceGroupCollection if SrcGrpCol.Count > 0 then set SrcGrp=SrcGrpCol.Active SrcCnt=SrcGrp.SourceCount(2) if Enc.Runstate <> 5 then if SrcCnt >= 1 then set StreamStat=Stat.StreamOutputStats(2,0,CInt(StreamNum)) if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if AvgBitrate=StreamStat.AverageBitrate AvgBitrate=AvgBitrate/1000 AvgBitrate=AvgBitrate & "kbps" ExpBitrate=StreamStat.ExpectedBitrate ExpBitrate=ExpBitrate/1000 ExpBitrate=ExpBitrate & "kbps" StreamBandwidthVid=AvgBitrate & "[" & ExpBitrate & "]" StreamFrameRateVid=StreamStat.AverageSampleRate StreamFrameRateVid=StreamFrameRateVid/1000 set StreamStat=Stat.StreamOutputStats(1,0,0) AvgBitrate=StreamStat.AverageBitrate AvgBitrate=AvgBitrate/1000 AvgBitrate=AvgBitrate & "kbps" ExpBitrate=StreamStat.ExpectedBitrate ExpBitrate=ExpBitrate/1000 ExpBitrate=ExpBitrate & "kbps" StreamBandwidthAud=AvgBitrate & "[" & ExpBitrate & "]" StreamFrameRateAud=StreamStat.AverageSampleRate StreamFrameRateAud=StreamFrameRateAud/1000 else StreamBandwidthVid="-" StreamFrameRateVid="-" set StreamStat=Stat.StreamOutputStats(1,0,0) AvgBitrate=StreamStat.AverageBitrate AvgBitrate=AvgBitrate/1000 AvgBitrate=AvgBitrate & "kbps" ExpBitrate=StreamStat.ExpectedBitrate ExpBitrate=ExpBitrate/1000 ExpBitrate=ExpBitrate & "kbps" StreamBandwidthAud=AvgBitrate & "[" & ExpBitrate & "]" StreamFrameRateAud=StreamStat.AverageSampleRate StreamFrameRateAud=StreamFrameRateAud/1000 end if else StreamBandwidthVid="-" StreamFrameRateVid="-" StreamBandwidthAud="-" StreamFrameRateAud="-" end if end if if Err.number <> 0 then ErrorNum=1 ErrorDesc=Err.description Err.Clear end if%> <%end if%> <%end if%>