× Components and Libraries for Audio and Video Development, discussions, problems and suggestions

Solved Problems dspack

  • Avaro Nates
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 3 weeks ago #4541 by Avaro Nates
Problems dspack was created by Avaro Nates
I can not do videocaptura using my webcam. specifically the problem is when you try to activate the component FilterGraph

Please Log in or Create an account to join the conversation.

  • Avaro Nates
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 3 weeks ago #4542 by Avaro Nates
Replied by Avaro Nates on topic Problems dspack
Project costs for analysis

Please Log in or Create an account to join the conversation.

  • 4aiman
  • 4aiman's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
More
8 years 3 weeks ago #4547 by 4aiman
Replied by 4aiman on topic Problems dspack
Have you tried to remove OpenDialog1 from your form and then add it back?
Have you tried to replace "if OpenDialog1.Execute then" with "OpenDialog.Filename:=somefilename;"?
Have you tried to step-by-step execution?

コンソールマニアック

Please Log in or Create an account to join the conversation.

  • Avaro Nates
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 3 weeks ago - 8 years 3 weeks ago #4554 by Avaro Nates
Replied by Avaro Nates on topic Problems dspack

Deputy project:


procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
SysDev:= TSysDevEnum.Create(CLSID_VideoInputDeviceCategory);
if SysDev.CountFilters > 0 then
begin
for i:= 0 to SysDev.CountFilters - 1 do
ListBox1.Items.Add(SysDev.Filters.FriendlyName);
end;

end;


procedure TForm1.ListBox1Click(Sender: TObject);
begin
if FilterGraph1.Active then FilterGraph1.Active:= False;
FilterGraph1.ClearGraph;
if ListBox1.ItemIndex > -1 then
begin
Filter1.BaseFilter.Moniker:= SysDev.GetMoniker(ListBox1.ItemIndex);
FilterGraph1.Active:= True;

FilterGraph1.Mode:= gmCapture;
with FilterGraph1 as ICaptureGraphBuilder2 do
begin
RenderStream(@PIN_CATEGORY_PREVIEW, nil, Filter1 as IBaseFilter,
nil, VideoWindow1 as IBaseFilter);
end;

FilterGraph1.Play;
end;
end;


procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
FilterGraph1.ClearGraph;
FilterGraph1.Active:= False;
end


procedure TForm1.STOPClick(Sender: TObject);
begin
FilterGraph1.Stop;
end;


