How to add subtitle text to AVI file


  • Does anybody know how to encode text within an AVI file so that WMP, not a filter, displays it as subtitles?

    I can already create AVI files containing video and audio with and without using DirectShow. Now I need to insert text into the AVI file--not as a separate file--so that Windows Media Player displays it as a subtitle, which the user can switch on and off from within WMP with Play | Lyrics, Captions and Subtitles | On if Available. Oh, and I cannot depend on the user having a third-party filter, such as vobsud.dll, so WPM has to do it on its own.

    I found a small AVI file online that uses a subtitle chunk (01tx....GAB2...) described here. WMP plays the video and, with subtitles enabled but no subtitle filter installed, displays the "GAB2" part of the chunk data header, not the subtitle text itself. It displays "GAB2" as white text in a separate black band below the video, so there is some native subtitle ability kicking in here.


    Thursday, March 17, 2011 7:52 PM


  • That syntax is not part of the AVI standard by the extension used by VobSub and now used by other programs.

    There is no native support in DirectShow, and thus WMP, for subtitle streams in AVI files.

    Subtitles are only supported in ASF/WMV/WMA (ASF's own formats), DVDs (EIA-608 closed captions) and certain analog or digital TV broadcasts (WST or EIA-608).

    The only other way in WMP to add subtitles is by a separate SAMI file.

    If you want SRT subtitles in AVI files to play in WMP, you need a third-party filter.

    MVP :: DirectShow / MediaFoundation <>
    • Marked as answer by dplong Thursday, April 21, 2011 4:15 PM
    Thursday, March 17, 2011 8:30 PM