Sign inSign up

llavaud/process-media

By llavaud

•Updated almost 8 years ago

A photo and video processing script

Image
1

1.1K

llavaud/process-media repository overview

⁠process-media

This script will process (resize, compress...) photos and videos according to the specified options

GitHub project page⁠

⁠Configuration

process-media use a yaml configuration file to specify somes options and template format who define how to process photos and videos.

Here is a photo format example:

web_photo:
  type: 'photo'
  rotate: 'auto'
  resize: 1920
  compress: 90
  progressive: true
  strip: true
  strip_exclude: 'gps'
  output_dir: 'web'

Here we define a photo format named web_photo.

The resulting photo(s) will be auto-rotated, resized, compressed, progressive jpeg enabled and all metadata will be removed except GPS informations.

By default two photo format (web_photo, archive_photo) and two video format (web_video, archive_video) are defined, default configuration file is available here⁠.

⁠CLI
Usage: ./process-media <path> [options]

<path> is the path to photos or videos to process

Options:
-t,--type        {photo,video}  Type of files to process (default: photo,video)
-f,--format      {format1,...}  Format to generate (default: all format defined in config file)
-c,--config      <config_file>  Config file to load (default: search local process-media.yaml file or in /etc)
-m,--max_threads <num_threads>  Maximum allowed threads (default: number of cpu(s)/core(s))
-tz,--tzoffset                  Allow to change the default timezone offset used to rename file(s) (in seconds)
-k,--keep_name                  Do not rename file
-v,--verbose                    Verbose output
-o,--overwrite                  Overwrite existing files
-b,--batch                      Run in non-interactive mode, allowing to run in a crontab
-h,--help                       This help text
⁠Examples
  • If you want to convert all photos and videos in the current directory by using all defined format(s) from the configuration file:

docker run -it --rm -v "$(pwd)":/media llavaud/process-media

  • If you want to convert all photos in the folder /home/foo by using the previous define format web_photo:

docker run -it --rm -v /home/foo:/media llavaud/process-media -f web_photo

  • If you want to override the default configuration by your custom /home/foo/process-media.yaml file:

docker run -it --rm -v /home/foo:/media -v /home/foo/process-media.yaml:/etc/process-media.yaml -f web_photo

Tag summary

Content type

Image

Digest

Size

318.7 MB

Last updated

almost 8 years ago

docker pull llavaud/process-media