procedure TForm1.PLAYClick(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
if not FilterGraph1.Active then FilterGraph1.Active:= True;
FilterGraph1.RenderFile(OpenDialog1.Filename);
FilterGraph1.Play;
end;
end;
:ohmy:
THE PROBLEM OCCURS WHEN TO GIVE doubleclick ACIVAR READY FOR MY WEBCAM AND VIDEO CAPTURE
Attachments:
Last edit: 8 years 3 weeks ago by Avaro Nates.

Please Log in or Create an account to join the conversation.

  • 4aiman
  • 4aiman's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
More
8 years 3 weeks ago #4555 by 4aiman
Replied by 4aiman on topic Problems dspack
Guess we need someone who has better understanding of accents, 'cause I can't understand when the problem occures... :(
Still, nateshu, could you answer my questions?

コンソールマニアック

Please Log in or Create an account to join the conversation.

More
8 years 3 weeks ago - 8 years 3 weeks ago #4559 by Aleksandar
Replied by Aleksandar on topic Problems dspack

Deputy project:


procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
SysDev:= TSysDevEnum.Create(CLSID_VideoInputDeviceCategory);
if SysDev.CountFilters > 0 then
begin
for i:= 0 to SysDev.CountFilters - 1 do
ListBox1.Items.Add(SysDev.Filters.FriendlyName);
end;

end;


procedure TForm1.ListBox1Click(Sender: TObject);
begin
if FilterGraph1.Active then FilterGraph1.Active:= False;
FilterGraph1.ClearGraph;
if ListBox1.ItemIndex > -1 then
begin
Filter1.BaseFilter.Moniker:= SysDev.GetMoniker(ListBox1.ItemIndex);
FilterGraph1.Active:= True;

FilterGraph1.Mode:= gmCapture;
with FilterGraph1 as ICaptureGraphBuilder2 do
begin
RenderStream(@PIN_CATEGORY_PREVIEW, nil, Filter1 as IBaseFilter,
nil, VideoWindow1 as IBaseFilter);
end;

FilterGraph1.Play;
end;
end;


procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
FilterGraph1.ClearGraph;
FilterGraph1.Active:= False;
end


procedure TForm1.STOPClick(Sender: TObject);
begin
FilterGraph1.Stop;
end;


procedure TForm1.PLAYClick(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
if not FilterGraph1.Active then FilterGraph1.Active:= True;
FilterGraph1.RenderFile(OpenDialog1.Filename);
FilterGraph1.Play;
end;
end;
:ohmy:
THE PROBLEM OCCURS WHEN TO GIVE doubleclick ACIVAR READY FOR MY WEBCAM AND VIDEO CAPTURE


Please use code tag around your code next time in order to make it more readable. Same line of code looks different inside code and text.

One line of code in code tag:
SysDev.Filters[i].FriendlyName;

Same line of code in pure text:

SysDev.Filters.FriendlyName;

Forum render those things differently so it looks like that part of your code is not good, but actually it is. As you can see forum "eats" letter I in brackets, since forum consider that as start of italic text.

Now let's get back to your problem.

Looks like you want to mix capture and play. In that case, you have two approaches. Both are basically very simple, but you have to be careful.

First choice is to use one FilterGraph and two Filters. One for capture and one for playback. You need to stop playback (or capture), then to change FilterGraph mode and to switch Filter that is connected to FilterGraph after that. Then you just need to start FilterGraph again. That's all.

Second approach is to use two FilterGraphs (and two Filters). One pair for capture and one for playback. In this case you also have to stop playback (or capture) but this time you need to switch FilterGraph which is connected to VideoWindow. This is easier approach, since you do not need to change FilterGraph mode each time.

There is also a third approach, that is maybe easiest, but I do not recommend it. You can have separate set of components (Filter, FilterGraph and VideoWindow) for both capture and playback. In this case you just need to stop FilterGraph and to change visibility of VideoWindow, and of course to start FilterGraph again.

Basically you try to accomplish first approach, but you haven't done it completely and properly.
Last edit: 8 years 3 weeks ago by Aleksandar.

Please Log in or Create an account to join the conversation.

More
8 years 3 weeks ago #4561 by Aleksandar
Replied by Aleksandar on topic Problems dspack

Guess we need someone who has better understanding of accents


I guess that BlackSheep's version of DSPack for Lazarus is used in CT, but I am not sure if BlackSheep fixed some bugs that exists in original code.

There is alternate DSPack version for Delphi located here . This version is modified by Sebastian and me in order to support Unicode versions of Delphi.

I converted DirectX files myself, since there was no DirectX headers compatible with Unicode Delphi at that time. I haven't noticed few small bugs in original files, but those are fixed by Delphi team later.

Sebastian fixed some things in DirectShow and made EVR (enhanced video renderer) conversion. He also removed buggy full screen from TDSVideoWindowEx2.

DirectX and DirectShow files from that archive are adopted in Delphi 2010 update 1.

Clootie (original author of DirectX header for Delphi) have updated his headers later and of course fixed those bugs (and maybe some more).

Results of all this are devastating. There are four versions of DirectX files, three version of DirectShow files, and three versions of DSPack itself.

There is actually fourth version of DSPack (mine) that I have never released. I add some conditional defines in order to let user easily remove whole TDSVideoWindowEx2 or just full screen feature. FullScreen is buggy and TDSVideoWindowEx2 use overlays that are not supported in Vista and later versions of Windows.

I had an idea to compare all those versions and to incorporate all fixes that exists in those different versions and to release it as updated and recommended version (with credits to original authors and links to appropriate sites with original code).

I really would like to to this, but I have a lot of work, but also need to rest and to take care of my health. I was seriously ill (I had a cancer) and was on sick leave for moths. I have one more surgery in next few weeks and lot of obligations at work. :(

Maybe I could do this by the end of the year, but I am not sure and I do not promise anything.

Please Log in or Create an account to join the conversation.

More
8 years 3 weeks ago #4562 by Chris
Replied by Chris on topic Problems dspack
Hi Viking

I don't think the version I published is the one in CodeTyphon (I really can't take the credit for the one I published anyway since I think all I really did was amend some of the calls so they were incompatible with Lazarus at that time - it was a very long time ago now and I can't really remember all the changes I had to make, I think I'd added conditional defines to try and keep it Delphi code compatible).

Sternas will be able to confirm which version they incorporated but I suspect the numbers of different instances is actually more than you stipulated which I know doesn't help the situation any. I also don't think I ever saw any replies on the Prodigy website for the amendments I'd tried to contribute - although not sure there are many Lazarus developers on there anyway.

I had a similar issue with some code I'd published on the Lazarus forums to add some features to the RXlib (specifically the memory table component - I'd managed to add some downstream code from the JVCL memory table component which was based on the RXLib comp but which had had some nice extra features added over the years) and which I needed for an application. My patches were effectively made redundant by code others had manage to get incorporated into that particular library (but which IMHO weren't as good as the JVCL code which has stood the test of time). The code they'd incorporated broke my patches so I just stopped using it completely and switched to using the memory db features of SQLite (using Zeos). It is difficult to try and contribute sometimes when people don't return emails and there's no real way of contributing code.

Hopefully this is an opportunity to standardise on one version!

TheBlackSheep

Please Log in or Create an account to join the conversation.

  • Avaro Nates
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 2 weeks ago #4565 by Avaro Nates
Replied by Avaro Nates on topic Problems dspack
Hello. viking
I appreciate your help. I did what you say and everything worked properly to me ok.
I offer apologies for misspellings but my English is not very good. Always I have to resort to google translator.
thanks again :)

Please Log in or Create an account to join the conversation.

  • 4aiman
  • 4aiman's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
More
8 years 2 weeks ago - 8 years 2 weeks ago #4566 by 4aiman
Replied by 4aiman on topic Problems dspack

There are four versions of DirectX files, three version of DirectShow files, and three versions of DSPack itself.


And what's much more weird is that in CT paths there are several different DirectX and DirectShow files. Every time I recompile the IDE I got warned of using "diplicates". I understand that it's easier to maintain packages like this, but it's frustrating - EVERY time I think, like, "Are those really the same?"

I hope you and your health will be OK, Viking. And that's not because of DSPack ;)
BTW, thanks for info about DSPack! Regards!

コンソールマニアック
Last edit: 8 years 2 weeks ago by 4aiman.

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #4781 by Aleksandar
Replied by Aleksandar on topic Problems dspack

And what's much more weird is that in CT paths there are several different DirectX and DirectShow files. Every time I recompile the IDE I got warned of using "diplicates". I understand that it's easier to maintain packages like this, but it's frustrating - EVERY time I think, like, "Are those really the same?"

I hope you and your health will be OK, Viking. And that's not because of DSPack ;)
BTW, thanks for info about DSPack! Regards!


Thank you for your wishes. I'm back. :)

Unfortunately, I have many things to finish at work now.

I hope I will find some time to play a little with DSPack soon.

Installing CT 4.6 on my virtual Windows machine now. :)

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #4782 by Aleksandar
Replied by Aleksandar on topic Problems dspack

Hi Viking

I don't think the version I published is the one in CodeTyphon (I really can't take the credit for the one I published anyway since I think all I really did was amend some of the calls so they were incompatible with Lazarus at that time - it was a very long time ago now and I can't really remember all the changes I had to make, I think I'd added conditional defines to try and keep it Delphi code compatible).

