0

I am getting the ArgumentException:"Parameter is incorrect." when I call a method "PrepareToEncode()" in an application.

I am using... Windows Media Encoder 9 series with Visual Basics Dot Net Framework version 2.0.

I am actually upgrading the application to newer framework but before that I have to run the older version just to know what is going on. Older version of the application was not done by me so, I can't tell exactly what is going on. To add to that, I work on C# but the whole code is in VB.net. When I was building the solution it threw above mentioned exception.

Now I think that I should read the proper documentation on the method so I can work my way from there. I searched on internet but none of the results are of any help to me.

Can anybody explain to me what is actual use of PrepareToEncode() method and the Exception. Just a little direction would suffice.(I just need to know if it was you, where, when and how would you use that "PrepareToEncode" method?)

Thanks. Regards.

Sumeet
  • 51
  • 6

2 Answers2

1

PrepareToEncode must to have before the calling start recording .Can't attach or start the preview until the containers are ready start the camera.

Usage is as follows: oEncoder.PrepareToEncode(True)

Shrd
  • 11
  • 5
0

PrepareToEncode is used to verify that the encoder is configured correctly before calling the Start method. It checks that the port you have specified for broadcasting is available (for live streams), that the devices in a source are available and ready to start, etc. It is also used to prepare a source before switching to it to minimize delays when the switch actually occurs.

"Parameter is incorrect" indicates that to some method was of the wrong type. If you see that when you set PrepareToEncode, it means that a method used by that property was given an object of the wrong type, probably because some required setting is missing, or is set with a value that does not make sense in the context of what you are trying to do.

Gil
  • 128
  • 1
  • 1
  • 7