A
atie1978828
Unregistered / Unconfirmed
GUEST, unregistred user!
我有个问题帮帮我 调用api 的 AVISaveOptions 的压缩窗口,应该怎么写,我刚学的delphi,请帮帮我。
我的代码:
function TFormmain.OnAviStart: Integer;
var
retc : Integer;
StreamInfo : TAVIStreamInfo;
opts : PAVICOMPRESSOPTIONS;
begin
Result := -1;
if not bInit then
Exit;
AVIFileInit;
retc := AVIFileOpen(pfile, PChar(gMciVideoFileName), OF_WRITE or OF_CREATE OR OF_SHARE_EXCLUSIVE, nil);
if retc <>
AVIERR_OK then
begin
raise Exception.Create('创建avi文件失败');
AVIFileExit;
exit;
end;
FillChar(StreamInfo, sizeof(StreamInfo), 0);
StreamInfo.fccType := streamtypeVIDEO;
StreamInfo.fccHandler := 0;
StreamInfo.dwFlags := 0;
StreamInfo.dwSuggestedBufferSize := ImgBufLength;
//768 * 576 * 3;
StreamInfo.rcFrame.Right := INPUT_WINDOW_WIDTH;
//768;
StreamInfo.rcFrame.Bottom := INPUT_WINDOW_HEIGHT;
//576;
StreamInfo.dwScale := 1;
StreamInfo.dwRate := 25;
retc := AVIFileCreateStream(pFile, pStream, StreamInfo);
if retc <>
AVIERR_OK then
begin
raise Exception.Create('创建avi流失败');
AVIStreamRelease(pStream);
AVIFileRelease(pfile);
AVIFileExit;
exit;
end;
//???????????????????????????????????????????????????????
FillChar(opts, 0, sizeof(opts));
AVISaveOptions( );
这一段就不会写了 怎么写 请帮帮我
//???????????????????????????????????????????????????????
retc :=AVIStreamSetFormat(pStream, 0, pBMIInfo, sizeof(BITMAPINFOHEADER));
if retc <>
AVIERR_OK then
begin
raise Exception.Create('设置avi流格式失败');
AVIStreamRelease(pStream);
AVIFileExit;
exit;
end;
if bSnap then
AviStart:=true;
if not AviStart then
begin
AVIStreamRelease(pStream);
AVIFileRelease(pfile);
AVIFileExit;
end;
Result := 0;
end;
我的代码:
function TFormmain.OnAviStart: Integer;
var
retc : Integer;
StreamInfo : TAVIStreamInfo;
opts : PAVICOMPRESSOPTIONS;
begin
Result := -1;
if not bInit then
Exit;
AVIFileInit;
retc := AVIFileOpen(pfile, PChar(gMciVideoFileName), OF_WRITE or OF_CREATE OR OF_SHARE_EXCLUSIVE, nil);
if retc <>
AVIERR_OK then
begin
raise Exception.Create('创建avi文件失败');
AVIFileExit;
exit;
end;
FillChar(StreamInfo, sizeof(StreamInfo), 0);
StreamInfo.fccType := streamtypeVIDEO;
StreamInfo.fccHandler := 0;
StreamInfo.dwFlags := 0;
StreamInfo.dwSuggestedBufferSize := ImgBufLength;
//768 * 576 * 3;
StreamInfo.rcFrame.Right := INPUT_WINDOW_WIDTH;
//768;
StreamInfo.rcFrame.Bottom := INPUT_WINDOW_HEIGHT;
//576;
StreamInfo.dwScale := 1;
StreamInfo.dwRate := 25;
retc := AVIFileCreateStream(pFile, pStream, StreamInfo);
if retc <>
AVIERR_OK then
begin
raise Exception.Create('创建avi流失败');
AVIStreamRelease(pStream);
AVIFileRelease(pfile);
AVIFileExit;
exit;
end;
//???????????????????????????????????????????????????????
FillChar(opts, 0, sizeof(opts));
AVISaveOptions( );
这一段就不会写了 怎么写 请帮帮我
//???????????????????????????????????????????????????????
retc :=AVIStreamSetFormat(pStream, 0, pBMIInfo, sizeof(BITMAPINFOHEADER));
if retc <>
AVIERR_OK then
begin
raise Exception.Create('设置avi流格式失败');
AVIStreamRelease(pStream);
AVIFileExit;
exit;
end;
if bSnap then
AviStart:=true;
if not AviStart then
begin
AVIStreamRelease(pStream);
AVIFileRelease(pfile);
AVIFileExit;
end;
Result := 0;
end;