Hello everyone,
I am using the following code snippet to run on Windows Server 2003 x64 edition. I met with the following error when invoking encoder.start method. I am using Windows Media Encoder 9.
System.Runtime.InteropServices.COMException 0xC00D1B67
My code snippet is below, does anyone have any ideas what is wrong?
thanks in advance,Code:IWMEncSourceGroup SrcGrp; IWMEncSourceGroupCollection SrcGrpColl; SrcGrpColl = encoder.SourceGroupCollection; SrcGrp = (IWMEncSourceGroup)SrcGrpColl.Add("SG_1"); IWMEncVideoSource2 SrcVid; IWMEncSource SrcAud; SrcVid = (IWMEncVideoSource2)SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_VIDEO); SrcAud = SrcGrp.AddSource(WMENC_SOURCE_TYPE.WMENC_AUDIO); SrcVid.SetInput("ScreenCap://ScreenCapture1", "", ""); SrcAud.SetInput("Device://Default_Audio_Device", "", ""); // Specify a file object in which to save encoded content. IWMEncFile File = encoder.File; string CurrentFileName = Guid.NewGuid().ToString(); File.LocalFileName = CurrentFileName; CurrentFileName = File.LocalFileName; // Choose a profile from the collection. IWMEncProfileCollection ProColl = encoder.ProfileCollection; IWMEncProfile Pro; for (int i = 0; i < ProColl.Count; i++) { Pro = ProColl.Item(i); if (Pro.Name == "Screen Video/Audio High (CBR)") { SrcGrp.set_Profile(Pro); break; } } encoder.Start();
George
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 15 of 15
Thread
-
-
Hi guns1inger, I searched a couple of similar errors, actually error code 0xC00D1B67 means -- No profile is set for the source, but you can see from my posted code snippet there is profile set for the source. I have made some further test that when I am using dual screen, there is such error, but when using single screen, there is no such error. Any ideas what is wrong?
Originally Posted by guns1inger -
http://www.tech-archive.net/Archive/Media/microsoft.public.windowsmedia.encoder/2006-1.../msg00033.html
suggests you might be pushing the resolution too high. Or perhaps you are trying to capture across two screens.Read my blog here.
-
But for dual screen, how to set resolution? I am confused because I think resolution is for one individual screen, how to set for two screens? Any ideas?
Originally Posted by guns1inger -
Depends on the desktop arrangement - are you using dual desktops (i.e. the same image on each) or an extended desktop (the image spreads across both) ? Also, which desktop are you capturing ?
These are all things you will have to learn how to identify and deal with.
First step is probably to confirm if resolution is the issue by manually altering the resolution up and down until you confirm that it is the cause of the problem. If it is, you will then have to code into your program some basic checks to find out what the resolution in use it, and if it exceeds what your program can handle, warn the user and stop execution.Read my blog here.
-
I am using an extended desktop (the image spreads across both). I did not find such an option in Windows Media Encoder to assign which desktop should I capture (actually, I only want to capture one screen). Any ideas how to set this?
About your idea to check max resolution limitation, I think it is a very great idea to make my program safer, but I did not find the max resolution which Windows Media Encoder could support from both Windows Media Encoder document and SDK document. Do you know such limitation information?
Originally Posted by guns1inger -
You may have to use trial and error. At least one of those posts suggested problems at 1600 x 1200.
Remember that an extended desktop is twice as wide as a standard desktop (assuming two identical monitors). What you need to do is what apps like camtasia allow - the user defines the capture area with the mouse. That way you can let the user drag out until the maximum allowable area is covered, and keep control.Read my blog here.
-
guns1inger, your solution works! Cool! A further question, is there any way to get the informaiton like, whether we are currently in dual monitor mode, how much is the current resolution of each desktop? I need such information so that I can warn end user when the resolution is too high.
BTW: I still can not find the limitation of max supported resolutions in dual screen mode (I find in both Encoder help and SDK document), appreciated if you could point out where it is.
Originally Posted by guns1inger -
Have you read this : http://www.microsoft.com/windows/windowsmedia/howto/articles/screencap.aspx ?
This : http://www.microsoft.com/windows/windowsmedia/howto/articles/ScreenCodec.aspx says there is a maximum screen resolution for capture of 2048 x 2048Read my blog here.
-
Thanks guns1inger, there is a max screen resolution limitation, but not mentioned how to calculate the actual resolution in dual desktop mode, for example, if I have a desktop 1 with resoltion X1 * Y1 and another desktop 2 with resoluton X2 * Y2, what is the final result resolution? I think I need to convert two desktop resolution into one desktop resolution to apply 2048 * 2048 limitation?
Originally Posted by guns1inger -
I suspect you cannot capture across two desktops that have differing resolutions because the capture must be a single rectangular area. Therefore you need to detect if the extended desktop is in play, work out if the two desktops are the same resolution, and if that resolution exceeds the limits. For all I know, it may not even be possible to screen capture across an extended desktop area with WME.
You probably need to ask these questions in the Microsoft WME developers forums.Read my blog here.
-
Cool guns1inger!
1.
I have a related question, if you have time, appreciate if you could provde some guru advice.
https://forum.videohelp.com/topic368359.html#1969836
2.
In your quoted documents, I did not find the resolution of dual desktop is the combination of each desktop, say if desktop primary is X1 * Y1 resolution, desktop secondary is X2 * Y2 resolution, it is not mentioned the result resolution should be (X1 + X2) * (Y1 + Y2). How to prove the result resolution is really "combined" by individual desktop resoltion?
Originally Posted by guns1inger
Similar Threads
-
Windows Media Encoder (WME) Error Log.
By nomo0808 in forum Video Streaming DownloadingReplies: 1Last Post: 6th Oct 2011, 02:41 -
Windows Media Encoder Question
By Gabaldad in forum CapturingReplies: 5Last Post: 24th Sep 2009, 16:48 -
Windows Media Encoder Crashes
By musomn in forum Video ConversionReplies: 3Last Post: 27th May 2009, 19:00 -
reference Windows Media Encoder library error
By George2 in forum Newbie / General discussionsReplies: 0Last Post: 15th May 2009, 05:44 -
Windows Media Encoder
By culprit in forum Video ConversionReplies: 2Last Post: 30th Oct 2007, 20:46