Skip to content

File Sources

MediaMoth workers use source URIs for input files, output files, and configuration files. A bare filesystem path or the old user@host:/path form is not a valid FileSourcePath.

Supported URI schemes

SchemeExampleProvider
filefile:///var/media/input.mkvThe worker's local filesystem
rsyncrsync://[email protected]/library/input.mkvRsync over SSH
s3s3://media-bucket/library/input.mkvS3 or an S3-compatible object store

All three forms identify a file, not a directory. Services stage inputs into temporary local files and copy completed outputs back through the selected provider.

Local files

Use an absolute path with an empty URI authority:

text
file:///mnt/media/source/episode.mkv
file:///mnt/media/output/episode.mp4
file:///etc/mediamoth/presets/h264.json

file://media/input.mkv is invalid because media is parsed as a host. Use file:///media/input.mkv instead.

The path is local to the worker process. In containers, mount the same host storage at the path named by the URI.

Rsync files

Use a URI even though rsync itself normally displays SSH-style paths:

text
rsync://[email protected]/library/source.mkv
rsync://storage.example.com/library/output.mp4

MediaMoth converts that internally to [email protected]:/library/source.mkv. The worker needs rsync, SSH key access, and a trusted host key. Password prompts cannot be handled by a background worker.

The compatibility form below is also accepted, but the canonical form is clearer:

text
rsync://[email protected]:/library/source.mkv

S3 objects

An S3 URI must contain both a bucket and an object key:

text
s3://media-bucket/raw/episode.mkv
s3://media-bucket/encoded/episode.mp4

The worker uses the AWS SDK credential chain. S3-compatible storage can be configured in code with a region, endpoint, and path-style addressing. A bucket client is required when resolving an s3:// URI.

Validation rules

MediaMoth rejects:

  • an empty source;
  • a bare path such as /var/media/input.mkv;
  • an unsupported scheme such as ftp://;
  • file:// URIs with a host or no path;
  • s3:// URIs without a bucket or object key;
  • rsync:// URIs without a host or path.

The filename extension is read from the URI path and normalized to lowercase. Workers use it when creating temporary files and choosing output formats.

Examples in job parameters

json
{
  "input_source": ["rsync://media@storage/raw/episode.mkv"],
  "output_source": ["s3://encoded-media/series/episode.mp4"],
  "config_source": "file:///etc/mediamoth/presets/h264.json"
}

Some services use scalar input_source and output_source values, while video conversion uses arrays. The service's published parameter schema is authoritative for cardinality.

Released under the MIT License.