A complete transcoding job. More...
Public Member Functions | |
QtlMovieJob (QtlMovieTask *task, const QtlMovieSettings *settings, QtlLogger *log, QObject *parent=0) | |
Constructor. More... | |
virtual void | abort () Q_DECL_OVERRIDE |
Abort the transcoding job. More... | |
int | currentActionCount () const |
Get the index of currently executing action. More... | |
int | currentProgress (int currentActionProgress, int currentActionMaximum=100, int jobMaximum=100) const |
Get an indication of the total progress within the job. More... | |
QStringList | getVariable (const QString &name) const |
Get the value of a variable in the job. More... | |
void | setVariable (const QString &name, const QStringList &value) |
Store a variable in the job. More... | |
virtual bool | start () Q_DECL_OVERRIDE |
Start the transcoding job. More... | |
QtlMovieTask * | task () const |
Get the task to process. More... | |
int | totalActionCount () const |
Get the total number of actions in this job. More... | |
![]() | |
QtlMovieAction (const QtlMovieSettings *settings, QtlLogger *log, QObject *parent=0) | |
Constructor. More... | |
virtual | ~QtlMovieAction () |
Virtual destructor. More... | |
virtual void | debug (const QString &line, const QColor &color=QColor()) Q_DECL_OVERRIDE |
Log a line of debug text. More... | |
QString | description () const |
Get the description of the action. More... | |
int | elapsedSeconds () const |
Get the number of seconds since the action started. More... | |
bool | isCompleted () const |
Check if the action is completed. More... | |
bool | isSilent () const |
Check if unimportant messages are skipped. More... | |
bool | isStarted () const |
Check if the action was started (and possibly completed in the meantime). More... | |
virtual void | line (const QString &line, const QColor &color=QColor()) Q_DECL_OVERRIDE |
Log a line of text. More... | |
void | setDescription (const QString &description) |
Set the description of the action. More... | |
void | setSilent (bool silent) |
Set if unimportant messages are skipped. More... | |
const QtlMovieSettings * | settings () const |
Get the application settings. More... | |
virtual void | text (const QString &text) Q_DECL_OVERRIDE |
Log text. More... | |
Static Public Member Functions | |
static bool | canInsertSubtitles (const QString &subtitleFileName) |
Check if it is possible to insert subtitles from the specified file. More... | |
static bool | canTranscode (const QtlMovieInputFile *inputFile, QtlMovieOutputFile::OutputType outputType) |
Check if it is possible to transcode an input file (with its streams selections) to an output type. More... | |
Protected Member Functions | |
virtual void | emitCompleted (bool success, const QString &message=QString()) Q_DECL_OVERRIDE |
Emit the completed() signal. More... | |
![]() | |
virtual void | emitProgress (int current, int maximum, int remainingSeconds=-1) |
Emit the progress() signal. More... | |
Private Slots | |
void | actionCompleted (bool success) |
Invoked each time an action completes. More... | |
Private Member Functions | |
QtlMovieJob () Q_DECL_EQ_DELETE | |
bool | abortStart (const QString &message, bool result=false) |
Report an error during start() and abort the job. More... | |
bool | addBurnDvd (const QString &isoFile, const QString &dvdBurner) |
Add the process for burning a DVD ISO image. More... | |
bool | addExtractSubtitle (const QtlMovieInputFile *inputFile, QString &outputFileName, bool &internallyCreated, bool convertSsaToSrt, bool srtMandatory) |
Add a process for extracting subtitles into a file. More... | |
bool | addFFmpeg (const QString &description, const QStringList ffmpegArguments, bool originalInput) |
Add an FFmpeg process in the process list. More... | |
bool | addSubtitleFileVideoFilter (QString &videoFilters, int widthIn, int heightIn, const QString &subtitleFileName) |
Compute an FFmpeg video filter for burning subtitles from an external file into video. More... | |
bool | addSubtitleStreamVideoFilter (QString &videoFilters, const QtlMovieInputFile *inputFile, int widthOut, int heightOut) |
Compute an FFmpeg video filter for burning subtitles from a stream of the input file into video. More... | |
bool | addTextSubtitleFileVideoFilter (QString &videoFilters, const QString &filterName, int widthIn, int heightIn, const QString &subtitleFileName) |
Compute an FFmpeg video filter for burning text subtitles from an external file into video. More... | |
bool | addTranscodeAudioVideoToDvd (const QtlMovieInputFile *inputFile, const QString &outputFileName) |
Add the processes for simple audio/video transcoding to DVD. More... | |
bool | addTranscodeToAvi (const QtlMovieInputFile *inputFile, const QString &outputFileName) |
Add a process for transcoding to AVI. More... | |
bool | addTranscodeToDvdFile (const QtlMovieInputFile *inputFile, const QString &outputFileName) |
Add the processes for transcoding to a final DVD media file. More... | |
bool | addTranscodeToDvdIsoImage (const QtlMovieInputFile *inputFile, const QString &outputFileName) |
Add the processes for transcoding to a DVD ISO image. More... | |
bool | addTranscodeToMp4 (const QtlMovieInputFile *inputFile, const QString &outputFileName, const QtlMovieDeviceProfile &profile, int videoQuality) |
Add a process for transcoding to MP4 (iPad, iPhone). More... | |
bool | buildScenario () |
Build the list of actions to execute to perform the job. More... | |
QStringList | chapterOptions (int totalSeconds, int chapterSeconds) |
Build a DVD Author option list to create chapters. More... | |
void | cleanup () |
Cleanup the job environment. More... | |
void | setExternalSubtitleFileName (QtlMovieInputFile *&inputFile, const QString &subtitleFile) |
Change the name of the external subtitle file. More... | |
bool | startNextAction () |
Start the next action in the list. More... | |
Private Attributes | |
int | _actionCount |
Number of actions to execute on start. More... | |
QList< QtlMovieAction * > | _actionList |
List of actions to execute. More... | |
int | _outSeconds |
Output file duration in seconds. More... | |
QtlMovieTask * | _task |
Task to process. More... | |
QString | _tempDir |
Directory of temporary files, to delete after completion. More... | |
QMap< QString, QStringList > | _variables |
Set of job variables. More... | |
Additional Inherited Members | |
![]() | |
void | completed (bool success) |
Emitted when the action completes. More... | |
void | progress (const QString &description, int current, int maximum, int elapsedSeconds, int remainingSeconds) |
Emitted when some progress in the reporting is available. More... | |
void | started () |
Emitted when the action starts. More... | |
A complete transcoding job.
Involves one or more QtlMovieAction.
QtlMovieJob::QtlMovieJob | ( | QtlMovieTask * | task, |
const QtlMovieSettings * | settings, | ||
QtlLogger * | log, | ||
QObject * | parent = 0 |
||
) |
Constructor.
[in] | task | The task to process. |
[in] | settings | Application settings. |
[in] | log | Message logger. |
[in] | parent | Optional parent object. |
|
private |
|
virtual |
Start the transcoding job.
Reimplemented from QtlMovieAction.
|
virtual |
Abort the transcoding job.
If the job was started, the signal completed() will be emitted when all actions actually terminate.
Reimplemented from QtlMovieAction.
|
inline |
Get the task to process.
|
inline |
Get the total number of actions in this job.
Available after start.
|
inline |
Get the index of currently executing action.
Available after start.
int QtlMovieJob::currentProgress | ( | int | currentActionProgress, |
int | currentActionMaximum = 100 , |
||
int | jobMaximum = 100 |
||
) | const |
Get an indication of the total progress within the job.
Given an estimation of the progress within the current action, we return an estimation of the progress in the entire job. We assume that all actions have the same duration, which is of course wrong.
[in] | currentActionProgress | Current progress in the current action. Shall be in the range 0 to currentActionMaximum. |
[in] | currentActionMaximum | Value for completion of the current action. |
[in] | jobMaximum | Value for completion of the entire job. |
void QtlMovieJob::setVariable | ( | const QString & | name, |
const QStringList & | value | ||
) |
Store a variable in the job.
[in] | name | Variable name. |
[in] | value | Variable value as a list of strings. |
QStringList QtlMovieJob::getVariable | ( | const QString & | name | ) | const |
Get the value of a variable in the job.
[in] | name | Variable name. |
|
static |
Check if it is possible to transcode an input file (with its streams selections) to an output type.
[in] | inputFile | The input file. |
[in] | outputType | The target output type. |
|
static |
Check if it is possible to insert subtitles from the specified file.
[in] | subtitleFileName | The subtitle file. |
|
protectedvirtual |
Emit the completed() signal.
[in] | success | True when the action completed successfully, false otherwise. |
[in] | message | Optional error message to log. |
Reimplemented from QtlMovieAction.
|
privateslot |
Invoked each time an action completes.
[in] | success | Indicates whether the action succeeded or failed. |
|
private |
Cleanup the job environment.
|
private |
Build the list of actions to execute to perform the job.
|
private |
Report an error during start() and abort the job.
The error message is reported both in a message box and in the log.
[in] | message | Message to display. |
[in] | result | The value to return, false by default. |
|
private |
Start the next action in the list.
|
private |
Add an FFmpeg process in the process list.
[in] | description | Description of this process. |
[in] | ffmpegArguments | FFmpeg arguments, empty meaning error. |
[in] | originalInput | If true, the input is the original input file, otherwise it is some intermediate file. |
|
private |
Compute an FFmpeg video filter for burning subtitles from an external file into video.
[in,out] | videoFilters | A video filter string which is updated. |
[in] | widthIn | Input video width in pixels. |
[in] | heightIn | Input video height in pixels. |
[in] | subtitleFileName | Name of the subtitle file. |
|
private |
Compute an FFmpeg video filter for burning text subtitles from an external file into video.
[in,out] | videoFilters | A video filter string which is updated. |
[in] | filterName | Filter name, usually "subtitles" or "ass". |
[in] | widthIn | Input video width in pixels. |
[in] | heightIn | Input video height in pixels. |
[in] | subtitleFileName | Name of the subtitle file. |
|
private |
Compute an FFmpeg video filter for burning subtitles from a stream of the input file into video.
[in,out] | videoFilters | A video filter string which is updated. |
[in] | inputFile | Input file with one selected subtitle stream. |
[in] | widthOut | Output video width in pixels. |
[in] | heightOut | Output video height in pixels. |
|
private |
Build a DVD Author option list to create chapters.
[in] | totalSeconds | Total duration of the movie in seconds or zero if unknown. |
[in] | chapterSeconds | Duration of a chapter in seconds or zero if none. |
|
private |
Add the processes for simple audio/video transcoding to DVD.
[in] | inputFile | The input file. |
[in] | outputFileName | The output file name. |
|
private |
Add the processes for transcoding to a final DVD media file.
[in] | inputFile | The input file. |
[in] | outputFileName | The output file name. |
|
private |
Add the processes for transcoding to a DVD ISO image.
[in] | inputFile | The input file. |
[in] | outputFileName | The output file name. |
|
private |
Add the process for burning a DVD ISO image.
[in] | isoFile | The input ISO image. |
[in] | dvdBurner | The DVD burner drive name (see QtlOpticalDrive::name()). |
|
private |
Add a process for transcoding to MP4 (iPad, iPhone).
[in] | inputFile | The input file. |
[in] | outputFileName | The output file name. |
[in] | profile | Description of output device. |
[in] | videoQuality | Video quality indicator in bits / frame / 100 pixels. |
|
private |
Add a process for transcoding to AVI.
[in] | inputFile | The input file. |
[in] | outputFileName | The output file name. |
|
private |
Add a process for extracting subtitles into a file.
The supported input subtitle types are SRT, SSA, ASS and Teletext (MPEG-TS input file only).
[in] | inputFile | The input file. |
[in,out] | outputFileName | The output subtitle file name. Its suffix, when present, is used to determine the output subtitle format. Without suffix, the appropriate type is automatically selected and the file name is updated. |
[out] | internallyCreated | Returned as true if the subtitles file is internally created, using code from this application. Returned as false when the subtitles files is created by some external tool such as ffmpeg or ccextractor. |
[in] | convertSsaToSrt | If true, the SSA/ASS subtitles are converted to SRT. |
[in] | srtMandatory | If true, the output format must be SRT, otherwise fails. |
|
private |
Change the name of the external subtitle file.
[in,out] | inputFile | A pointer to the input file. The pointer value is updated it previously contains a pointer to the original input file. In that case, a new input file object is created. It will be deleted with this job instance. |
[in] | subtitleFile | The new subtitle file name. Ignored if empty. |
|
private |
Task to process.
|
private |
Output file duration in seconds.
|
private |
Number of actions to execute on start.
|
private |
Directory of temporary files, to delete after completion.
|
private |
List of actions to execute.
|
private |
Set of job variables.