DELPHI制作动态视频采集软件,可行吗?(100分)

  • 主题发起人 主题发起人 anshanchengang
  • 开始时间 开始时间
A

anshanchengang

Unregistered / Unconfirmed
GUEST, unregistred user!
我手里有视频采集卡及其提供的SDK和DEMO,但是VC版本的,我不会VC,我想将这个VC版本的“翻译”成DELPHI版本的,即:使用DELPHI做个视频采集软件,可行吗?难度在哪里?DELPHI做动态音视频程序难吗?性能怎么样?
 
建议你用vfw而不用sdk,在delphi下很容易实现
 
我也要做,呵呵,交流一下吧~
 
当然可以,只要提供相应的文档就可以了,
说白了也就是接口调用,动态连接库调用
不过确实很费脑子的
 
都有很多支持VFW和DirectX的控件,拿来用就好了

给你一个参考的 http://new.playicq.com/dispdocnew.php?id=4218

不够的话,再给你一段代码

procedure TPos_MainFrm.CAPStatus(Sender: TObject);
begin

Panel6.Color := clBtnFace;
Panel6.Refresh;
end;


procedure TPos_MainFrm.PlayVideo;
var
MyCapStatusProc : TCapStatusProc;
begin


// 开始捕捉视频
CapSetVideoArea( VideoArea );
CapSetInfoLabel( lblVideoInfo);
MyCapStatusProc := CAPStatus;
CapSetStatusProcedure( MyCapStatusProc );
if CapOpenDriver then

begin

CapSetCapSec( 15 * 3 );
CapShow;

end;

end;


procedure TPos_MainFrm.CaptureVideo;
begin

Panel6.Color := clRed;
Panel6.Refresh;
CapSetCapSec( StrToInt(ReadReg('CapTime'))*15);
CapStart;
end;


procedure TPos_MainFrm.StopVideo;
begin

CapStop;
Panel6.Color := clBtnFace;
Panel6.Refresh;
end;


procedure TPos_MainFrm.SaveVideoPicture;
var
SingleImageFIleName:string;

picName:string;
// Mybmp:Tbitmap;
// MyJpg:TJpegImage;
begin


PicName:=FCurrentNO_CUR+'.bmp';
SingleImageFileName :=picSavePath+PicName;

CapSetSingleImageFileName( SingleImageFileName );
CapGrabSingleFrame;
CapSetVideoLive;

// Mybmp:=Tbitmap.Create;
// MyJpg:=TJpegImage.Create;

// Mybmp.LoadFromFile(SingleImageFileName);
// MyJpg.Assign(Mybmp);
// MyJpg.Performance:=JpBestSpeed;

// MyJpg.CompressionQuality:=10;
// MyJpg.Compress;

// MyJpg.SaveToFile(currentNO_Cur+'.jpg');

// MyJpg.Free;
// Mybmp.Free;

TransPictrue(SingleImageFileName);
end;


procedure TPos_MainFrm.TransPictrue(PictureName:string);
var
//S, S1: string;
MyBmp: TBitmap;
Myjpg: TJpegimage;


begin

{ try
MyStream := TMemorystream.Create;
//建立内存流
MyBmp := TBitmap.Create;
Myjpg := TJpegimage.Create;
MyBmp.LoadFromFile(pictrueName);
Myjpg.Assign(MyBmp);
//将BMP图象转成JPG格式
MyJpg.Performance:=JPBestSpeed;
Myjpg.CompressionQuality := 10;
//JPG文件压缩百分比设置,数字越大图像越清晰,但数据也越大
Myjpg.SaveToStream(MyStream);
//将JPG图象写入流中
Myjpg.free;
MyStream.Position := 0;
s1 :=inttostr(MyStream.size);
//流的大小
Socket1.Socket.SendText(s1);
//发送流大小
finally
MyBmp.free;
end;


MyStream.Position := 0;
Socket1.Socket.SendStream(MyStream);//将流发送出去
}
try
MyBmp:=Tbitmap.Create;
Mybmp.LoadFromFile(PictureName);

Myjpg:=TJpegImage.Create;
With MyJpgdo

begin

Assign(Mybmp);
//Performance:=JPBestSpeed;
CompressionQuality :=50;
Compress;
SaveTofile(PicSavePath+'/'+FCurrentNO_Cur+'.jpg');
DeleteFile(pictureName);
end;

finally
Mybmp.Free;
Myjpg.Free;
end;


if conn then

CopyFile(Pchar(SourcePath +FCurrentNo_CUR+'.jpg'),Pchar(DestPath+FCurrentNO_Cur+'.jpg'),false)
else

begin

{如果图片没有传送成功,那么在本地存放图片的目录下建立一个文件夹
来存放未传送成功的图片}
if Not DirectoryExists(SourcePath+'未传送图片') then

CreateDir(sourcePath+'未传送图片');
CopyFile(Pchar(SourcePath +FCurrentNo_CUR+'.jpg'),Pchar(SourcePath+'未传送图片/'+FCurrentNO_Cur+'.jpg'),false);

end;

end;

 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部