D
donny2000
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, WMEncoderLib_TLB, StdCtrls, ActiveX;
type
TForm1 = class(TForm)
Button1: TButton;
ComboBox1: TComboBox;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Encoder:WMEncoder;
SrcGrpColl:IWMEncSourceGroupCollection;
SrcGrp:IWMEncSourceGroup;
SrcVid,SrcAud:IWMEncSource;
EncodeFile:IWMEncFile;
ProColl:IWMEncProfileCollection;
// Pro :IWMEncProfile;
// i:integer;
begin
Encoder:=CoWMEncoder.Create;
SrcGrpColl:=Encoder.SourceGroupCollection;
SrcGrp:=SrcGrpColl.Add('SG_1');
SrcVid:=SrcGrp.AddSource(WMENC_VIDEO);
SrcAud:=SrcGrp.AddSource(WMENC_AUDIO);
SrcVid.SetInput('ScreenCap://ScreenCapture1','','');
SrcAud.SetInput('DEVICE://Default_Audio_Device',' ',' ');
EncodeFile:=Encoder.File_;
EncodeFile.LocalFileName:='C:/a.wmv';
ProColl:=Encoder.ProfileCollection;
{ for I:=1 to ProColl.Count-1do
begin
showmessage(ProColl.Item(i).Descrip);
end;
}
SrcGrp.Set_Profile(ProColl.item(ComboBox1.ItemIndex));
Encoder.PrepareToEncode(true);
Encoder.Start;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
Encoder:WMEncoder;
ProColl:IWMEncProfileCollection;
i:integer;
begin
Encoder:=CoWMEncoder.Create;
ProColl:=Encoder.ProfileCollection;
for I:=0 to ProColl.Count-1do
begin
ComboBox1.Items.Add(ProColl.Item(i).Name);
end;
ComboBox1.ItemIndex:=0;
end;
end.
使用的是9系列的SDK,程序编译通过,但是开始捕捉的时候,出错:“找不到可用于指定源的有效插件”。我搞了一天都没有明白什么原因
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, WMEncoderLib_TLB, StdCtrls, ActiveX;
type
TForm1 = class(TForm)
Button1: TButton;
ComboBox1: TComboBox;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Encoder:WMEncoder;
SrcGrpColl:IWMEncSourceGroupCollection;
SrcGrp:IWMEncSourceGroup;
SrcVid,SrcAud:IWMEncSource;
EncodeFile:IWMEncFile;
ProColl:IWMEncProfileCollection;
// Pro :IWMEncProfile;
// i:integer;
begin
Encoder:=CoWMEncoder.Create;
SrcGrpColl:=Encoder.SourceGroupCollection;
SrcGrp:=SrcGrpColl.Add('SG_1');
SrcVid:=SrcGrp.AddSource(WMENC_VIDEO);
SrcAud:=SrcGrp.AddSource(WMENC_AUDIO);
SrcVid.SetInput('ScreenCap://ScreenCapture1','','');
SrcAud.SetInput('DEVICE://Default_Audio_Device',' ',' ');
EncodeFile:=Encoder.File_;
EncodeFile.LocalFileName:='C:/a.wmv';
ProColl:=Encoder.ProfileCollection;
{ for I:=1 to ProColl.Count-1do
begin
showmessage(ProColl.Item(i).Descrip);
end;
}
SrcGrp.Set_Profile(ProColl.item(ComboBox1.ItemIndex));
Encoder.PrepareToEncode(true);
Encoder.Start;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
Encoder:WMEncoder;
ProColl:IWMEncProfileCollection;
i:integer;
begin
Encoder:=CoWMEncoder.Create;
ProColl:=Encoder.ProfileCollection;
for I:=0 to ProColl.Count-1do
begin
ComboBox1.Items.Add(ProColl.Item(i).Name);
end;
ComboBox1.ItemIndex:=0;
end;
end.
使用的是9系列的SDK,程序编译通过,但是开始捕捉的时候,出错:“找不到可用于指定源的有效插件”。我搞了一天都没有明白什么原因