How can I set properties of encoders used in TimeShifting object?

From AVObjects Knowledge Base
(Difference between revisions)
Jump to: navigation, search
 
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.  
+
* Set all needed codec settings through property page.  
  
* get state (settings) with GetVideoCodecProps() method.  
+
* Get state (settings) with GetVideoCodecProps() method.  
  
* save received settings.  
+
* Save received settings.  
  
* on next usage restore this settings with SetVideoCodecProps() method.  
+
* 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).  
Line 23: Line 23:
 
Here is a sequence of actions:  
 
Here is a sequence of actions:  
  
- create an instance of codec DirectShow interface (must be provided by codec developers).  
+
* Create an instance of codec DirectShow interface (must be provided by codec developers).  
  
- get the pointer to codec object with GetVideoEncoderFilter() or GetAudioEncoderFilter() method.
+
* Get the pointer to codec object with GetVideoEncoderFilter() or GetAudioEncoderFilter() method.
  
- cast codec object to it's DirectShow interface instance.
+
* Cast codec object to it's DirectShow interface instance.
 
   
 
   
- use DirectShow interface instance methods to set codec properties.
+
* Use DirectShow interface instance methods to set codec properties.
  
 
''Note:'' This method is supported by non-VCM codecs with DirectShow interface only.
 
''Note:'' This method is supported by non-VCM codecs with DirectShow interface only.
  
 
[[Category: Time Shifting Engine FAQ]]
 
[[Category: Time Shifting Engine FAQ]]

Latest 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.

Personal tools