Class MediaInformationJsonParser


  • public class MediaInformationJsonParser
    extends java.lang.Object
    A parser that constructs MediaInformation from FFprobe's json output.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String KEY_CHAPTERS  
      static java.lang.String KEY_STREAMS  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MediaInformation from​(java.lang.String ffprobeJsonOutput)
      Extracts MediaInformation from the given FFprobe json output.
      static MediaInformation fromWithError​(java.lang.String ffprobeJsonOutput)
      Extracts MediaInformation from the given FFprobe json output.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MediaInformationJsonParser

        public MediaInformationJsonParser()
    • Method Detail

      • from

        public static MediaInformation from​(java.lang.String ffprobeJsonOutput)
        Extracts MediaInformation from the given FFprobe json output. Note that this method does not throw JSONException as fromWithError(String) does and handles errors internally.
        Parameters:
        ffprobeJsonOutput - FFprobe json output
        Returns:
        created MediaInformation instance of null if a parsing error occurs
      • fromWithError

        public static MediaInformation fromWithError​(java.lang.String ffprobeJsonOutput)
                                              throws org.json.JSONException
        Extracts MediaInformation from the given FFprobe json output.
        Parameters:
        ffprobeJsonOutput - ffprobe json output
        Returns:
        created MediaInformation instance
        Throws:
        org.json.JSONException - if a parsing error occurs