Class SubRipCaptionConverter

  • All Implemented Interfaces:
    org.opencastproject.caption.api.CaptionConverter

    public class SubRipCaptionConverter
    extends Object
    implements org.opencastproject.caption.api.CaptionConverter
    Converter engine for SubRip srt caption format. It does not support advanced SubRip format (SubRip format with annotations). Advanced format will be parsed but all annotations will be stripped off.
    • Constructor Detail

      • SubRipCaptionConverter

        public SubRipCaptionConverter()
    • Method Detail

      • importCaption

        public List<org.opencastproject.caption.api.Caption> importCaption​(InputStream in,
                                                                           String language)
                                                                    throws org.opencastproject.caption.api.CaptionConverterException
        Since srt does not store information about language, language parameter is ignored.
        Specified by:
        importCaption in interface org.opencastproject.caption.api.CaptionConverter
        Throws:
        org.opencastproject.caption.api.CaptionConverterException
        See Also:
        CaptionConverter.importCaption(java.io.InputStream, java.lang.String)
      • exportCaption

        public void exportCaption​(OutputStream outputStream,
                                  List<org.opencastproject.caption.api.Caption> captions,
                                  String language)
                           throws IOException
        Since srt does not store information about language, language parameter is ignored.
        Specified by:
        exportCaption in interface org.opencastproject.caption.api.CaptionConverter
        Throws:
        IOException
      • getLanguageList

        public String[] getLanguageList​(InputStream input)
                                 throws org.opencastproject.caption.api.CaptionConverterException
        Returns empty list since srt format does not store any information about language.
        Specified by:
        getLanguageList in interface org.opencastproject.caption.api.CaptionConverter
        Throws:
        org.opencastproject.caption.api.CaptionConverterException
        See Also:
        CaptionConverter.getLanguageList(java.io.InputStream)
      • getExtension

        public String getExtension()
        Specified by:
        getExtension in interface org.opencastproject.caption.api.CaptionConverter
        See Also:
        CaptionConverter.getExtension()
      • getElementType

        public org.opencastproject.mediapackage.MediaPackageElement.Type getElementType()
        Specified by:
        getElementType in interface org.opencastproject.caption.api.CaptionConverter