public class FfmpegContentTransformerWorker
extends org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorker
executer, fileDetailsExecuter, VAR_SOURCE, VAR_TARGET, versionDetailsExecuter| Constructor and Description |
|---|
FfmpegContentTransformerWorker() |
| Modifier and Type | Method and Description |
|---|---|
protected org.gytheio.content.ContentReference |
createMultiTargetContentReference(String mediaType) |
protected boolean |
disableAudio(String sourceMimetype,
String targetMimetype)
Determines whether or not audio should be disabled for the given source and target mimetypes.
|
protected boolean |
disableSubtitles(String sourceMimetype,
String targetMimetype)
Determines whether or not subtitles should be disabled for the given source and target mimetypes.
|
protected boolean |
disableVideo(String sourceMimetype,
String targetMimetype)
Determines whether or not video should be disabled for the given source and target mimetypes.
|
protected String |
getCmdOptAudioBitrate() |
protected String |
getCmdOptAudioCodec() |
protected String |
getCmdOptVideoBitrate() |
protected String |
getCmdOptVideoCodec() |
protected String |
getComponentExclusionCommandOptions(String sourceMimetype,
String targetMimetype) |
protected String |
getFfmpegAudioCodec(String targetMediaType,
String gytheioAudioCodec) |
protected String |
getFfmpegVersionNumber() |
protected String |
getFfmpegVideoCodec(String gytheioVideoCodec) |
protected String |
getFormatCommandOptions(String sourceMimetype,
String targetMimetype) |
protected String |
getResolution(String details) |
protected String |
getSourceCommandOptions(File sourceFile,
File targetFile,
String sourceMimetype,
String targetMimetype,
org.gytheio.content.transform.options.TransformationOptions options) |
protected String |
getSourceTemporalCommandOptions(String sourceMimetype,
String targetMimetype,
org.gytheio.content.transform.options.TransformationOptions options)
Gets the ffmpeg command string for the time-based video conversion transform options
provided which apply to the source input
|
protected String |
getTargetAudioCommandOptions(String targetMediaType,
org.gytheio.content.transform.options.TransformationOptions options) |
protected String |
getTargetCommandOptions(File sourceFile,
File targetFile,
String sourceMimetype,
String targetMimetype,
org.gytheio.content.transform.options.TransformationOptions options) |
protected String |
getTargetResizeCommandOptions(org.gytheio.content.transform.options.TransformationOptions options,
File sourceFile)
Gets the ffmpeg command string for the transform options
provided
|
protected String |
getTargetTemporalCommandOptions(String sourceMimetype,
String targetMimetype,
org.gytheio.content.transform.options.TransformationOptions options)
Gets the ffmpeg command string for the time-based video conversion transform options
provided which apply to the target output
|
protected String |
getTargetVideoCommandOptions(String sourceMediaType,
String targetMediaType,
org.gytheio.content.transform.options.TransformationOptions options) |
protected String |
getVersionDetailOutput(String[] arguments)
Uses the executable defined in
versionDetailsExecuter with the
given alternative arguments to obtain additional version detail output |
protected String |
getVideoPresetOptions() |
protected void |
initializationTest() |
protected void |
initializeExecuter() |
protected void |
initializeFileDetailsExecuter() |
protected void |
initializeVersionDetailsExecuter() |
protected void |
initializeVersionDetailsString() |
protected boolean |
isFilterSupported() |
protected boolean |
isSingleSourceFrameRangeRequired(String sourceMimetype,
String targetMimetype,
org.gytheio.content.transform.options.TransformationOptions options)
Determines whether or not a single frame is required for the given source and target mimetypes.
|
protected boolean |
isStoryboardThumbnailRequest(String sourceMimetype,
String targetMimetype,
org.gytheio.content.transform.options.TransformationOptions options)
Determines whether or not the transformation request is for storyboard
thumbnails.
|
static boolean |
isSupportedSource(String mediaType)
Determines if the source mimetype is supported by ffmpeg
|
static boolean |
isSupportedTarget(String mimetype)
Determines if FFmpeg can be made to support the given target mimetype.
|
boolean |
isTransformable(List<String> sourceMediaTypes,
String targetMediaType,
org.gytheio.content.transform.options.TransformationOptions options) |
boolean |
isVersion1orGreater() |
protected void |
reinitializeVersionString() |
protected void |
singleTransformInternal(File sourceFile,
String sourceMimetype,
File targetFile,
String targetMimetype,
org.gytheio.content.transform.options.TransformationOptions options,
org.gytheio.content.transform.ContentTransformerWorkerProgressReporter progressReporter) |
protected List<File> |
transformInternal(List<org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair> sourcePairs,
List<org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair> targetPairs,
org.gytheio.content.transform.options.TransformationOptions options,
org.gytheio.content.transform.ContentTransformerWorkerProgressReporter progressReporter) |
getDetails, initialize, setExecuter, setVersionDetailsExecutercreateTargetContentReference, createTempFile, getSourcePairs, getTargetPairs, initializationTest, isTempTargetUsed, transform, transformgetExtension, setTargetContentReferenceHandler, toStringgetProperties, getVersionDetailsString, getVersionString, initializeVersionString, isAvailable, loadProperties, setIsAvailable, setSourceContentReferenceHandlerprotected static final String CMD_OPT_ASSIGNMENT
protected static final String CMD_OPT_PARAM_ASSIGNMENT
protected static final String CMD_OPT_DELIMITER
protected static final String CMD_OPT_NUM_VIDEO_FRAMES
protected static final String CMD_OPT_DISABLE_AUDIO
protected static final String CMD_OPT_DISABLE_VIDEO
protected static final String CMD_OPT_DISABLE_SUBTITLES
protected static final String CMD_OPT_VIDEO_CODEC_v0
protected static final String CMD_OPT_VIDEO_CODEC_v1
protected static final String CMD_OPT_VIDEO_BITRATE_v0
protected static final String CMD_OPT_VIDEO_BITRATE_v1
protected static final String CMD_OPT_VIDEO_PRESET
protected static final String CMD_OPT_AUDIO_CODEC_v0
protected static final String CMD_OPT_AUDIO_CODEC_v1
protected static final String CMD_OPT_AUDIO_BITRATE_v0
protected static final String CMD_OPT_AUDIO_BITRATE_v1
protected static final String CMD_OPT_AUDIO_SAMPLING_RATE
protected static final String CMD_OPT_AUDIO_CHANNELS
protected static final String CMD_OPT_FORMAT
protected static final String CMD_OPT_DURATION
protected static final String CMD_OPT_OFFSET
protected static final String CMD_OPT_SIZE
protected static final String CMD_OPT_SCALE
protected static final String CMD_OPT_FRAME_RATE
protected static final String CMD_OPT_FRAME_RATE_FILTER
protected static final String CMD_OPT_MOV_FLAGS
protected static final String CMD_OPT_MOV_FLAGS_FASTSTART
protected static final String CMD_OPT_ENABLE_EXPERIMENTAL
protected static final String CMD_OPT_PAIR_1_FRAME
protected static final String CMD_OPT_MULTI_TARGET_INDEX_FORMATTER
protected static final String CMD_OPT_MULTI_TARGET_INDEX_REGEX
protected static final String DEFAULT_VIDEO_PRESET
protected static final String DEFAULT_VIDEO_PRESET_PREFIX
protected static final String DEFAULT_VIDEO_PRESET_SUFFIX
public static final String VAR_SOURCE_OPTIONS
public static final String VAR_TARGET_OPTIONS
public static final String VAR_OFFSET
public static final String VAR_DURATION
protected static final String DEFAULT_OFFSET
protected void initializeExecuter()
initializeExecuter in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerprotected void initializeVersionDetailsExecuter()
initializeVersionDetailsExecuter in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerprotected void initializeFileDetailsExecuter()
initializeFileDetailsExecuter in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerprotected void initializationTest()
initializationTest in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerprotected String getVersionDetailOutput(String[] arguments)
versionDetailsExecuter with the
given alternative arguments to obtain additional version detail outputarguments - protected void initializeVersionDetailsString()
initializeVersionDetailsString in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerprotected void reinitializeVersionString()
public static boolean isSupportedSource(String mediaType)
mediaType - the mimetype to checkpublic static boolean isSupportedTarget(String mimetype)
mimetype - the mimetype to check#setUnsupportedMimetypes(String)public boolean isTransformable(List<String> sourceMediaTypes, String targetMediaType, org.gytheio.content.transform.options.TransformationOptions options)
protected List<File> transformInternal(List<org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair> sourcePairs, List<org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair> targetPairs, org.gytheio.content.transform.options.TransformationOptions options, org.gytheio.content.transform.ContentTransformerWorkerProgressReporter progressReporter) throws Exception
transformInternal in class org.gytheio.content.transform.AbstractFileContentTransformerWorkerExceptionprotected void singleTransformInternal(File sourceFile, String sourceMimetype, File targetFile, String targetMimetype, org.gytheio.content.transform.options.TransformationOptions options, org.gytheio.content.transform.ContentTransformerWorkerProgressReporter progressReporter) throws Exception
Exceptionprotected String getSourceCommandOptions(File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, org.gytheio.content.transform.options.TransformationOptions options) throws Exception
Exceptionprotected String getTargetCommandOptions(File sourceFile, File targetFile, String sourceMimetype, String targetMimetype, org.gytheio.content.transform.options.TransformationOptions options) throws Exception
Exceptionprotected String getFfmpegVersionNumber()
protected boolean isFilterSupported()
public boolean isVersion1orGreater()
protected String getTargetResizeCommandOptions(org.gytheio.content.transform.options.TransformationOptions options, File sourceFile)
Note: The current implementation assumes a 4:3 aspect ratio in the source
and that the imageResizeOptions given signify max width and
heights.
TODO: Future implementations should examine the source for the aspect ratio to correctly create the thumbnail.
options - transformation optionssourceFile - protected String getCmdOptVideoBitrate()
protected String getCmdOptVideoCodec()
protected String getCmdOptAudioBitrate()
protected String getCmdOptAudioCodec()
protected String getTargetVideoCommandOptions(String sourceMediaType, String targetMediaType, org.gytheio.content.transform.options.TransformationOptions options)
protected String getVideoPresetOptions()
protected String getFfmpegAudioCodec(String targetMediaType, String gytheioAudioCodec)
protected String getTargetAudioCommandOptions(String targetMediaType, org.gytheio.content.transform.options.TransformationOptions options)
protected String getComponentExclusionCommandOptions(String sourceMimetype, String targetMimetype)
protected String getFormatCommandOptions(String sourceMimetype, String targetMimetype)
protected String getSourceTemporalCommandOptions(String sourceMimetype, String targetMimetype, org.gytheio.content.transform.options.TransformationOptions options)
options - time-based optionsprotected String getTargetTemporalCommandOptions(String sourceMimetype, String targetMimetype, org.gytheio.content.transform.options.TransformationOptions options)
options - time-based optionsprotected boolean isSingleSourceFrameRangeRequired(String sourceMimetype, String targetMimetype, org.gytheio.content.transform.options.TransformationOptions options)
sourceMimetype - targetMimetype - protected boolean isStoryboardThumbnailRequest(String sourceMimetype, String targetMimetype, org.gytheio.content.transform.options.TransformationOptions options)
sourceMimetype - targetMimetype - options - protected boolean disableVideo(String sourceMimetype, String targetMimetype)
sourceMimetype - targetMimetype - protected boolean disableAudio(String sourceMimetype, String targetMimetype)
sourceMimetype - targetMimetype - protected boolean disableSubtitles(String sourceMimetype, String targetMimetype)
sourceMimetype - targetMimetype - protected org.gytheio.content.ContentReference createMultiTargetContentReference(String mediaType)
Copyright © 2015 Alfresco Software. All rights reserved.