Media ENCODER 开发例子

?
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<OBJECT id=MSPropShell1 style="LEFT: 0px; WIDTH: 540px; TOP: 0px; HEIGHT: 306px"
 data=data:application/x-oleobject;base64,XquX4rBAvUGeBuQUQITuXwADAADQNwAAoB8AAAsA//8DAAEAAAALAAAAAgAAAA==
 classid=clsid:E297AB5E-40B0-41BD-9E06-E4144084EE5F name=PropPageShell VIEWASTEXT></OBJECT>
<script language=vbscript>
 dim encoder
 dim srcgrpcoll
 dim srcgrp
 dim audsrc
 dim vidsrc
 dim file
 dim procoll
 dim i
 dim abc
 Dim CHX
 Dim Statistics
 Set CHX = CreateObject("WMEnc.WMEncMonMainPage")
 Set encoder = CreateObject("WMEncEng.WMEncoder")
 Set srcgrpcoll = encoder.SourceGroupCollection
 Set srcgrp = srcgrpcoll.Add("SG_2")
 Set audsrc = srcgrp.AddSource(1)
 Set vidsrc = srcgrp.AddSource(2)
 Set file = encoder.file
 Set procoll = encoder.ProfileCollection
 PropPageShell.AddObject encoder
 PropPageShell.AddPage CHX
 Dim OutputStats
 
 'For i = 0 To procoll.Count - 1
 ' document.writeln "<INPUT type=checkbox id=checkbox1 name=checkbox1 value="
 ' document.writeln i&">"
 ' document.writeln procoll.Item(i).Name&"<br>"
 'Next
 i=0
 sub encode()
  file.localfilename=file2.value
  audsrc.setinput file1.value
  vidsrc.setinput file1.value
  srcgrp.profile=procoll.item(24)
  encoder.EnableAutoArchive =true
  encoder.PrepareToEncode true
  'document.wow.wmlength.value =
  encoder.Start
  i=1
  aa()
 end sub
 sub aa()
  Set Statistics = Encoder.Statistics
  Set OutputStats = Statistics.StreamOutputStats(2,0,3)
  document.wow.AverageBitrate.value=OutputStats.AverageBitrate
  document.wow.AverageSampleRate.value=OutputStats.AverageSampleRate
  document.wow.ByteCount.value=OutputStats.ByteCount
  document.wow.CurrentBitrate.value=OutputStats.CurrentBitrate
  document.wow.CurrentSampleRate.value=OutputStats.CurrentSampleRate
  document.wow.DroppedByteCount.value=OutputStats.DroppedByteCount
  document.wow.DroppedSampleCount.value=OutputStats.DroppedSampleCount
  document.wow.ExpectedBitrate.value=OutputStats.ExpectedBitrate
  document.wow.ExpectedSampleRate.value=OutputStats.ExpectedSampleRate
  document.wow.SampleCount.value=OutputStats.SampleCount
  document.wow.EncodingTime.value=cCUR(statistics.EncodingTime)
  document.wow.FileDuration.value =Statistics.FileArchiveStats.FileDuration
  document.wow.Filesize.value =Statistics.FileArchiveStats.Filesize
  if encoder.RunState=2 then
   i=i+1
   s=""
   str="▊"
   x=i mod 55
   for  j=1 to x
    s=s+str
   next
   document.wow.display.value=s
   timeID=settimeout("aa()",200,vbscript)
  else 
   document.wow.display.value="完成"
   exit sub
  end if
 end sub
 </script>
<P>

</P>
源文件:&nbsp;&nbsp;<INPUT type="file" id=file1 name=file1><br>
目标文件:<INPUT type="file" id=file2 name=file2><br>
<INPUT type="button" value="转换" id=button1 name=button1 οnclick="encode()">
<FORM NAME="wow">
进度:display<font  color=mediumblue>
<INPUT NAME="display" SIZE="100" STYLE="COLOR:  #006699"><br>
 AverageBitrate<font  color=mediumblue>
<INPUT NAME="AverageBitrate" SIZE="10" STYLE="COLOR:  #006699"><br>
 AverageSampleRate<font  color=mediumblue>
<INPUT NAME="AverageSampleRate" SIZE="10" STYLE="COLOR:  #006699"><br>
 ByteCount<font  color=mediumblue>
<INPUT NAME="ByteCount" SIZE="10" STYLE="COLOR:  #006699"><br>
 CurrentBitrate<font  color=mediumblue>
<INPUT NAME="CurrentBitrate" SIZE="10" STYLE="COLOR:  #006699"><br>
 CurrentSampleRate<font  color=mediumblue>
<INPUT NAME="CurrentSampleRate" SIZE="10" STYLE="COLOR:  #006699"><br>
DroppedByteCount <font  color=mediumblue>
<INPUT NAME="DroppedByteCount" SIZE="10" STYLE="COLOR:  #006699"><br>
 DroppedSampleCount<font  color=mediumblue>
<INPUT NAME="DroppedSampleCount" SIZE="10" STYLE="COLOR:  #006699"><br>
 ExpectedBitrate<font  color=mediumblue>
<INPUT NAME="ExpectedBitrate" SIZE="10" STYLE="COLOR:  #006699"><br>
 ExpectedSampleRate<font  color=mediumblue>
<INPUT NAME="ExpectedSampleRate" SIZE="10" STYLE="COLOR:  #006699"><br>
 SampleCount<font  color=mediumblue>
<INPUT NAME="SampleCount" SIZE="10" STYLE="COLOR:  #006699"><br>
EncodingTime<font  color=mediumblue>
<INPUT NAME="EncodingTime" SIZE="10" STYLE="COLOR:  #006699"><br>
FileDuration <font  color=mediumblue>
<INPUT NAME="FileDuration" SIZE="10" STYLE="COLOR:  #006699"><br>
FileSize <font  color=mediumblue>
<INPUT NAME="FileSize" SIZE="10" STYLE="COLOR:  #006699"><br>
</font>
</FORM></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT></FONT>
</BODY>
</HTML>

  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值