Error Connecting Source Filter Asf Writer
I am having a frustrating problem trying to negotiate a WMMEDIATYPE_Text IPin connection between a custom DirectShow source filter that I have created and the "WM ASF Writer" filter. I am successfully using a custom ASF profile to expose a Video, an Audio, and a Text input pins on the "WM ASF Writer"; however, when it comes time to connect the Text pins, my source filter's ::CheckMediaType() and ::GetMediaType() are called (both quite happy with the connection arrangement); however, the connection is refused internally with error code 0x80040207 (VFW_E_NO_ACCEPTABLE_TYPES). In my quest, I think that I have virtually memorized both the DirectShow SDK and the Media9 SDK (along with several of the examples). I do not have any problems using Video/audio with "WM ASF Writer" and I do not understand why working with Text and Arbitrary streams should be so difficult - What am I missing... Any help would be appreciated . The MediaType values that I am using in all (Text) cases are as follows: majortype = WMMEDIATYPE_Text; subtype = MEDIASUBTYPE_None; bFixedSizeSamples = TRUE; bTemporalCompression = TRUE; lSampleSize = 64; // 64 byte fixed char string formattype = FORMAT_None; pUnk = 0; cbFormat = 0; // Because FORMAT_None? pbFormat = NULL; /* My ASF Profile code fragment */ ... m_pASFProfile->CreateNewStream( WMMEDIATYPE_Text, &l_pIWMStreamConfig ) ... l_pIWMMediaProps->SetMediaType( l_pMediaType ); // using above MediaType values m_pASFProfile->AddStream( l_pIWMStreamConfig ); /* Meanwhile in the source filter */ "My Source Filter"::GetMediaType( int iPosition, CMediaType *pMediaType ) { CAutoLock cAutoLockShared( &m_cStateLock ); CheckPointer( pMediaType, E_POINTER ); if ( p_iPosition<< 0 ) return E_INVALIDARG; if ( p_iPosition>> 0 ) return VFW_S_NO_MORE_ITEMS; pMediaType>>SetType ( &WMMEDIATYPE_Text ); pMediaType>>SetSubtype ( &MEDIASUBTYPE_None ); pMediaType>>SetTemporalCompression( TRUE ); pMediaType>>SetSampleSize( g_iMAXTextStreamLength ); pMediaType>>SetFormatType( &FORMAT_None ); return NOERROR; } "My Source Filter"::CheckMediaType( const CMediaType *pMediaType ) { CAutoLock cAutoLockShared( &m_cStateLock ); CheckPointer( pMediaType, E_POINTER ); if ( pMediaType>>majortype != WMMEDIATYPE_Text ) return E_INVALIDARG; return NOERROR; } "My Source Filter"::DecideBufferSize() is not called. Upon connection check, ::CheckMediaType() is called and returns NOERROR, Next, ::GetMediaType() is called and returns NOERROR For some reason the internal connection process is not satisfied with the type selection, so it increment
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to feed video data into a DirectShow filter to compress/encode and save to http://www.yqcomputer.com/163_812_1.htm file? up vote 1 down vote favorite 1 First of all, here is what I'm trying to accomplish: We'd like to add the capability to our commercial application to generate a video file to visualize data. It should be saved in a reasonably compressed format. It is important that the encoding library/codecs are licensed such that we're allowed to use and sell our software without restriction. It's also important that http://stackoverflow.com/questions/28244489/how-to-feed-video-data-into-a-directshow-filter-to-compress-encode-and-save-to-f the media format can easily be played by a customer, i.e. can be played by Windows Media Player without requiring a codec pack to be installed. I'm trying to use DirectShow in c++ by creating a source filter with one output pin that generates the video. I'm closely following the DirectShow samples called Bouncing Ball and Push Source. In GraphEdit I can successfully connect to a video renderer and see the video play. I have also managed to connect to AVI Mux and then file writer to write an uncompressed AVI file. The only issue with this is the huge file size. However, I have not been able to save the video in a compressed format. This problem also happens with the Ball and Push Source samples. I can connect the output pin to a WM ASF Writer, but when I click play I get "This graph can't play. Unspecified error (Return code: 0x80004005)." I can't even figure out how to connect to the WMVideo9 Encoder DMO ("These filters cannot agree on a connection"). I could successfully save to mjpeg, but compression was not very substantial. Please let me know if I'm doing something wrong in GraphEdit or if my source filter code needs to be modified. Alternatively,
Brought to you by: snarfle Summary Files Reviews Support Mailing Lists Code Tickets ▾ Bugs Feature Requests Discussion Create Topic Stats Graph Forums Open Discussion 3027 Help Formatting Help Can't connect capture card Forum: Open Discussion Creator: tedy Created: 2007-09-08 https://sourceforge.net/p/directshownet/discussion/460697/thread/745d423c/ Updated: 2012-10-29 tedy - 2007-09-08 I need to connect Inftee Filter(the sample filter in directshow sdk) with video capture device. There will be an "device not connected" error when I connect ViewCast Osprey 210 capture card, But if I use logitch usb camera, it works well. I have tried 4 out pins of the capture card filter, the error is same. So, who can give me some suggestions. If you would error connecting like to refer to this comment somewhere else in this project, copy and paste the following link: snarfle - 2007-09-08 Well, I'm thinking that maybe the InfTee filter doesn't support the media types output by the Osprey? Does the Osprey output mpeg2? If you would like to refer to this comment somewhere else in this project, copy and paste the following link: tedy - 2007-09-08 The inf tee filter is added successfully. error connecting source Thank you. But I want to ask another question. I connect two video source filters to asf writer filter. One is from capture card, one is from gssf filter, but some times it stops capturing And the GetImage callback method of GSSF filter no longer called when CPU usage is high. But if I use a usb camera instead of capture card, it hardly stops even CPU usage is 100%. can you give some advice. If you would like to refer to this comment somewhere else in this project, copy and paste the following link: snarfle - 2007-09-08 I can't think of why this might be. Unless the graph is getting in trouble and sending an error or termination to the GSSF filter. Sorry, you're just going to have to debug this one. If you would like to refer to this comment somewhere else in this project, copy and paste the following link: tedy - 2007-09-08 After testing in GraphEdit, I found the reason is that I need to connect a osprey-210 crossbar filter 1 first, it belongs to the WDM streaming crossbar device, but I don't know how to find it in my program. If you would like to refer to this comment somewhere else in this project, copy and paste t