Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Friday, April 7, 2017 4:05:56 PM(UTC)


Groups: Registered, Tech Support, Administrators
Posts: 39

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)

To programatically set the properties of any encoder/decoder that LEADTOOLS supports you first need to reference the Direct Show filter dll for the encoder/decoder that you want to work with. These are DirectShow filters written in C so you will need to reference C DLLs. Visual Studio will create interop DLLs for these allowing them to be used in .NET

These can be found in following directories:

<install directory>\Bin\CDLL\Win32
<install directory>\Bin\CDLL\x64

Then in code you will want to create an instance of the encoder/decoder. Assign to this the object returned by calling <LEADTOOLS Multimedia Control>.GetSubObject(<Capture/Play/Convert>Object.VideoCompressor) this you will need to cast as the encoder you want to work with.

From that point you can adjust whatever settings are available for that object.

For example the in the following code snippet I am using the H264 encoder and the LEADTOOLS ConvertCtrl

// Example options for H264 encoder
LMH264Encoder m_pH264 = convertCtrl1.GetSubObject(ConvertObject.VideoCompressor) as LMH264Encoder;
m_pH264.EncodingThreads = eH264ENCODINGTHREADS.H264THREAD_AUTO;
m_pH264.OutputFormat = eH264OUTPUTFORMAT.H264FORMAT_AUTO;
m_pH264.QualityFactor = 49;
m_pH264.IFrameInterval = 15;
m_pH264.PFrameInterval = 0;
m_pH264.SymbolMode = eH264SYMBOLMODE.H264SYMBOL_CAVLC;
m_pH264.FrameRate = -1;
m_pH264.EnableRateControl = true;
m_pH264.BitRate = 500000;
m_pH264.EnableSuperCompression = false;

You can reference our Encoder/Decoder documentation pages to see what settings are supported for each encode/decoder. There is a section for Video and Audio codecs.

documentation image

You would do the same for any other encoder or decoder that you would need to adjust the settings for programmatically.

Edited by moderator Thursday, December 28, 2023 9:49:58 AM(UTC)  | Reason: Updated

Roberto Rodriguez
Developer Support Engineer
LEAD Technologies, Inc.


Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.082 seconds.