Infognition forum
February 11, 2012, 06:14:56 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Last GraphEditPlus version: 1.4.0   Last Video Enhancer version: 1.9.7
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: VFW_E_TYPE_NOT_ACCEPTED Error when connecting pins  (Read 1307 times)
SirPaulMuaddib
Newbie
*

Karma: +1/-0
Posts: 4


View Profile
« on: February 24, 2010, 10:41:30 PM »

I love GraphEditPlus....it's a great tool     Smiley

I have version 1.3.4.


I'm having a problem.

I need to Mux two sources
1) video from web cam (this is ALREADY an avi file, I'm not muxing live streaming video from web cam
       
2) audio wave file (also a file, and not from streaming source)

Here is my filter graph...not very fancy...



The video is horribly uncompressed...it's like 88 meg. (that is BEFORE running filter graph)
When I run from GraphEditPlus...I get beautiful results....the file is compressed + muxed with audio, down to 500k (this is because the video is mostly of static image, so compression will be very good).


I exported and tried both C++ and C# versions.

I get VFW_E_TYPE_NOT_ACCEPTED Error when connecting the two pins
XVid MPeg-4 Video Decoder <---> XVid Meg-4 Codec
(note, to get true error, I had to use DXErr.exe util, from Windows SDK)





My main issue, is that the above graph works.


The only thing I did manually in GraphEdit was to force RGB24 for xvid decoder (through property page...see below)


I used trick mentioned here
http://social.msdn.microsoft.com/Forums/en/windowsdirectshowdevelopment/thread/ae22a924-d61c-4449-b5bd-98f8eede94a4

to save the filter's setting.

I loaded it, and even had the program display the property page (for verification).

But still could not get the XVid decoder to connect to the XVid Encoder. (the file is xvid encoded, but NOT compressed)



here is what I tried

   // ERROR HERE
   AM_MEDIA_TYPE mediaType1;
   CComPtr<IPin> pInPin1 = GetPin(pXvidMPEG4VideoDecoder, L"XForm In");   <---- Get Media Type of input file
   pInPin1->ConnectionMediaType(&mediaType1);

 
   CComPtr<IPin> pOutPin = GetPin(pXvidMPEG4VideoDecoder, L"XForm Out"); <---- output pin

   CComPtr<IPin> pInPin2 = GetPin(pCinepakCodecbyRadius, L"Input");      <--- input pin
 
   hr = pOutPin->Connect(pInPin2, &mediaType1);   <--- fails with VFW_E_TYPE_NOT_ACCEPTED

//HRESULT: 0x8004022a (2147746346)
//Name: VFW_E_TYPE_NOT_ACCEPTED
//Description: This pin cannot use the supplied media type.
//Severity code: Failed
//Facility Code: FACILITY_ITF (4)
//Error Code: 0x022a (554)




Here is source for program...(not large, just deals with this issue)
It also include the GRF file depicted from above

http://www.fileden.com/files/2010/2/23/2771640//Just Source.zip




this is same thing, but contains the two media files I was using in test
it's 55mb, but if anybody wanted to try this version using the media file I was using in test
then it's in this version

http://www.fileden.com/files/2010/2/23/2771640//All.zip


Here is the only thing I manually did in regards to filter graph...and that was
to force RGB24 compatibility.
« Last Edit: February 24, 2010, 10:49:46 PM by SirPaulMuaddib » Logged
SirPaulMuaddib
Newbie
*

Karma: +1/-0
Posts: 4


View Profile
« Reply #1 on: February 24, 2010, 10:44:25 PM »

ps.. I tried doing pGraph->DirectConnect(...) for the mention filters....
        and pGraph->Connect(...)

and still had issue.

I'm using latest XVid codec from XVid's main site.

...also...the Pins are non-NULL and valid pins.

In the download links I provided, I think I forgot to include the GRF for the one filter.

That is..you create a graph with just one filter, manually tweak whatever settings on it, and save it to GRF file,
this will persist those tweaks when you load the GRF in your program. You can then use the filter directly, by calling
pGraph->FindFilter(...)

« Last Edit: February 24, 2010, 11:52:20 PM by SirPaulMuaddib » Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 517



View Profile WWW
« Reply #2 on: February 25, 2010, 10:16:35 AM »

Two quick ideas before going deep into the case:
1. Have you tried disabling "Compatibility renderer" in Xvid Decoder settings?

2. Insert a Sample Grabber into the graph, tell it to accept RGB24 (or better YUY2), then connect decoder to the sample grabber and then grabber to your encoder. It's an easy way to force decoding to particular format.
Logged
SirPaulMuaddib
Newbie
*

Karma: +1/-0
Posts: 4


View Profile
« Reply #3 on: February 25, 2010, 03:51:12 PM »

thanks for info...will try...

How does one tell filter to accept RGB24 pro grammatically?

