Aller au contenu principal
Version: 3.19

Renditions

The Rendition Factory is a service responsible for generating various renditions (alternative formats or versions) of media assets stored in Databox. It utilizes a set of transformers to process and convert the original media files into different renditions based on predefined configurations.

Transformers

Here is the list of available transformers:

imagine

Transform an image with some filter.

-
module: imagine # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options:
# Output image format
format: ~ # Example: jpeg
# Filters to apply to the image
filters:
# Filter performs sizing transformations (specifically relative resizing)
relative_resize:
heighten: ~ # Example: 'value "60" => given 50x40px, output 75x60px using "heighten" option'
widen: ~ # Example: 'value "32" => given 50x40px, output 32x26px using "widen" option'
increase: ~ # Example: 'value "10" => given 50x40px, output 60x50px, using "increase" option'
scale: ~ # Example: 'value "2.5" => given 50x40px, output 125x100px using "scale" option'
# use and setup the resize filter
resize:
# set the size of the resizing area [width,height]
size:
0: ~ # Example: '120'
1: ~ # Example: '90'
# Filter performs thumbnail transformations (which includes scaling and potentially cropping operations)
thumbnail:
# set the thumbnail size to [width,height] pixels
size:
0: ~ # Example: '32'
1: ~ # Example: '32'
# Sets the desired resize method: "outbound" crops the image as required, while "inset" performs a non-cropping relative resize.
mode: ~ # Example: inset
# Toggles allowing image up-scaling when the image is smaller than the desired thumbnail size. Value: true or false
allow_upscale: ~
# filter performs sizing transformations (which includes cropping operations)
crop:
# set the size of the cropping area [width,height]
size:
0: ~ # Example: '300'
1: ~ # Example: '600'
# Sets the top, left-post anchor coordinates where the crop operation starts[x, y]
start:
0: ~ # Example: '32'
1: ~ # Example: '160'
# filter adds a watermark to an existing image
watermark:
# Path to the watermark image
image: ~
# filter fill background color
background_fill:
# Sets the background color HEX value. The default color is white (#fff).
color: ~
# Sets the background opacity. The value should be within a range of 0 (fully transparent) - 100 (opaque). default opacity 100
opacity: ~
# filter performs file transformations (which includes metadata removal)
strip: ~
# filter performs sizing transformations (specifically image scaling)
scale:
# Sets the "desired dimensions" [width, height], from which a relative resize is performed within these constraints.
dim:
0: ~ # Example: '800'
1: ~ # Example: '1000'
# Sets the "ratio multiple" which initiates a proportional scale operation computed by multiplying all image sides by this value.
to: ~ # Example: '1.5'
# filter performs sizing transformations (specifically image up-scaling)
upscale:
# Sets the "desired min dimensions" [width, height], from which an up-scale is performed to meet the passed constraints.
min:
0: ~ # Example: '1200'
1: ~ # Example: '800'
# Sets the "ratio multiple" which initiates a proportional scale operation computed by multiplying all image sides by this value.
by: ~ # Example: '0.7'
# filter performs sizing transformations (specifically image down-scaling)
downscale:
# Sets the "desired max dimensions" [width, height], from which a down-scale is performed to meet the passed constraints
max:
0: ~ # Example: '1980'
1: ~ # Example: '1280'
# Sets the "ratio multiple" which initiates a proportional scale operation computed by multiplying all image sides by this value.
by: ~ # Example: '0.6'
# filter performs orientation transformations (which includes rotating the image)
auto_rotate: ~
# filter performs orientation transformations (specifically image rotation)
rotate:
# Sets the rotation angle in degrees. The default value is 0.
angle: ~ # Example: '90'
# filter performs orientation transformations (specifically image flipping)
flip:
# Sets the "flip axis" that defines the axis on which to flip the image. Valid values: x, horizontal, y, vertical
axis: ~ # Example: x
# filter performs file transformations (which includes modifying the encoding method)
interlace:
# Sets the interlace mode to encode the file with. Valid values: none, line, plane, and partition.
mode: ~ # Example: line
# filter provides a resampling transformation by allows you to change the resolution of an image
resample:
# Sets the unit to use for pixel density, either "pixels per inch" or "pixels per centimeter". Valid values: ppi and ppc
unit: ~ # Example: ppi
# Sets the horizontal resolution in the specified unit
x: ~ # Example: '300'
# Sets the vertical resolution in the specified unit
y: ~ # Example: '200'
# Sets the optional temporary work directory. This filter requires a temporary location to save out and read back in the image binary, as these operations are requires to resample an image. By default, it is set to the value of the sys_get_temp_dir() function
tmp_dir: ~ # Example: /my/custom/temporary/directory/path
# filter performs thumbnail transformations (which includes scaling and potentially cropping operations)
fixed:
# Sets the "desired width" which initiates a proportional scale operation that up- or down-scales until the image width matches this value.
width: ~ # Example: '120'
# Sets the "desired height" which initiates a proportional scale operation that up- or down-scales until the image height matches this value
height: ~ # Example: '90'
# use stamp
stamp:
# path to the font file ttf
font: ~
# available position value: topleft, top, topright, left, center, right, bottomleft, bottom, bottomright, under, above
position: ~
angle: 0
# font size
size: 16
color: '#000000'
# the font alpha value
alpha: 100
# text to stamp
text: ~
# text width
width: ~
# text background, option use for position under or above
background: '#FFFFFF'
# background transparancy, option use for position under or above
transparency: null

