如何默认DSPACK的分辨率

zqdue 2009-05-14 03:09:32
ShowPinPropertyPage(Self.Handle, PinList.Items[1]); //修改分辩率
我通过上面这一句,就可以弹出一个预览设置属性窗口,就可以设出720*576分辨率了!
但每次都要设。。。。很麻烦!请教一下,如何设它的默认值啊!
谢谢
...全文
857 47 打赏 收藏 转发到动态 举报
写回复
用AI写文章
47 条回复
切换为时间正序
请发表友善的回复…
发表回复
NTSCPAL 2010-04-20
  • 打赏
  • 举报
回复
[Quote=引用 39 楼 zqdue 的回复:]
哈哈!可以啦!终于可以啦!
在yktd26的提示下,我修改了一下19楼的代码!现在终于可以现实天敏这卡默认分辨率了!
谢谢!非常感谢啊!
结贴去!
[/Quote]

咋改的?我怎么还是不能ShowPinPropertyPage(Self.Handle, PinList.Items[1])设置的分辨率默认下来啊?每次重新运程序又回去了。
似乎是SetVideoParams函数没起作用。
chensholly 2010-03-18
  • 打赏
  • 举报
回复
显示不出来。
taddone 2009-09-23
  • 打赏
  • 举报
回复
请问大家:
我想修改MPEG Layer-3 Decoder 这个Filter 的属性的FreQuency值=Quarter
代码怎么实现呢?
taddone 2009-09-23
  • 打赏
  • 举报
回复
procedure TForm1.FormCreate(Sender: TObject);
var SysDev: TSysDevEnum;
VideoStreamConfig : IAMStreamConfig;
AMMEdiaType :PAMMediaType;
begin
SysDev:= TSysDevEnum.Create(CLSID_VideoInputDeviceCategory);
FilterGraph1.ClearGraph;
FilterGraph1.Active := False;
Filter1.BaseFilter.Moniker := SysDev.GetMoniker(SysDev.CountFilters-1);
FilterGraph1.Active := true;
with FilterGraph1 as ICaptureGraphBuilder2 do //这个地方我运行的时候会报错 请帮我看看 begin
FindInterface(@PIN_CATEGORY_PREVIEW, nil, Filter1 as IBaseFilter, IID_IAMStreamConfig, VideoStreamConfig);
VideoStreamConfig.GetFormat(AMMEdiaType);
PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biWidth:= 768;
PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biHeight:= 576;
AMMEdiaType.SubType :=MEDIASUBTYPE_RGB24;
PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biSizeImage:=Round(768*576*PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biPlanes*PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biBitCount/8);
AMMEdiaType.lSampleSize:=PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biSizeImage;
VideoStreamConfig.SetFormat(AMMEdiaType^);
DeleteMediaType(AMMEdiaType);
RenderStream(@PIN_CATEGORY_PREVIEW, nil, Filter1 as IBaseFilter, SampleGrabber1 as IBaseFilter, VideoWindow1 as IbaseFilter);
end;
FilterGraph1.Play;
end;
taddone 2009-09-23
  • 打赏
  • 举报
回复
procedure TForm1.FormCreate(Sender: TObject);
var SysDev: TSysDevEnum;
VideoStreamConfig : IAMStreamConfig;
AMMEdiaType :PAMMediaType;
begin
SysDev:= TSysDevEnum.Create(CLSID_VideoInputDeviceCategory);
FilterGraph1.ClearGraph;
FilterGraph1.Active := False;
Filter1.BaseFilter.Moniker := SysDev.GetMoniker(SysDev.CountFilters-1);
FilterGraph1.Active := true;
with FilterGraph1 as ICaptureGraphBuilder2 do //这个地方我运行的时候会报错 请帮我看看
begin
FindInterface(@PIN_CATEGORY_PREVIEW, nil, Filter1 as IBaseFilter, IID_IAMStreamConfig, VideoStreamConfig);
VideoStreamConfig.GetFormat(AMMEdiaType);
PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biWidth:= 768;
PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biHeight:= 576;
AMMEdiaType.SubType :=MEDIASUBTYPE_RGB24;
PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biSizeImage:=Round(768*576*PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biPlanes*PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biBitCount/8);
AMMEdiaType.lSampleSize:=PVideoInfoHeader(AMMEdiaType.pbFormat)^.bmiHeader.biSizeImage;
VideoStreamConfig.SetFormat(AMMEdiaType^);
DeleteMediaType(AMMEdiaType);
RenderStream(@PIN_CATEGORY_PREVIEW, nil, Filter1 as IBaseFilter, SampleGrabber1 as IBaseFilter, VideoWindow1 as IbaseFilter);
end;
FilterGraph1.Play;
end;
zjy__1028 2009-09-23
  • 打赏
  • 举报
回复
看看
zjy__1028 2009-09-22
  • 打赏
  • 举报
回复
又要回复一次
zjy__1028 2009-09-22
  • 打赏
  • 举报
回复
看看,我正在找这个问题
zqdue 2009-06-17
  • 打赏
  • 举报
回复
哈哈!可以啦!终于可以啦!
在yktd26的提示下,我修改了一下19楼的代码!现在终于可以现实天敏这卡默认分辨率了!
谢谢!非常感谢啊!
结贴去!
zqdue 2009-06-17
  • 打赏
  • 举报
回复
非常感谢楼上的回复!
但可惜的是,运行你代码会报错!
yktd26 2009-06-16
  • 打赏
  • 举报