Sternas will be able to confirm which version they incorporated but I suspect the numbers of different instances is actually more than you stipulated which I know doesn't help the situation any. I also don't think I ever saw any replies on the Prodigy website for the amendments I'd tried to contribute - although not sure there are many Lazarus developers on there anyway.

I had a similar issue with some code I'd published on the Lazarus forums to add some features to the RXlib (specifically the memory table component - I'd managed to add some downstream code from the JVCL memory table component which was based on the RXLib comp but which had had some nice extra features added over the years) and which I needed for an application. My patches were effectively made redundant by code others had manage to get incorporated into that particular library (but which IMHO weren't as good as the JVCL code which has stood the test of time). The code they'd incorporated broke my patches so I just stopped using it completely and switched to using the memory db features of SQLite (using Zeos). It is difficult to try and contribute sometimes when people don't return emails and there's no real way of contributing code.

Hopefully this is an opportunity to standardise on one version!

TheBlackSheep


As I wrote in previous post, I am back, but extremely busy. I need to catch up with many things at work now. I hope I'll find some time to play with DSPack soon.

Meanwhile you guys could help me a little. I need a list of all different versions of DirectX, DIrectShow and DSPack that you have spotted on the net (with download links, svn, git or whatever).

Since latest Delphi versions already have DirectX and DirectShow incorporated, first step would be to make one unified version of DSPack for Delphi.

After that I can continue with work on version for CT.

First step would be to compare and merge latest DirectX headers from Delphi with Clooties headers (including DXUtils). Then this needs to be compared and merged with current CT files.

Next step is to do same with DirectShow header file. As far as I know it's almost identical in most versions, so this step should be finished relatively fast and easy.

Those packages must work with CT only. Latest Delphi versions already have those included and I really do not care about Delphi versions before XE.

Latest step in CT would be to compare and merge unified Delphi version with DSPack in CT.

Just to be clear - there should be just one DSPack package, that can be compiled with CT and Delphi (XE and newer).

Please Log in or Create an account to join the conversation.

  • 4aiman
  • 4aiman's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Comix creator
More
7 years 11 months ago #4789 by 4aiman
Replied by 4aiman on topic Problems dspack
Well, googling gave me this:

First one is hosted on the sourceforge .

Next one is spotted @ code.google . Sourceforge has a notice that this one is the continuation of the first one.
Also there is a build for XE4 in the "issues". However there are problems still. Didn't try this one, 'cause I've only Delphi 7 which is out of the question here.

Third one is a copy of DSPack named dspack2006 . This one is direct link to an unknown version, 'cause I alone can't fix Russian people to provide a link to a source...
However, the site containing this one is in Russian, so I'm not sure if you can/need to read it.

Another one is mentioned @ the Lazarus forums and there's discussion, involving TheBlackSheep. I believe you're aware of this one. It seems to me that TheBlackSheep here, @ pilotlogic is TheBlackSheep from lazarus forums (or the other way around ;).

www.progdigy.com/ , mentioned as the home page of DSPack is a dead one (repeating 504 for me).

Finally, I found this one. There are build tests for Delphi 2009 & above.

Also, don't know how a document from the 1994 can be of any help, but here it is . Maybe it will help to understand some code pieces?

コンソールマニアック

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
7 years 11 months ago #4790 by Sternas Stefanos
Replied by Sternas Stefanos on topic Problems dspack
Thanks Sir,
we will check (or reconstruct) pl_DSPack

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.