Writing Subtitles

Introduction

LEADTOOLS toolkits support adding subtitles to certain multiplexer output streams.

Supported Demultiplexers

Currently, the LEAD MKV multiplexer is the only multiplexer supported.

Checking for Support

In order to determine if a multiplexer supports subtitles, call the ILMMuxSubtitle interface from the multiplexer in the convert graph. See the following code examples.

C++ Example

// find the convert multiplexer 
CComPtr<IUnknown> mux; 
m_convert->GetSubObject(ltmmConvert_Object_TargetFilter, &mux); 
if(mux) 
{ 
   // query IServiceProvider 
   CComQIPtr<IServiceProvider> sp = mux; 
   if(sp) 
   { 
      // check if the multiplexer subtitle service is available 
      sp->QueryService(__uuidof(LMMuxSubtitle), __uuidof(ILMMuxSubtitle), (void**) &m_subtitle); 
      if(m_subtitle) 
      { 
         // multiplexer supports subtitles 
      } 
   } 
} 

C# Example

try 
{ 
   // find the convert multiplexer service provider 
   IServiceProvider sp = (IServiceProvider) convert.GetSubObject(ConvertObject.TargetFilter); 
   if (sp != null) 
   { 
      // check if the multiplexer subtitle service is available 
      subtitle = (LMSubtitleLib.LMMuxSubtitle)sp.GetService(typeof(LMSubtitleLib.LMMuxSubtitle)); 
      if (subtitle != null) 
      { 
         // multiplexer supports subtitles 
      } 
   } 
} 
catch 
{ 
 
} 

VB.NET Example

Try 
   ' find the convert multiplexer service provider 
   Dim sp As IServiceProvider = DirectCast(convert.GetSubObject(ConvertObject.TargetFilter), IServiceProvider) 
   If sp IsNot Nothing Then 
      ' check if the multiplexer subtitle service is available 
      subtitle = DirectCast(sp.GetService(GetType(LMSubtitleLib.LMMuxSubtitle)), LMSubtitleLib.LMMuxSubtitle) 
      If subtitle IsNot Nothing Then 
         // multiplexer supports subtitles 
      End If 
   End If 
Catch 
End Try 

Editing the Subtitle List

Use the following methods and properties to edit subtitles programmatically:

Using the Multiplexer Subtitle Property Page

In addition to programmatically editing the tracks directly in the application as described above, supported multiplexers have an additional property page for editing the subtitle track list. Any application that displays the multiplexer property pages can be used to edit the subtitle track list.

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Filters C API Help