|
|
@ -296,13 +296,6 @@ export class AbstractSession extends Session { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#logRedirectionStrategy; |
|
|
|
#logRedirectionStrategy; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Creates a new abstract session. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
constructor() { |
|
|
|
|
|
|
|
super(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Creates a new FFmpeg session. |
|
|
|
* Creates a new FFmpeg session. |
|
|
|
* |
|
|
|
* |
|
|
@ -1605,12 +1598,12 @@ class FFmpegKitFactory { |
|
|
|
if (sessionMap !== undefined) { |
|
|
|
if (sessionMap !== undefined) { |
|
|
|
switch (sessionMap.type) { |
|
|
|
switch (sessionMap.type) { |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
return FFprobeSession.fromMap(sessionMap); |
|
|
|
return AbstractSession.createFFprobeSessionFromMap(sessionMap); |
|
|
|
case 3: |
|
|
|
case 3: |
|
|
|
return MediaInformationSession.fromMap(sessionMap); |
|
|
|
return AbstractSession.createMediaInformationSessionFromMap(sessionMap); |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
default: |
|
|
|
default: |
|
|
|
return FFmpegSession.fromMap(sessionMap); |
|
|
|
return AbstractSession.createFFmpegSessionFromMap(sessionMap); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return undefined; |
|
|
|
return undefined; |
|
|
@ -1618,7 +1611,7 @@ class FFmpegKitFactory { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static getVersion() { |
|
|
|
static getVersion() { |
|
|
|
return "4.5.2"; |
|
|
|
return "5.1.0"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static getLogRedirectionStrategy(sessionId) { |
|
|
|
static getLogRedirectionStrategy(sessionId) { |
|
|
@ -1935,13 +1928,6 @@ class FFmpegKitInitializer { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export class FFmpegSession extends AbstractSession { |
|
|
|
export class FFmpegSession extends AbstractSession { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Creates an empty FFmpeg session. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
constructor() { |
|
|
|
|
|
|
|
super(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Creates a new FFmpeg session. |
|
|
|
* Creates a new FFmpeg session. |
|
|
|
* |
|
|
|
* |
|
|
@ -1963,16 +1949,6 @@ export class FFmpegSession extends AbstractSession { |
|
|
|
return session; |
|
|
|
return session; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Creates a new FFmpeg session from the given map. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param sessionMap map that includes session fields as map keys |
|
|
|
|
|
|
|
* @returns FFmpeg session created |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
static fromMap(sessionMap) { |
|
|
|
|
|
|
|
return AbstractSession.createFFmpegSessionFromMap(sessionMap); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the session specific statistics callback. |
|
|
|
* Returns the session specific statistics callback. |
|
|
|
* |
|
|
|
* |
|
|
@ -2252,13 +2228,6 @@ export class FFprobeKit { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export class FFprobeSession extends AbstractSession { |
|
|
|
export class FFprobeSession extends AbstractSession { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Creates an empty FFprobe session. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
constructor() { |
|
|
|
|
|
|
|
super(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Creates a new FFprobe session. |
|
|
|
* Creates a new FFprobe session. |
|
|
|
* |
|
|
|
* |
|
|
@ -2278,16 +2247,6 @@ export class FFprobeSession extends AbstractSession { |
|
|
|
return session; |
|
|
|
return session; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Creates a new FFprobe session from the given map. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param sessionMap map that includes session fields as map keys |
|
|
|
|
|
|
|
* @returns FFprobe session created |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
static fromMap(sessionMap) { |
|
|
|
|
|
|
|
return AbstractSession.createFFprobeSessionFromMap(sessionMap); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the session specific complete callback. |
|
|
|
* Returns the session specific complete callback. |
|
|
|
* |
|
|
|
* |
|
|
@ -2438,7 +2397,7 @@ export class Log { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export class MediaInformation { |
|
|
|
export class MediaInformation { |
|
|
|
|
|
|
|
|
|
|
|
static KEY_MEDIA_PROPERTIES = "format"; |
|
|
|
static KEY_FORMAT_PROPERTIES = "format"; |
|
|
|
static KEY_FILENAME = "filename"; |
|
|
|
static KEY_FILENAME = "filename"; |
|
|
|
static KEY_FORMAT = "format_name"; |
|
|
|
static KEY_FORMAT = "format_name"; |
|
|
|
static KEY_FORMAT_LONG = "format_long_name"; |
|
|
|
static KEY_FORMAT_LONG = "format_long_name"; |
|
|
@ -2460,7 +2419,7 @@ export class MediaInformation { |
|
|
|
* @return media file name |
|
|
|
* @return media file name |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getFilename() { |
|
|
|
getFilename() { |
|
|
|
return this.getStringProperty(MediaInformation.KEY_FILENAME); |
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_FILENAME); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2469,7 +2428,7 @@ export class MediaInformation { |
|
|
|
* @return media format |
|
|
|
* @return media format |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getFormat() { |
|
|
|
getFormat() { |
|
|
|
return this.getStringProperty(MediaInformation.KEY_FORMAT); |
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_FORMAT); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2478,7 +2437,7 @@ export class MediaInformation { |
|
|
|
* @return media long format |
|
|
|
* @return media long format |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getLongFormat() { |
|
|
|
getLongFormat() { |
|
|
|
return this.getStringProperty(MediaInformation.KEY_FORMAT_LONG); |
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_FORMAT_LONG); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2487,7 +2446,7 @@ export class MediaInformation { |
|
|
|
* @return media duration in "seconds.microseconds" format |
|
|
|
* @return media duration in "seconds.microseconds" format |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getDuration() { |
|
|
|
getDuration() { |
|
|
|
return this.getStringProperty(MediaInformation.KEY_DURATION); |
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_DURATION); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2496,7 +2455,7 @@ export class MediaInformation { |
|
|
|
* @return media start time in milliseconds |
|
|
|
* @return media start time in milliseconds |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getStartTime() { |
|
|
|
getStartTime() { |
|
|
|
return this.getStringProperty(MediaInformation.KEY_START_TIME); |
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_START_TIME); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2505,7 +2464,7 @@ export class MediaInformation { |
|
|
|
* @return media size in bytes |
|
|
|
* @return media size in bytes |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getSize() { |
|
|
|
getSize() { |
|
|
|
return this.getStringProperty(MediaInformation.KEY_SIZE); |
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_SIZE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2514,7 +2473,7 @@ export class MediaInformation { |
|
|
|
* @return media bitrate in kb/s |
|
|
|
* @return media bitrate in kb/s |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getBitrate() { |
|
|
|
getBitrate() { |
|
|
|
return this.getStringProperty(MediaInformation.KEY_BIT_RATE); |
|
|
|
return this.getStringFormatProperty(MediaInformation.KEY_BIT_RATE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2523,7 +2482,7 @@ export class MediaInformation { |
|
|
|
* @return tags dictionary |
|
|
|
* @return tags dictionary |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getTags() { |
|
|
|
getTags() { |
|
|
|
return this.getProperties(MediaInformation.KEY_TAGS); |
|
|
|
return this.getFormatProperty(MediaInformation.KEY_TAGS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2571,58 +2530,103 @@ export class MediaInformation { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the media property associated with the key. |
|
|
|
* Returns the property associated with the key. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key property key |
|
|
|
* @param key property key |
|
|
|
* @return media property as string or undefined if the key is not found |
|
|
|
* @return property as string or undefined if the key is not found |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getStringProperty(key) { |
|
|
|
getStringProperty(key) { |
|
|
|
let mediaProperties = this.getMediaProperties(); |
|
|
|
let allProperties = this.getAllProperties(); |
|
|
|
if (mediaProperties !== undefined) { |
|
|
|
if (allProperties !== undefined) { |
|
|
|
return mediaProperties[key]; |
|
|
|
return allProperties[key]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return undefined; |
|
|
|
return undefined; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the media property associated with the key. |
|
|
|
* Returns the property associated with the key. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key property key |
|
|
|
* @param key property key |
|
|
|
* @return media property as number or undefined if the key is not found |
|
|
|
* @return property as number or undefined if the key is not found |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getNumberProperty(key) { |
|
|
|
getNumberProperty(key) { |
|
|
|
let mediaProperties = this.getMediaProperties(); |
|
|
|
let allProperties = this.getAllProperties(); |
|
|
|
if (mediaProperties !== undefined) { |
|
|
|
if (allProperties !== undefined) { |
|
|
|
return mediaProperties[key]; |
|
|
|
return allProperties[key]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return undefined; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the property associated with the key. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param key property key |
|
|
|
|
|
|
|
* @return property as an object or undefined if the key is not found |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
getProperty(key) { |
|
|
|
|
|
|
|
let allProperties = this.getAllProperties(); |
|
|
|
|
|
|
|
if (allProperties !== undefined) { |
|
|
|
|
|
|
|
return allProperties[key]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return undefined; |
|
|
|
return undefined; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the media properties associated with the key. |
|
|
|
* Returns the format property associated with the key. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key properties key |
|
|
|
* @param key property key |
|
|
|
* @return media properties as an object or undefined if the key is not found |
|
|
|
* @return format property as string or undefined if the key is not found |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getProperties(key) { |
|
|
|
getStringFormatProperty(key) { |
|
|
|
let mediaProperties = this.getMediaProperties(); |
|
|
|
let formatProperties = this.getFormatProperties(); |
|
|
|
if (mediaProperties !== undefined) { |
|
|
|
if (formatProperties !== undefined) { |
|
|
|
return mediaProperties[key]; |
|
|
|
return formatProperties[key]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return undefined; |
|
|
|
return undefined; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns all media properties. |
|
|
|
* Returns the format property associated with the key. |
|
|
|
* |
|
|
|
* |
|
|
|
* @returns an object where media properties can be accessed by property names |
|
|
|
* @param key property key |
|
|
|
|
|
|
|
* @return format property as number or undefined if the key is not found |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getMediaProperties() { |
|
|
|
getNumberFormatProperty(key) { |
|
|
|
|
|
|
|
let formatProperties = this.getFormatProperties(); |
|
|
|
|
|
|
|
if (formatProperties !== undefined) { |
|
|
|
|
|
|
|
return formatProperties[key]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return undefined; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns the format property associated with the key. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param key property key |
|
|
|
|
|
|
|
* @return format property as an object or undefined if the key is not found |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
getFormatProperty(key) { |
|
|
|
|
|
|
|
let formatProperties = this.getFormatProperties(); |
|
|
|
|
|
|
|
if (formatProperties !== undefined) { |
|
|
|
|
|
|
|
return formatProperties[key]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return undefined; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns all format properties defined. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @returns an object where format properties can be accessed by property names |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
getFormatProperties() { |
|
|
|
if (this.#allProperties !== undefined) { |
|
|
|
if (this.#allProperties !== undefined) { |
|
|
|
return this.#allProperties.format; |
|
|
|
return this.#allProperties[MediaInformation.KEY_FORMAT_PROPERTIES]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return undefined; |
|
|
|
return undefined; |
|
|
|
} |
|
|
|
} |
|
|
@ -2677,13 +2681,6 @@ export class MediaInformationJsonParser { |
|
|
|
export class MediaInformationSession extends AbstractSession { |
|
|
|
export class MediaInformationSession extends AbstractSession { |
|
|
|
#mediaInformation; |
|
|
|
#mediaInformation; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Creates an empty MediaInformationSession. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
constructor() { |
|
|
|
|
|
|
|
super(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Creates a new MediaInformationSession session. |
|
|
|
* Creates a new MediaInformationSession session. |
|
|
|
* |
|
|
|
* |
|
|
@ -2702,16 +2699,6 @@ export class MediaInformationSession extends AbstractSession { |
|
|
|
return session; |
|
|
|
return session; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Creates a new MediaInformationSession from the given map. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param sessionMap map that includes session fields as map keys |
|
|
|
|
|
|
|
* @returns MediaInformationSession created |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
static fromMap(sessionMap) { |
|
|
|
|
|
|
|
return AbstractSession.createMediaInformationSessionFromMap(sessionMap); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the media information extracted in this session. |
|
|
|
* Returns the media information extracted in this session. |
|
|
|
* |
|
|
|
* |
|
|
@ -3104,7 +3091,7 @@ export class StreamInformation { |
|
|
|
* @return tags object |
|
|
|
* @return tags object |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getTags() { |
|
|
|
getTags() { |
|
|
|
return this.getProperties(StreamInformation.KEY_TAGS); |
|
|
|
return this.getProperty(StreamInformation.KEY_TAGS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -3136,12 +3123,12 @@ export class StreamInformation { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the stream properties associated with the key. |
|
|
|
* Returns the stream property associated with the key. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key properties key |
|
|
|
* @param key property key |
|
|
|
* @return stream properties as an object or undefined if the key is not found |
|
|
|
* @return stream property as an object or undefined if the key is not found |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getProperties(key) { |
|
|
|
getProperty(key) { |
|
|
|
if (this.#allProperties !== undefined) { |
|
|
|
if (this.#allProperties !== undefined) { |
|
|
|
return this.#allProperties[key]; |
|
|
|
return this.#allProperties[key]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -3238,7 +3225,7 @@ export class Chapter { |
|
|
|
* @return tags object |
|
|
|
* @return tags object |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getTags() { |
|
|
|
getTags() { |
|
|
|
return this.getProperties(StreamInformation.KEY_TAGS); |
|
|
|
return this.getProperty(StreamInformation.KEY_TAGS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -3270,12 +3257,12 @@ export class Chapter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns the chapter properties associated with the key. |
|
|
|
* Returns the chapter property associated with the key. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key properties key |
|
|
|
* @param key property key |
|
|
|
* @return chapter properties as an object or undefined if the key is not found |
|
|
|
* @return chapter property as an object or undefined if the key is not found |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
getProperties(key) { |
|
|
|
getProperty(key) { |
|
|
|
if (this.#allProperties !== undefined) { |
|
|
|
if (this.#allProperties !== undefined) { |
|
|
|
return this.#allProperties[key]; |
|
|
|
return this.#allProperties[key]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|