自动码流转换(ROBOT)
'$include "sqautil.sbh"
Sub Main
Dim Result As Integer
'Initially Recorded: 2007-1-10 15:09:53
'Script Name: vod_autoadd
dim i as integer
'数据池
dim dp as Variant
'文件长度
dim file_name as string
dim num_file as integer
dim le_file as string
'视频
dim vod as string
dim vod_if as string
'音频
dim auo as string
dim auo_if as string
'码率
dim run as string
dim run_string as string
dim run_if as string
dp=SQADatapoolOpen("ttytt1")
'打开数据池,jsp为数据池的名称,这个数据池是预先按照上述规范做好的
for i=1 to 10
Call SQADatapoolFetch(dp)
'+从数据池中读取记录
Call SQADatapoolValue(dp,1,file_name)
'取文件名长度
num_file=len(file_name)
'截取文件(去除前五位字符)
le_file=right(file_name,num_file-5)
'在截取文件的基础上,取前4位数
vod_if=left(le_file,4)
'用截取的字符串比较视频格式字符,并相应赋值
if vod_if<>"h261" then
else
vod="Text=H.261"
end if
if vod_if<>"h263" then
else
vod="Text=H.263"
end if
if vod_if<>"h264" then
else
vod="Text=H.263"
end if
if vod_if<>"mp2_" then
else
vod="Text=MPEG-2"
end if
if vod_if<>"mp4_" then
else
vod="Text=MPEG-4"
end if
''进行码率的取值
'进行截取尾端的两个字符串
run_if=mid(file_name,num_file-1,2)
'进行码率的判断
If run_if<>"68" Then
'如果不等于68,则判断不是三位数,取最后的四位数为当前码率
run=mid(file_name,num_file-3,4)
run_string="Text="+run
'28
'截取字符串,从尾端的第8位开始截取4位字符串----取音频变量
auo_if=mid(file_name,num_file-8,4)
if auo_if<>"g728" then
else
auo="Text=G.728"
end if
if auo_if<>"7231" then
else
auo="Text=G.7231"
end if
if auo_if<>"_mp3" then
else
auo="Text=MP-3"
end if
if auo_if<>"alaw" then
else
auo="Text=G.711 ALAW"
end if
if auo_if<>"ulaw" then
else
auo="Text=G.711 ULAW"
end if
if auo_if<>"g729" then
else
auo="Text=G.729"
end if
else
run=mid(file_name,num_file-2,3)
run_string="Text="+run
'29
'截取字符串,从尾端的第7位开始截取消2位字符串
auo_if=mid(file_name,num_file-7,4)
'pas=29
if auo_if<>"g728" then
else
auo="Text=G.728"
end if
if auo_if<>"7231" then
else
auo="Text=G.7231"
end if
if auo_if<>"_mp3" then
else
auo="Text=MP-3"
end if
if auo_if<>"alaw" then
else
auo="Text=G.711 ALAW"
end if
if auo_if<>"ulaw" then
else
auo="Text=G.711 ULAW"
end if
if auo_if<>"g729" then
else
auo="Text=G.729"
end if
end if
'进行音频的取值
Window SetContext, "Caption=视频点播系统 - Microsoft Internet Explorer", ""
GenericObject Click, "Class=AfxWnd;ClassIndex=2", "Coords=41,210"
PushButton Click, "Text= 添 加"
PopupMenuIDSelect 1125
Window SetContext, "Caption=Vcd transform", ""
PushButton Click, "ObjectIndex=4"
Window SetContext, "Caption=另存为", ""
EditBox Left_Drag, "Label=文件名(N):", "Coords=6,5,-30,5"
InputKeys file_name
PushButton Click, "Text=保存(S)"
Window SetContext, "Caption=Vcd transform", ""
ComboBox Click, "ObjectIndex=3", "Coords=82,7"
ComboListBox Click, "ObjectIndex=3", vod
ComboBox Click, "ObjectIndex=4", "Coords=82,11"
ComboListBox Click, "ObjectIndex=4", auo
ComboBox Click, "ObjectIndex=1", "Coords=61,8"
ComboListBox VScrollTo, "ObjectIndex=1", "Position=5"
ComboListBox Click, "ObjectIndex=1", run_string
PushButton Click, "Text=确 定"
Window SetContext, "Caption=视频点播系统 - Microsoft Internet Explorer", ""
PushButton Click, "Text=开始"
PushButton Click, "Text=停止"
PushButton Click, "ObjectIndex=48"
'延时八分钟
delayfor 5000
next i
End Sub