-
- All Implemented Interfaces:
-
com.arthenica.ffmpegkit.Session
public class FFmpegSession extends AbstractSession implements Session
An FFmpeg session.
-
-
Field Summary
Fields Modifier and Type Field Description private final StatisticsCallback
statisticsCallback
private final FFmpegSessionCompleteCallback
completeCallback
private final List<Statistics>
statistics
-
Method Summary
Modifier and Type Method Description StatisticsCallback
getStatisticsCallback()
Returns the session specific statistics callback. FFmpegSessionCompleteCallback
getCompleteCallback()
Returns the session specific complete callback. List<Statistics>
getStatistics()
Returns all statistics entries delivered for this session. static FFmpegSession
create(Array<String> arguments)
Builds a new FFmpeg session. static FFmpegSession
create(Array<String> arguments, FFmpegSessionCompleteCallback completeCallback)
Builds a new FFmpeg session. static FFmpegSession
create(Array<String> arguments, FFmpegSessionCompleteCallback completeCallback, LogCallback logCallback, StatisticsCallback statisticsCallback)
Builds a new FFmpeg session. static FFmpegSession
create(Array<String> arguments, FFmpegSessionCompleteCallback completeCallback, LogCallback logCallback, StatisticsCallback statisticsCallback, LogRedirectionStrategy logRedirectionStrategy)
Builds a new FFmpeg session. List<Statistics>
getAllStatistics(int waitTimeout)
Returns all statistics entries generated for this session. List<Statistics>
getAllStatistics()
Returns all statistics entries generated for this session. Statistics
getLastReceivedStatistics()
Returns the last received statistics entry. void
addStatistics(Statistics statistics)
Adds a new statistics entry for this session. boolean
isFFmpeg()
Returns whether it is an FFmpeg
session or not.boolean
isFFprobe()
Returns whether it is an FFprobe
session or not.boolean
isMediaInformation()
Returns whether it is a MediaInformation
session or not.String
toString()
-
Methods inherited from class com.arthenica.ffmpegkit.AbstractSession
addLog, cancel, getAllLogs, getAllLogs, getAllLogsAsString, getAllLogsAsString, getArguments, getCommand, getCreateTime, getDuration, getEndTime, getFailStackTrace, getFuture, getLogCallback, getLogRedirectionStrategy, getLogs, getLogsAsString, getOutput, getReturnCode, getSessionId, getStartTime, getState, thereAreAsynchronousMessagesInTransmit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getStatisticsCallback
StatisticsCallback getStatisticsCallback()
Returns the session specific statistics callback.
-
getCompleteCallback
FFmpegSessionCompleteCallback getCompleteCallback()
Returns the session specific complete callback.
-
getStatistics
List<Statistics> getStatistics()
Returns all statistics entries delivered for this session. Note that if there areasynchronous messages that are not delivered yet, this method will not wait forthem and will return immediately.
-
create
static FFmpegSession create(Array<String> arguments)
Builds a new FFmpeg session.
- Parameters:
arguments
- command arguments
-
create
static FFmpegSession create(Array<String> arguments, FFmpegSessionCompleteCallback completeCallback)
Builds a new FFmpeg session.
- Parameters:
arguments
- command argumentscompleteCallback
- session specific complete callback
-
create
static FFmpegSession create(Array<String> arguments, FFmpegSessionCompleteCallback completeCallback, LogCallback logCallback, StatisticsCallback statisticsCallback)
Builds a new FFmpeg session.
- Parameters:
arguments
- command argumentscompleteCallback
- session specific complete callbacklogCallback
- session specific log callbackstatisticsCallback
- session specific statistics callback
-
create
static FFmpegSession create(Array<String> arguments, FFmpegSessionCompleteCallback completeCallback, LogCallback logCallback, StatisticsCallback statisticsCallback, LogRedirectionStrategy logRedirectionStrategy)
Builds a new FFmpeg session.
- Parameters:
arguments
- command argumentscompleteCallback
- session specific complete callbacklogCallback
- session specific log callbackstatisticsCallback
- session specific statistics callbacklogRedirectionStrategy
- session specific log redirection strategy
-
getAllStatistics
List<Statistics> getAllStatistics(int waitTimeout)
Returns all statistics entries generated for this session. If there are asynchronousmessages that are not delivered yet, this method waits for them until the given timeout.
- Parameters:
waitTimeout
- wait timeout for asynchronous messages in milliseconds
-
getAllStatistics
List<Statistics> getAllStatistics()
Returns all statistics entries generated for this session. If there are asynchronousmessages that are not delivered yet, this method waits for them until DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT expires.
-
getLastReceivedStatistics
Statistics getLastReceivedStatistics()
Returns the last received statistics entry.
-
addStatistics
void addStatistics(Statistics statistics)
Adds a new statistics entry for this session. It is invoked internally by
FFmpegKit
library methods. Must not be used by user applications.- Parameters:
statistics
- statistics entry
-
isFFmpeg
boolean isFFmpeg()
Returns whether it is an
FFmpeg
session or not.
-
isFFprobe
boolean isFFprobe()
Returns whether it is an
FFprobe
session or not.
-
isMediaInformation
boolean isMediaInformation()
Returns whether it is a
MediaInformation
session or not.
-
-
-
-