This extension provides two so-called "translators" for the video conversion processes
To be configured in {home}/appserver/conf/custom.properties
type: String, required: yes, default: -
The license key for the plugin (product: videoDimensionTranslator), provided by brix.
in {home}/appserver/spring/conversionProcessDefinitions.xml
Available for both video and image downloads, use this as the first bean in the processList
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStep">
<property name="conversionProcessExecutorName" value="variable-modification"/>
<property name="parameters">
<set>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="TargetVariable"/>
<property name="parameterValue" value="dimensionExceptionDummy"/>
</bean>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="Expression"/>
<property name="parameterValue" value="$translator[VideoOrImageDimensionExceptionTranslator:]"/>
</bean>
</set>
</property>
</bean>
In DownloadVideo
, add an option for cropping in the parameterList
:
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessDefinitionParameter">
<!-- video cropping -->
<property name="identifier" value="videoCropping"/>
<property name="defaultValue" value="keepOriginal"/>
<property name="description" value="Choose if the video should be cropped to the specified dimensions"/>
<property name="label" value="Video Cropping"/>
<property name="allowedValues">
<list>
<value>crop</value>
<value>keepOriginal</value>
</list>
</property>
</bean>
Replace the existing parseEmptyVideoSize
with this one:
<bean id="parseEmptyVideoSize" class="com.celum.imagine.conversion.processing.definition.ConversionProcessStep">
<property name="conversionProcessExecutorName" value="variable-modification"/>
<property name="parameters">
<set>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="TargetVariable"/>
<property name="parameterValue" value="ffmpegResizeParameter"/>
</bean>
<bean class="com.celum.imagine.conversion.processing.definition.ConversionProcessStepParameter">
<property name="parameterName" value="Expression"/>
<property name="parameterValue" value="$translator[VideoDimensionCroppingTranslator:]"/>
</bean>
</set>
</property>
</bean>
Now you can set a video download format to use "crop" where desired (needs both width and height to be set).
Video Dimension Translator | CELUM (min. version) |
---|---|
1.0 - 1.2 | 6.8 |
Release: 2021-05-26
Initial Version
Release: 2021-05-28
Added VideoDimensionCroppingTranslator
Release: 2021-06-19
Include the video downscaling patch when not in crop-mode
Released: 2021-08-02
Make the ExceptionTranslator available for images as well
(breaking: now called VideoOrImageDimensionExceptionTranslator)