|
|
const | TASK_LABEL = 'Execute FFmpeg for media conversion' |
| | Human readable task name/label.
|
| |
|
Names of config settings used by this task
|
|
const | CONF_SOURCES = "FFMPEG_IN" |
| | Filenames or filemasks to process as input.
|
| |
|
const | CONF_TARGETS = "FFMPEG_OUT" |
| | Output filenames (may include path).
|
| |
|
const | CONF_RECIPES = "FFMPEG_RECIPE" |
| | Commandline "recipes" to execute FFmpeg transcoding, etc. This includes path+name of FFmpeg binary.
|
| |
|
const | CONF_VALIDATES = "FFMPEG_VALIDATE" |
| | Flag to enable content hash validation. Used to confirm lossless codec or container changes.
|
| |
|
Array keys for handling $todoList.
|
|
const | TODO_RECIPE = 'recipe' |
| | Array key for recipe in $todoList.
|
| |
|
const | TODO_IN = 'in' |
| | Array key for input files in $todoList.
|
| |
|
const | TODO_OUT = 'out' |
| | Array key for output files in $todoList.
|
| |
|
const | TODO_VALIDATE = 'validate' |
| | Array key for flag "to validate or not".
|
| |
|
const | TASK_LABEL = 'Execute external programs (abstract)' |
| |
|
const | EXIT_STATUS_DONE = 0 |
| | Success! This means the task completed successfully.
|
| |
|
const | EXIT_STATUS_WAIT = 5 |
| | Task decided that Item is not ready yet and shall be moved back to 'to-do'.
|
| |
|
const | EXIT_STATUS_PBCT = 6 |
| | There were problems, but the task may continue.
|
| |
|
const | EXIT_STATUS_PBC = 7 |
| | There were problems, but subsequent task may continue.
|
| |
|
const | EXIT_STATUS_ERROR = 10 |
| | An error occurred. Abort execution as soon as possible.
|
| |
|
const | EXIT_STATUS_CONFIG_ERROR = 11 |
| | If a config option was not valid.
|
| |
|
const | EXIT_STATUS_SKIPPED = 15 |
| | If task was skipped.
|
| |
|
const | STATUS_UNDEFINED = 0 |
| | Undefined. Default unless task changes it.
|
| |
|
const | STATUS_RUNNING = 1 |
| | Undefined, but indicates that the task is in progress.
|
| |
|
const | STATUS_WAIT = 2 |
| | Task decided that Item is not ready yet and shall be moved back to 'to-do'.
|
| |
|
const | STATUS_DONE = 5 |
| | Success! This means the task completed successfully.
|
| |
|
const | STATUS_PBCT = 6 |
| | There were problems, but the task may continue.
|
| |
|
const | STATUS_PBC = 7 |
| | There were problems, but subsequent task may continue.
|
| |
|
const | STATUS_ERROR = 10 |
| | An error occurred. Abort execution as soon as possible.
|
| |
|
const | STATUS_CONFIG_ERROR = 11 |
| | If a config option was not valid.
|
| |
|
const | STATUS_SKIPPED = 15 |
| | If task was skipped.
|
| |
|
const | ONCE_PER_ITEM = false |
| | True: Run this task only once per item.
|
| |
|
const | IS_RECURSIVE = false |
| | Default (false): one task = one folder. True: The task performs actions on subfolders too.
|
| |
|
const | CONF_COPY_EXCLUDE = 'COPY_EXCLUDE' |
| | Patterns which files to exclude from copying.
|
| |
|
const | MASK_TARGET_TEMP = 'temp_%s' |
| |
|
|
| | checkArrayKeysMatch ($a1, $a2) |
| |
| | convertFile ($recipe, $sourceFile, $targetFile) |
| |
| | getMatchingFiles ($folder, $patterns) |
| |
| | resolveInOut ($source, $target) |
| |
| | checkTargetExists ($targets) |
| |
| | createTodoList ($sources, $targets, $recipes, $validates) |
| |
| | isCmdValid ($command) |
| |
| | resolveCmd ($command, $arguments=null) |
| |
| | runScript ($script) |
| |
| | setStatusByExitcode ($exitCode) |
| |
| | getCmdLogfile ($prefix=null) |
| |
| | removeCmdLogfile ($logFile=null) |
| |
| | writeToCmdLogfile ($msg, $logFile=null) |
| |
| | setName ($name) |
| |
| | exclude ($file, $excludePatterns) |
| |
| | optionIsArray ($option, $optionName) |
| |
| | resolveTargetFolderTemp ($CIFolder=null) |
| |
| | setStatus ($status) |
| |
| | setStatusUndefined () |
| |
| | setStatusRunning () |
| |
| | setStatusWait () |
| |
| | setStatusDone () |
| |
| | setStatusPBCT () |
| |
| | setStatusPBC () |
| |
| | setStatusSkipped () |
| |
| | setStatusError () |
| |
| | setStatusConfigError () |
| |
| | checkTempFolder () |
| |
| | getTempFolder () |
| |
| | setTempFolder ($tempFolder=null) |
| |
| | loadSettings () |
| |
Task for executing FFmpeg to convert media files. Simple version.
Allows: 1 input, 1 output file per recipe. For more complex FFmpeg-foo, it's probably better to create a separate task type.
TODO:
- What about some form of presets for target formats/recipes?
- Author
- Peter Bubestinger-Steindl (pb@av.nosp@m.-rd..nosp@m.com)
- Copyright
- Copyright 2019 AV-RD e.U. (License: GNU General Public License (v3))
- See also
-
| TaskFFmpeg::resolveInOut |
( |
|
$source, |
|
|
|
$target |
|
) |
| |
|
protected |
Iterates through options set in '$sources' and resolves it to a single array, where each entry is a single file.
This is used to resolve filemasks (e.g. *.avi, *.mkv, etc), but compatible to setting wildcard-free filenames explicitely in '$sources'.
At the same time, it Iterates through options set in '$targets' and resolves it to a single array, where each entry is also a single filename.
$sources and $targets /must/ always have the same number of entries in matching order, as each IN will be matched to its corresponding OUT setting.