How can I set properties of encoders used in TimeShifting object?
Line 8: | Line 8: | ||
So, here is a sequence of actions to use them: | So, here is a sequence of actions to use them: | ||
− | + | * set all needed codec settings through property page. | |
− | + | * get state (settings) with GetVideoCodecProps() method. | |
− | + | * save received settings. | |
− | + | * on next usage restore this settings with SetVideoCodecProps() method. | |
''Note:'' ICGetState is supported by VCM codecs only (they are marked as blue in GraphEdit). | ''Note:'' ICGetState is supported by VCM codecs only (they are marked as blue in GraphEdit). |
Revision as of 14:18, 4 October 2011
There are 2 ways to do that:
1. Use GetVideoCodecProps() and SetVideoCodecProps() methods.
This methods use ICGetState interface of codecs ( http://msdn.microsoft.com/en-us/library/dd743157(v=VS.85).aspx ). That means that they get and set properties in binary structure and it is impossible to change them manually (data storing format is codec specific).
So, here is a sequence of actions to use them:
- set all needed codec settings through property page.
- get state (settings) with GetVideoCodecProps() method.
- save received settings.
- on next usage restore this settings with SetVideoCodecProps() method.
Note: ICGetState is supported by VCM codecs only (they are marked as blue in GraphEdit). Edit).
2. Receive pointer to codec object and use it's DirectShow interface directly.
Here is a sequence of actions:
- create an instance of codec DirectShow interface (must be provided by codec developers).
- get the pointer to codec object with GetVideoEncoderFilter() or GetAudioEncoderFilter() method.
- cast codec object to it's DirectShow interface instance.
- use DirectShow interface instance methods to set codec properties.
Note: This method is supported by non-VCM codecs with DirectShow interface only.