QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlMovieFFmpegVolumeDetect Class Reference

An execution of FFmpeg with the audio filter "volumedetect". More...

Inheritance diagram for QtlMovieFFmpegVolumeDetect:
QtlMovieFFmpegProcess QtlMovieProcess QtlMovieAction QtlLogger

Public Member Functions

 QtlMovieFFmpegVolumeDetect (const QString &inputFile, const QString &audioStream, int inputDurationInSeconds, const QString &temporaryDirectory, const QtlMovieSettings *settings, QtlLogger *log, QObject *parent=0, QtlDataPull *dataPull=0)
 Constructor. More...
 
- Public Member Functions inherited from QtlMovieFFmpegProcess
 QtlMovieFFmpegProcess (const QStringList &ffmpegArguments, int inputDurationInSeconds, const QString &temporaryDirectory, const QtlMovieSettings *settings, QtlLogger *log, QObject *parent=0, QtlDataPull *dataPull=0)
 Constructor. More...
 
virtual bool start () Q_DECL_OVERRIDE
 Start the process. More...
 
- Public Member Functions inherited from QtlMovieProcess
 QtlMovieProcess (const QtlMovieExecFile *execFile, const QStringList &arguments, bool hasBinaryOutput, const QtlMovieSettings *settings, QtlLogger *log, QObject *parent=0, QtlDataPull *dataPull=0)
 Constructor. More...
 
virtual void abort () Q_DECL_OVERRIDE
 Abort process execution. More...
 
QStringList arguments () const
 Get the command line arguments. More...
 
const QtlMovieExecFileexecFile () const
 Get the command executable file. More...
 
QIODevice * outputDevice () const
 Return the device from which standard output can be read. More...
 
void setArguments (const QStringList &arguments)
 Set the command line arguments. More...
 
void setPriority (Qtl::ProcessPriority priority)
 Set the process priority. More...
 
bool useDataPullProgressReport (bool on)
 Use the progress report from the QtlDataPull when possible. More...
 
bool useDataPullProgressReport () const
 Check if progress report from the QtlDataPull is active. More...
 
- Public Member Functions inherited from QtlMovieAction
 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 QtlMovieSettingssettings () const
 Get the application settings. More...
 
virtual void text (const QString &text) Q_DECL_OVERRIDE
 Log text. More...
 

Protected Member Functions

virtual void emitCompleted (bool success, const QString &message=QString()) Q_DECL_OVERRIDE
 Emit the completed() signal. More...
 
virtual void processOutputLine (QProcess::ProcessChannel channel, const QString &line) Q_DECL_OVERRIDE
 Process one text line from standard error. More...
 
- Protected Member Functions inherited from QtlMovieFFmpegProcess
virtual void updateEnvironment (QProcessEnvironment &env) Q_DECL_OVERRIDE
 Update the QProcessEnvironment for the target process before it starts. More...
 
- Protected Member Functions inherited from QtlMovieProcess
QStringList getJobVariable (const QString &name) const
 Get the value of a variable in the job. More...
 
void setJobVariable (const QString &name, const QStringList &value)
 Store a variable in the parent job. More...
 
- Protected Member Functions inherited from QtlMovieAction
virtual void emitProgress (int current, int maximum, int remainingSeconds=-1)
 Emit the progress() signal. More...
 

Private Member Functions

 QtlMovieFFmpegVolumeDetect () Q_DECL_EQ_DELETE
 
void buildAudioFilter ()
 Build the audio filter for audio normalization. More...
 
QString compandFilter (qreal inMean, qreal inPeak, qreal outMean, qreal outPeak)
 Build a "compand" filter. More...
 

Static Private Member Functions

static QStringList commandLineOptions (const QString &inputFile, const QString &audioStream, const QtlMovieSettings *settings)
 Build the FFmpeg command line options. More...
 
static QString realToString (qreal value, int fractional=1)
 Build a the string image of a real number. More...
 

Private Attributes

qreal _meanLevel
 Measured audio mean level in dBFS. More...
 