回复
怎么不能修改回复,晕,还是那个问题把PIN_CATEGORY_CAPTURE改成PIN_CATEGORY_PREVIEW
yktd26 2009-06-16
  • 打赏
  • 举报
回复
g_pCapture.FindPin(aSrcFilter.BaseFilter, PINDIR_OUTPUT, @PIN_CATEGORY_CAPTURE, @MEDIATYPE_Video, true, 0, pPinOut);
pPinOut.QueryInterface(IID_IAMStreamConfig,pStreamConfig);
GetMem(pSrcType,SizeOf(TAMMediaType));
if pStreamConfig.GetFormat(pSrcType)=S_OK then begin
pSrcType.majortype:=MEDIATYPE_Video;
pSrcType.subtype:=MEDIASUBTYPE_UYVY;
pSrcType.formattype:=FORMAT_VideoInfo;
pSrcType.bFixedSizeSamples:=true;
pSrctype.bTemporalCompression:=false;
pSrcType.lSampleSize:=MyProfile.ImageWidth*MyProfile.ImageHeight*3;
PVideoInfoHeader(pSrcType.pbFormat).rcSource:=Rect(0,0,MyProfile.ImageWidth,MyProfile.ImageHeight);
PVideoInfoHeader(pSrcType.pbFormat).rcTarget:=Rect(0,0,MyProfile.ImageWidth,MyProfile.ImageHeight);
PVideoInfoHeader(pSrcType.pbFormat).dwBitRate:=1000000;
PVideoInfoHeader(pSrcType.pbFormat).dwBitErrorRate:=0;
//PVideoInfoHeader(pSrcType.pbFormat).AvgTimePerFrame:=Round(10000000 / FileFps);
PVideoInfoHeader(pSrcType.pbFormat).AvgTimePerFrame:=theAvgTimePerFrame;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biWidth:=MyProfile.ImageWidth;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biHeight:=MyProfile.ImageHeight;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biSizeImage:=MyProfile.ImageWidth*MyProfile.ImageHeight*3;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biCompression:=MKFOURCC('U','Y','V','Y');
pStreamConfig.SetFormat(TAMMediaType(pSrcType^));
end;
yktd26 2009-06-16
  • 打赏
  • 举报
回复
如果是预览,我觉得可以试试19楼的代码但是CATEGORY我觉得应该设置为PIN_CATEGORY_PREVIEW
或者从capturesource的output中找到PIN_CATEGORY_PREVIEW这个pin,然后用IAMStreamConfig设置

g_pCapture.FindPin(aSrcFilter.BaseFilter, PINDIR_OUTPUT, @PIN_CATEGORY_CAPTURE, @MEDIATYPE_Video, true, 0, pPinOut);
pPinOut.QueryInterface(IID_IAMStreamConfig,pStreamConfig);
GetMem(pSrcType,SizeOf(TAMMediaType));
if pStreamConfig.GetFormat(pSrcType)=S_OK then begin
pSrcType.majortype:=MEDIATYPE_Video;
pSrcType.subtype:=MEDIASUBTYPE_UYVY;
pSrcType.formattype:=FORMAT_VideoInfo;
pSrcType.bFixedSizeSamples:=true;
pSrctype.bTemporalCompression:=false;
pSrcType.lSampleSize:=MyProfile.ImageWidth*MyProfile.ImageHeight*3;
PVideoInfoHeader(pSrcType.pbFormat).rcSource:=Rect(0,0,MyProfile.ImageWidth,MyProfile.ImageHeight);
PVideoInfoHeader(pSrcType.pbFormat).rcTarget:=Rect(0,0,MyProfile.ImageWidth,MyProfile.ImageHeight);
PVideoInfoHeader(pSrcType.pbFormat).dwBitRate:=1000000;
PVideoInfoHeader(pSrcType.pbFormat).dwBitErrorRate:=0;
//PVideoInfoHeader(pSrcType.pbFormat).AvgTimePerFrame:=Round(10000000 / FileFps);
PVideoInfoHeader(pSrcType.pbFormat).AvgTimePerFrame:=theAvgTimePerFrame;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biWidth:=MyProfile.ImageWidth;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biHeight:=MyProfile.ImageHeight;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biSizeImage:=MyProfile.ImageWidth*MyProfile.ImageHeight*3;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biCompression:=MKFOURCC('U','Y','V','Y');
pStreamConfig.SetFormat(TAMMediaType(pSrcType^));
end;
zqdue 2009-06-16
  • 打赏
  • 举报
回复
不是窗口大小的问题!是分辩率的问题!因为天敏这个卡默认是320*240的,这样效果太差了,要调到750*576才可以!但就是无办法默认它!
yktd26 2009-06-16
  • 打赏
  • 举报
回复
如果只是控制视频窗口大小,改变TVideoWindow 或者 DSVideoWindow 的属性应该可以?
zqdue 2009-06-16
  • 打赏
  • 举报
回复
不是视频文件来的!是现时视频来的!摄像头功能来的!
yktd26 2009-06-16
  • 打赏
  • 举报
回复
如果是视频文件,在编码的时候不是已经设置好了么?
zqdue 2009-06-16
  • 打赏
  • 举报
回复
顶一下!
zqdue 2009-06-15
  • 打赏
  • 举报
回复
还没有解决啊!谢谢!楼上帮我顶!
zqdue 2009-06-13
  • 打赏
  • 举报
回复
顶一下!
加载更多回复(27)

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi GAME,图形处理/多媒体
社区管理员
  • GAME,图形处理/多媒体社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