I know how to do that manually in graph...(the way I mentioned in original post did not seem to work).

Ah found it...it has ISampleGrabber interface...
« Last Edit: February 25, 2010, 05:46:08 PM by SirPaulMuaddib » Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 517



View Profile WWW
« Reply #4 on: February 26, 2010, 02:20:39 PM »

That's right, ISampleGrabber. Do it in GEP and view generated code to see an example of usage.
Logged
mdortiz
Newbie
*

Karma: +0/-0
Posts: 5


View Profile
« Reply #5 on: March 03, 2010, 12:42:39 AM »

Here is the code it generated...the only modification involved use of namespace DexterLib::

   AM_MEDIA_TYPE pSampleGrabber_pmt;
   ZeroMemory(&pSampleGrabber_pmt, sizeof(AM_MEDIA_TYPE));
   pSampleGrabber_pmt.majortype = MEDIATYPE_Video;
   pSampleGrabber_pmt.subtype = MEDIASUBTYPE_RGB24;
   pSampleGrabber_pmt.formattype = FORMAT_VideoInfo;
   pSampleGrabber_pmt.bFixedSizeSamples = FALSE;
   pSampleGrabber_pmt.cbFormat = 88;
   pSampleGrabber_pmt.lSampleSize = 1;
   pSampleGrabber_pmt.bTemporalCompression = TRUE;
   VIDEOINFOHEADER pSampleGrabber_format;
   ZeroMemory(&pSampleGrabber_format, sizeof(VIDEOINFOHEADER));
   pSampleGrabber_format.AvgTimePerFrame = 1250000;
   pSampleGrabber_format.bmiHeader.biSize = 40;
   pSampleGrabber_format.bmiHeader.biWidth = 640;
   pSampleGrabber_format.bmiHeader.biHeight = 480;
   pSampleGrabber_format.bmiHeader.biPlanes = 1;
   pSampleGrabber_format.bmiHeader.biBitCount = 24;
   pSampleGrabber_format.bmiHeader.biCompression = 1145656920;
   pSampleGrabber_format.bmiHeader.biSizeImage = 1843200;
   pSampleGrabber_pmt.pbFormat = (BYTE*)&pSampleGrabber_format;
   CComQIPtr<DexterLib::ISampleGrabber, &DexterLib::IID_ISampleGrabber> pSampleGrabber_isg(pSampleGrabber);
   hr = pSampleGrabber_isg->SetMediaType((DexterLib::_AMMediaType*) &pSampleGrabber_pmt);
   CHECK_HR(hr, L"Can't set media type to sample grabber");


   //connect SampleGrabber and Xvid MPEG-4 Codec
   hr = pGraph->ConnectDirect(GetPin(pSampleGrabber, L"Output"), GetPin(pXvidMPEG4Codec, L"Input"), NULL);
   // "There is no common media type between these pins."   
   CHECK_HR(hr, L"Can't connect SampleGrabber and Xvid MPEG-4 Codec");


I still get error in code version: hr = 0x80040207 = "There is no common media type between these pins."   

 Cry

Run from GraphEditPlus it works, but not in generated code.
Logged
mdortiz
Newbie
*

Karma: +0/-0
Posts: 5


View Profile
« Reply #6 on: March 03, 2010, 12:53:14 AM »

I also tried this way (same error)


   // Set the media type
   AM_MEDIA_TYPE mt;
   ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
   mt.formattype = FORMAT_VideoInfo;
   mt.majortype = MEDIATYPE_Video;
   mt.subtype = MEDIASUBTYPE_RGB24;   // only accept 24-bit bitmaps


   CComQIPtr<ISampleGrabber> pGrabber = pSampleGrabber;
   hr = pGrabber->SetMediaType(&mt);


   //connect SampleGrabber and Xvid MPEG-4 Codec
   hr = pGraph->ConnectDirect(GetPin(pSampleGrabber, L"Output"), GetPin(pXvidMPEG4Codec, L"Input"), NULL);  <--- same error here
   CHECK_HR(hr, L"Can't connect SampleGrabber and Xvid MPEG-4 Codec");
Logged
mdortiz
Newbie
*

Karma: +0/-0
Posts: 5


View Profile
« Reply #7 on: March 03, 2010, 06:59:12 PM »

I'm re-hosting example project here. (I think the above links, in earlier posts will expire in day or so)

(it's about 56 meg, because I include the avi file I was using in testing filtergraph, otherwise the project itself is rather small and straighforward)


below...copy the whole line to get complete url
http://www.mediafire.com/?mnzmtg1m00m
« Last Edit: March 03, 2010, 07:25:24 PM by mdortiz » Logged
mdortiz
Newbie
*

Karma: +0/-0
Posts: 5


View Profile
« Reply #8 on: March 17, 2010, 09:46:13 PM »

Does anybody know what the issue is??
 Undecided
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!