类 MediaInformation


  • public class MediaInformation
    extends Object
    Media information class.
      "format": {
          "filename": "E:\\temp4\\8.2\\xx.mp4",
          "nb_streams": 2,
          "nb_programs": 0,
          "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
          "format_long_name": "QuickTime / MOV",
          "start_time": "0.000000",
          "duration": "6.834000",
          "size": "994532",
          "bit_rate": "1164216",
          "probe_score": 100,
          "tags": {
              "major_brand": "isom",
              "minor_version": "512",
              "compatible_brands": "isomiso2avc1mp41",
              "encoder": "Lavf58.76.100",
              "comment": "vid:v0d00fg10000cai2s7bc77ucdoekmv40"
          }
      }
     
    • 方法详细资料

      • getFilename

        public String getFilename()
        Returns file name.
        返回:
        media file name
      • getFormat

        public String getFormat()
        Returns format.
        返回:
        media format
      • getLongFormat

        public String getLongFormat()
        Returns long format.
        返回:
        media long format
      • getDuration

        public String getDuration()
        Returns duration.
        返回:
        media duration in seconds(秒)
      • getDurationMs

        public double getDurationMs()
        Returns duration.
        返回:
        media duration in milliseconds (毫秒)
      • getStartTime

        public String getStartTime()
        Returns start time.
        返回:
        media start time in milliseconds
      • getSize

        public String getSize()
        Returns total size.
        返回:
        media size in bytes
      • getBitrate

        public String getBitrate()
        Returns avg bitrate.
        返回:
        media bitrate in kb/s
      • getTags

        public org.json.JSONObject getTags()
        Returns all tags.
        返回:
        tags dictionary
      • getChapters

        public List<Chapter> getChapters()
        Returns all chapters.
        返回:
        list of chapters
      • getStringProperty

        public String getStringProperty​(String key)
        Returns the media property associated with the key.
        参数:
        key - property key
        返回:
        media property as string or null if the key is not found
      • getNumberProperty

        public Long getNumberProperty​(String key)
        Returns the media property associated with the key.
        参数:
        key - property key
        返回:
        media property as Long or null if the key is not found
      • getProperties

        public org.json.JSONObject getProperties​(String key)
        Returns the media properties associated with the key.
        参数:
        key - properties key
        返回:
        media properties as a JSONObject or null if the key is not found
      • getMediaProperties

        public org.json.JSONObject getMediaProperties()
        Returns all media properties.
        返回:
        all media properties as a JSONObject or null if no media properties are defined
      • getAllProperties

        public org.json.JSONObject getAllProperties()
        Returns all properties defined.
        返回:
        all properties as a JSONObject or null if no properties are defined