void

A module that does nothing (testing purpose)

-
module: void # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true

video_summary

Assemble multiple extracts (clips) of the video.

-
module: video_summary # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options:
# Skip video start, in seconds or timecode
start: 0 # Example: '2.5 ; "00:00:02.50" ; "{{ attr.start }}"'
# Extract one video clip every period, in seconds or timecode
period: ~ # Required, Example: '5 ; "00:00:05.00"'
# Duration of each clip, in seconds or timecode
duration: ~ # Required, Example: '0.25 ; "00:00:00.25"'
# output format
format: ~ # Required, Example: video-mpeg
# extension of the output file
extension: 'default extension from format' # Example: mpeg
# Change the number of ffmpeg passes
passes: 2
# Change the default timeout used by ffmpeg (defaults to symphony process timeout)
timeout: ~
# Change the default number of threads used by ffmpeg
threads: ~

Supported output formats.

FamilyFormatMime typeExtensions
videovideo-mkvvideo/x-matroskamkv
videovideo-mpeg4video/mp4mp4
videovideo-mpegvideo/mpegmpeg
videovideo-quicktimevideo/quicktimemov
videovideo-webmvideo/webmwebm
videovideo-oggvideo/oggogv

ffmpeg

apply filters to a video using FFMpeg.

-
module: ffmpeg # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options:
# output format
format: ~
# extension of the output file
extension: ~
# Change the default video codec used by the output format
video_codec: ~
# Change the default audio codec used by the output format
audio_codec: ~
# Change the default video_kilobitrate used by the output format
video_kilobitrate: ~
# Change the default audio_kilobitrate used by the output format
audio_kilobitrate: ~
# Change the number of ffmpeg passes
passes: 2
# Change the default timeout used by ffmpeg (defaults to symphony process timeout)
timeout: ~
# Change the default number of threads used by ffmpeg
threads: ~
# Filters to apply to the video
filters:
# Prototype: see list of available filters below
-
# Name of the filter
name: ~ # Required
# Whether to enable the filter
enabled: true

Supported output formats.

FamilyFormatMime typeExtensions
audioaudio-wavaudio/wavwav
audioaudio-aacaudio/aacaac, m4a
audioaudio-mp3audio/mp3mp3
audioaudio-oggaudio/oggoga, ogg
----
imageimage-jpegimage/jpegjpg, jpeg
imageimage-gifimage/gifgif
imageimage-pngimage/pngpng
imageimage-tiffimage/tifftif, tiff
----
videovideo-mkvvideo/x-matroskamkv
videovideo-mpeg4video/mp4mp4
videovideo-mpegvideo/mpegmpeg
videovideo-quicktimevideo/quicktimemov
videovideo-webmvideo/webmwebm
videovideo-oggvideo/oggogv

List of ffmpeg filters:

  • pre_clip filter
# Clip the video before applying other filters
-
name: pre_clip # Required
enabled: true
# Offset of frame in seconds or timecode
start: 0 # Example: '2.5 ; "00:00:02.500" ; "{{ attr.start }}"'
# Duration in seconds or timecode
duration: null # Example: '30 ; "00:00:30" ; "{{ input.duration/2 }}"'
  • clip filter
# Clip the video or audio
-
name: clip # Required
enabled: true
# Offset of frame in seconds or timecode
start: 0 # Example: '2.5 ; "00:00:02.500" ; "{{ attr.start }}"'
# Duration in seconds or timecode
duration: null # Example: '30 ; "00:00:30" ; "{{ input.duration/2 }}"'
  • remove_audio filter
# Remove the audio from the video
-
name: remove_audio # Required
enabled: true
  • resample_audio filter
# Resample the audio
-
name: resample_audio # Required
enabled: true
rate: '44100' # Required
  • resize filter
# Resize the video
-
name: resize # Required
enabled: true
# Width of the video
width: ~ # Required
# Height of the video
height: ~ # Required
# Resize mode
mode: inset # Example: inset
# Correct the width/height to the closest "standard" size
force_standards: true
  • rotate filter
