FFmpegKit Linux API 6.0
Loading...
Searching...
No Matches
Static Public Member Functions
ffmpegkit::FFmpegKit Class Reference

#include <FFmpegKit.h>

Static Public Member Functions

static std::shared_ptr< ffmpegkit::FFmpegSessionexecuteWithArguments (const std::list< std::string > &arguments)
 
static std::shared_ptr< ffmpegkit::FFmpegSessionexecuteWithArgumentsAsync (const std::list< std::string > &arguments, FFmpegSessionCompleteCallback completeCallback)
 
static std::shared_ptr< ffmpegkit::FFmpegSessionexecuteWithArgumentsAsync (const std::list< std::string > &arguments, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback)
 
static std::shared_ptr< ffmpegkit::FFmpegSessionexecute (const std::string command)
 
static std::shared_ptr< ffmpegkit::FFmpegSessionexecuteAsync (const std::string command, FFmpegSessionCompleteCallback completeCallback)
 
static std::shared_ptr< ffmpegkit::FFmpegSessionexecuteAsync (const std::string command, FFmpegSessionCompleteCallback completeCallback, ffmpegkit::LogCallback logCallback, ffmpegkit::StatisticsCallback statisticsCallback)
 
static void cancel ()
 
static void cancel (const long sessionId)
 
static std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::FFmpegSession > > > listSessions ()
 

Detailed Description

Main class to run FFmpeg commands. Supports executing commands both synchronously and asynchronously.

auto session = FFmpegKit::execute:("-i file1.mp4 -c:v libxvid file1.avi");

auto asyncSession = FFmpegKit::executeAsync:("-i file1.mp4 -c:v libxvid file1.avi", [](auto session){ ... });

Provides overloaded execute methods to define session specific callbacks.

auto asyncSession = FFmpegKit::executeAsync:("-i file1.mp4 -c:v libxvid file1.avi, [](auto session){ ... }, [](auto log){ ... }, [](auto statistics){ ... });

Definition at line 44 of file FFmpegKit.h.

Member Function Documentation

◆ cancel() [1/2]

void ffmpegkit::FFmpegKit::cancel ( )
static

Cancels all running sessions.

This method does not wait for termination to complete and returns immediately.

Definition at line 69 of file FFmpegKit.cpp.

◆ cancel() [2/2]

void ffmpegkit::FFmpegKit::cancel ( const long  sessionId)
static

Cancels the session specified with sessionId.

This method does not wait for termination to complete and returns immediately.

Parameters
sessionIdid of the session that will be cancelled

Definition at line 78 of file FFmpegKit.cpp.

◆ execute()

std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegkit::FFmpegKit::execute ( const std::string  command)
static

Synchronously executes FFmpeg command provided. Space character is used to split command into arguments. You can use single or double quote characters to specify arguments inside your command.

Parameters
commandFFmpeg command
Returns
FFmpeg session created for this execution

Definition at line 51 of file FFmpegKit.cpp.

◆ executeAsync() [1/2]

std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegkit::FFmpegKit::executeAsync ( const std::string  command,
FFmpegSessionCompleteCallback  completeCallback 
)
static

Starts an asynchronous FFmpeg execution for the given command. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command.

Note that this method returns immediately and does not wait the execution to complete. You must use an FFmpegSessionCompleteCallback if you want to be notified about the result.

Parameters
commandFFmpeg command
completeCallbackcallback that will be called when the execution has completed
Returns
FFmpeg session created for this execution

Definition at line 57 of file FFmpegKit.cpp.

◆ executeAsync() [2/2]

std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegkit::FFmpegKit::executeAsync ( const std::string  command,
FFmpegSessionCompleteCallback  completeCallback,
ffmpegkit::LogCallback  logCallback,
ffmpegkit::StatisticsCallback  statisticsCallback 
)
static

Starts an asynchronous FFmpeg execution for the given command. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command.

Note that this method returns immediately and does not wait the execution to complete. You must use an FFmpegSessionCompleteCallback if you want to be notified about the result.

Parameters
commandFFmpeg command
completeCallbackcallback that will be called when the execution has completed
logCallbackcallback that will receive logs
statisticsCallbackcallback that will receive statistics
Returns
FFmpeg session created for this execution

Definition at line 63 of file FFmpegKit.cpp.

◆ executeWithArguments()

std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegkit::FFmpegKit::executeWithArguments ( const std::list< std::string > &  arguments)
static

Synchronously executes FFmpeg with arguments provided.

Parameters
argumentsFFmpeg command options/arguments as string list
Returns
FFmpeg session created for this execution

Definition at line 33 of file FFmpegKit.cpp.

◆ executeWithArgumentsAsync() [1/2]

std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegkit::FFmpegKit::executeWithArgumentsAsync ( const std::list< std::string > &  arguments,
FFmpegSessionCompleteCallback  completeCallback 
)
static

Starts an asynchronous FFmpeg execution with arguments provided.

Note that this method returns immediately and does not wait the execution to complete. You must use an FFmpegSessionCompleteCallback if you want to be notified about the result.

Parameters
argumentsFFmpeg command options/arguments as string list
completeCallbackcallback that will be called when the execution has completed
Returns
FFmpeg session created for this execution

Definition at line 39 of file FFmpegKit.cpp.

◆ executeWithArgumentsAsync() [2/2]

std::shared_ptr< ffmpegkit::FFmpegSession > ffmpegkit::FFmpegKit::executeWithArgumentsAsync ( const std::list< std::string > &  arguments,
FFmpegSessionCompleteCallback  completeCallback,
ffmpegkit::LogCallback  logCallback,
ffmpegkit::StatisticsCallback  statisticsCallback 
)
static

Starts an asynchronous FFmpeg execution with arguments provided.

Note that this method returns immediately and does not wait the execution to complete. You must use an FFmpegSessionCompleteCallback if you want to be notified about the result.

Parameters
argumentsFFmpeg command options/arguments as string list
completeCallbackcallback that will be called when the execution has completed
logCallbackcallback that will receive logs
statisticsCallbackcallback that will receive statistics
Returns
FFmpeg session created for this execution

Definition at line 45 of file FFmpegKit.cpp.

◆ listSessions()

std::shared_ptr< std::list< std::shared_ptr< ffmpegkit::FFmpegSession > > > ffmpegkit::FFmpegKit::listSessions ( )
static

Lists all FFmpeg sessions in the session history.

Returns
all FFmpeg sessions in the session history

Definition at line 82 of file FFmpegKit.cpp.


The documentation for this class was generated from the following files: