没有你说的那么严重,我只是希望大家切入正题,不要把网站搞臭了!
下面是我写的转换代码,望高手指点迷津。
procedure TForm1.Button1Click(Sender: TObject);
var
Encoder:IWMEncoder;
SrcGrpColl:IWMEncSourceGroupCollection;
SrcGrp:IWMEncSourceGroup;
SrcVid:IWMEncSource;
SrcAud:IWMEncSource;
ProColl:IWMEncProfileCollection;
Pro :IWMEncProfile;
i,Llength:integer;
Descr:IWMEncDisplayInfo;
Attr:IWMEncAttributes;
File1:IWMEncFile;
FileName:widestring;
begin
Encoder:=CoWMEncoder.Create;
SrcGrpColl:=Encoder.SourceGroupCollection
SrcGrp:=SrcGrpColl.add('LgggG_1');
SrcVid := SrcGrp.AddSource(WMENC_VIDEO);
SrcAud := SrcGrp.AddSource(WMENC_AUDIO);
SrcVid.SetInput('file://c:/lake.mpg',' ',' ');
SrcAud.SetInput ('file://c:/lake.mpg',' ',' ');
ProColl:=Encoder.ProfileCollection
SrcGrp.Set_Profile(ProColl.item(2));
{Llength:=ProColl.Count
for i:=0 to Llength-1do
begin
pro:=ProColl.Item(i);
If Pro.Name = 'Windows Media Video 8 for Local Area Network (384 Kbps)' then
SrcGrp.Set_Profile(Pro);
end;
}
Descr := Encoder.DisplayInfo;
Descr.Author := 'Author name';
Descr.Copyright := 'Copyright information';
Descr.Description := 'Text description of encoded content'
Descr.Rating := 'ating information'
Descr.Title := 'Title of encoded content';
Attr := Encoder.Attributes;
Attr.Add('URL', 'IP address');
File1 := Encoder.Get_File_
File1.LocalFileName := 'C:/myOutputFile.wmv';
//SrcGrp.PrepareToEncode(true);
Encoder.PrepareToEncode(true);
Encoder.Start
showmessage('encode complete!');
Encoder.Stop;
end;