# Rotate the video
-
name: rotate # Required
enabled: true
# Angle of rotation [0 | 90 | 180 | 270]
angle: ~ # Required, Example: '90'
  • pad filter
# Pad the video
-
name: pad # Required
enabled: true
# Width of the video
width: ~ # Required
# Height of the video
height: ~ # Required
  • crop filter
# Crop the video
-
name: crop # Required
enabled: true
# X coordinate
x: ~ # Required
# Y coordinate
y: ~ # Required
# Width of the video
width: ~ # Required
# Height of the video
height: ~ # Required
  • watermark filter
# Apply a watermark on the video
-
name: watermark # Required
enabled: true
# "relative" or "absolute" position
position: ~ # Required
# Path to the watermark image
path: ~ # Required
# top coordinate (only if position is "relative", set top OR bottom)
top: ~
# bottom coordinate (only if position is "relative", set top OR bottom)
bottom: ~
# left coordinate (only if position is "relative", set left OR right)
left: ~
# right coordinate (only if position is "relative", set left OR right)
right: ~
# X coordinate (only if position is "absolute")
x: ~
# Y coordinate (only if position is "absolute")
y: ~
  • framerate filter
# Change the framerate
-
name: framerate # Required
enabled: true
# framerate
framerate: ~ # Required
# gop
gop: ~
  • synchronize filter
# re-synchronize audio and video
-
name: synchronize # Required
enabled: true

video_to_frame

Extract one frame from the video.

-
module: video_to_frame # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options:
# Offset of frame in seconds or timecode
start: 0 # Example: '2.5 ; "00:00:02.50" ; "{{ attr.start }}"'
# output format
format: ~ # Required, Example: image-jpeg
# extension of the output file
extension: 'default extension from format' # Example: jpg
# Change the quality of the output file (0-100)
quality: 80
# Change the number of ffmpeg passes
passes: 2
# Change the default timeout used by ffmpeg (defaults to symphony process timeout)
timeout: ~
# Change the default number of threads used by ffmpeg
threads: ~

Supported output formats.

FamilyFormatMime typeExtensions
imageimage-jpegimage/jpegjpg, jpeg
imageimage-gifimage/gifgif
imageimage-pngimage/pngpng
imageimage-tiffimage/tifftif, tiff

video_to_animation

Converts a video to an animated GIF / PNG.

-
module: video_to_animation # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options:
# Start time in seconds or timecode
start: 0 # Example: '2.5 ; "00:00:02.50" ; "{{ attr.start }}"'
# Duration in seconds or timecode
duration: null # Example: '30 ; "00:00:30.00" ; "{{ input.duration/2 }}"'
# Frames per second
fps: 1
# Width in pixels
width: null
# Height in pixels
height: null
# Resize mode
mode: inset # One of "inset"
# output format
format: ~ # Required, Example: animated-png
# extension of the output file
extension: 'default extension from format' # Example: apng
# Change the number of ffmpeg passes
passes: 2
# Change the default timeout used by ffmpeg (defaults to symphony process timeout)
timeout: ~
# Change the default number of threads used by ffmpeg
threads: ~

Supported output formats.

FamilyFormatMime typeExtensions
animationanimated-gifimage/gifgif
animationanimated-pngimage/apngapng, png
animationanimated-webpimage/webpwebp

album_artwork

Extract the artwork (cover) of an audio file.

-
module: album_artwork # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options:
# output format
format: ~ # Required, Example: image-jpeg
# extension of the output file
extension: 'default extension from format' # Example: jpg

Supported output formats.

FamilyFormatMime typeExtensions
imageimage-jpegimage/jpegjpg, jpeg
imageimage-gifimage/gifgif
imageimage-pngimage/pngpng
imageimage-tiffimage/tifftif, tiff

document_to_pdf

Convert any document to PDF format.

-
module: document_to_pdf # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options: []

pdf_to_image

Convert the first page of a PDF to an image.

-
module: pdf_to_image # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options:
# Output image extension: jpg, jpeg, png, or webp
extension: jpeg
# Resolution of the output image in dpi
resolution: 300
# Quality of the output image, from 0 to 100
quality: 100
# Size of the output image, [width, height] in pixels
size:
# Width of the output image in pixels
0: ~ # Example: '150'
# Height of the output image in pixels
1: ~ # Example: '100'

set_dpi

Change the dpi metadata of an image (no resampling).

-
module: set_dpi # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options:
dpi: ~ # Required, Example: '72'

download

Download a file to be used as output.

-
module: download # Required
# Description of the module action
description: ~
# Whether to enable this module
enabled: true
options:
# url of the file to download
url: ~