qreal _peakLevel
 Measured audio peak level in dBFS. More...
 

Additional Inherited Members

- Signals inherited from QtlMovieProcess
void readyReadOutputData ()
 Emitted when some binary data are available from standard output. More...
 
- Signals inherited from QtlMovieAction
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...
 

Detailed Description

An execution of FFmpeg with the audio filter "volumedetect".

At end of execution, determine if audio normalization is required and compute the corresponding audio filter. This audio filter is stored in the job variables and will be applied in any subsequent FFmpeg transcoding process.

Constructor & Destructor Documentation

◆ QtlMovieFFmpegVolumeDetect() [1/2]

QtlMovieFFmpegVolumeDetect::QtlMovieFFmpegVolumeDetect ( const QString &  inputFile,
const QString &  audioStream,
int  inputDurationInSeconds,
const QString &  temporaryDirectory,
const QtlMovieSettings settings,
QtlLogger log,
QObject *  parent = 0,
QtlDataPull dataPull = 0 
)

Constructor.

Parameters
[in]inputFileAudio file input specification.
[in]audioStreamAudio stream specification.
[in]inputDurationInSecondsInput file play duration in seconds or zero if unknown. Used as a hint to indicate progress.
[in]temporaryDirectoryDirectory of temporary files.
[in]settingsApplication settings.
[in]logMessage logger.
[in]parentOptional parent object.
[in]dataPullIf non zero, used to feed the standard input of the process.

◆ QtlMovieFFmpegVolumeDetect() [2/2]

QtlMovieFFmpegVolumeDetect::QtlMovieFFmpegVolumeDetect ( )
private

Member Function Documentation

◆ processOutputLine()

void QtlMovieFFmpegVolumeDetect::processOutputLine ( QProcess::ProcessChannel  channel,
const QString &  line 
)
protectedvirtual

Process one text line from standard error.

Parameters
[in]channelOrigin of the line (QProcess::StandardOutput or QProcess::StandardError).
[in]lineText line.

Reimplemented from QtlMovieFFmpegProcess.

◆ emitCompleted()

void QtlMovieFFmpegVolumeDetect::emitCompleted ( bool  success,
const QString &  message = QString() 
)
protectedvirtual

Emit the completed() signal.

Parameters
[in]successTrue when the action completed successfully, false otherwise.
[in]messageOptional error message to log.

Reimplemented from QtlMovieAction.

◆ commandLineOptions()

QStringList QtlMovieFFmpegVolumeDetect::commandLineOptions ( const QString &  inputFile,
const QString &  audioStream,
const QtlMovieSettings settings 
)
staticprivate

Build the FFmpeg command line options.

Parameters
[in]inputFileAudio file input specification.
[in]audioStreamAudio stream specification.
[in]settingsApplication settings.
Returns
Command line options.

◆ buildAudioFilter()

void QtlMovieFFmpegVolumeDetect::buildAudioFilter ( )
private

Build the audio filter for audio normalization.

◆ realToString()

static QString QtlMovieFFmpegVolumeDetect::realToString ( qreal  value,
int  fractional = 1 
)
inlinestaticprivate

Build a the string image of a real number.

Force "+" sign for positive number.

Parameters
[in]valueReal value.
[in]fractionalNumber of fractional digits.
Returns
Image string.

◆ compandFilter()

QString QtlMovieFFmpegVolumeDetect::compandFilter ( qreal  inMean,
qreal  inPeak,
qreal  outMean,
qreal  outPeak 
)
private

Build a "compand" filter.

Parameters
[in]inMeanInput mean volume.
[in]inPeakInput peak volume.
[in]outMeanOutput mean volume.
[in]outPeakOutput peak volume.
Returns
Filter string.

Member Data Documentation

◆ _meanLevel

qreal QtlMovieFFmpegVolumeDetect::_meanLevel
private

Measured audio mean level in dBFS.

◆ _peakLevel

qreal QtlMovieFFmpegVolumeDetect::_peakLevel
private

Measured audio peak level in dBFS.


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