Skip to content

Video Conversion

Video Service runs FFmpeg or HandBrake jobs through a River queue. Its current parameter schema uses URI strings and arrays rather than the legacy protobuf FileSource JSON object.

Parameters

Use the following job parameters to run an FFmpeg preset against one source file:

json
{
  "input_source": ["file:///media/source.mkv"],
  "output_source": ["s3://encoded-media/source.mp4"],
  "converter_type": "ffmpeg",
  "config_name": "h264-standard",
  "config_source": "file:///etc/mediamoth/presets/h264-standard.json"
}
FieldTypeRequirement
input_sourceURI arrayAt least one input.
output_sourceURI arrayAt least one output.
converter_typestringExactly ffmpeg or handbrake; case-sensitive.
config_namestringRequired preset/configuration name.
config_sourceURIRequired configuration file.

The internal job_id, aggregate_id, and smart-tag snapshot are supplied by the platform and are excluded from the user-facing schema.

FFmpeg

FFmpeg supports multiple inputs and outputs. Its configuration file contains an ordered argument template:

json
{
  "name": "h264-standard",
  "description": "H.264 with AAC audio",
  "template": [
    "-i", "{{ input 0 }}",
    "-c:v", "libx264",
    "-crf", "23",
    "-c:a", "aac",
    "{{ output 0 }}"
  ]
}

Video Service stages every source to a temporary file, renders input, output, tag, and chapter functions, runs FFmpeg, and copies each completed output through its destination provider.

HandBrake

HandBrake requires exactly one input and one output. config_source points to an exported HandBrake preset file and config_name selects the preset passed to HandBrakeCLI.

File access

Input, output, and configuration sources accept file://, rsync://, and s3:// URIs. Container-local file paths must be mounted into the worker at the same path.

yaml
services:
  video-service:
    volumes:
      - /srv/media:/media
      - /srv/presets:/presets:ro

The corresponding sources would be file:///media/source.mkv and file:///presets/h264.json.

Queue behavior

Video jobs are unique by their River arguments and use one automatic attempt. MediaMoth exposes explicit requeue and cancellation operations. The queued job carries a snapshot of resolved smart tags so FFmpeg templates use the values chosen when the job sequence was created.

Released under the MIT License.