Giter Club home page Giter Club logo

import-media-files's Introduction

import-media-files

Set of tools for importing photo and video files into specified folder organizing them according to the date and time information. Import files and albums from Google Photo is also supported.

Tools

  • import_photo.py
usage: import_photo.py [-h] [--src-dir SRC_DIR] [--out-dir OUT_DIR]
                       [--log-file LOG_FILE]

Import photos (*.jpg; *.jpeg) into a specified folder organizing them according to EXIF tags.

optional arguments:
  -h, --help           show this help message and exit
  --src-dir SRC_DIR    directory containing photos (*.jpg; *.jpeg)
  --out-dir OUT_DIR    destination directory
  --log-file LOG_FILE  output file for imported photos list
  • import_video.py
usage: import_video.py [-h] [--src-dir SRC_DIR] [--out-dir OUT_DIR]
                       [--log-file LOG_FILE]

Import videos (*.mp4; *.mov; *.mpg) into a specified folder organizing them according to "creation_time" information found in any of its media streams.

optional arguments:
  -h, --help           show this help message and exit
  --src-dir SRC_DIR    directory containing videos (*.mp4; *.mov; *.mpg)
  --out-dir OUT_DIR    destination directory
  --log-file LOG_FILE  output file for imported videos list
  • create_albums_metadata.py
usage: create_albums_metadata.py [-h] [--takeout-dir TAKEOUT_DIR]
                                 [--out-dir OUT_DIR]

Create <UUID>.json file for each album with title, date and time, list of files, etc. As an input, it takes metadata.json that is generated by Google Photos.

optional arguments:
  -h, --help            show this help message and exit
  --takeout-dir TAKEOUT_DIR
                        Google Photos takeout directory
  --out-dir OUT_DIR     destination directory
  • create_albums.py
usage: create_albums.py [-h] [--src-dir SRC_DIR] [--out-dir OUT_DIR]

Copy media files into folders (one folder per album) according to album descriptions provided in <UUID>.json files.

optional arguments:
  -h, --help         show this help message and exit
  --src-dir SRC_DIR  directory containing imported photos, videos and albums
                     metadata files
  --out-dir OUT_DIR  destination directory for albums
  • revert_import.py
usage: revert_import.py [-h] [--files-dir FILES_DIR]
                        [--log-files LOG_FILES [LOG_FILES ...]]

Delete previously imported files. It uses log files that were generated while importing.

optional arguments:
  -h, --help            show this help message and exit
  --files-dir FILES_DIR
                        directory with photo and video files
  --log-files LOG_FILES [LOG_FILES ...]
                        log files that were generated during import
  • immich_archive_files.py
usage: archive_files.py [-h] [--metadata METADATA] [--immich-url IMMICH_URL] [--api-key API_KEY] 

Mark files as archived in Immich

optional arguments:
  -h, --help            show this help message and exit
  --metadata METADATA   path to archive metadata file (same format as json for album description)
  --immich-url IMMICH_URL
                        Immich server URL
  --api-key API_KEY     Immich API key
  • immich_create_albums.py
usage: immich_create_albums.py [-h] [--metadata-dir METADATA] [--immich-url IMMICH_URL] [--api-key API_KEY] 

Create albums in Immich according to metadata files

optional arguments:
  -h, --help               show this help message and exit
  --metadata-dir METADATA  path to directory with album description metadata files
  --immich-url IMMICH_URL  Immich server URL
  --api-key API_KEY        Immich API key

Dependencies

import_video.py and create_albums_metadata.py need ffprobe being available via PATH.

Docker

It is possible to build a docker image for import_photo.py and import_video.py tools:

Build image:

docker build --file .\docker\Dockerfile --tag import_files .

Run import:

docker run -it --rm -v /path/to/source/dir:/source -v /path/to/output/dir:/output -v /path/to/logs/dir:/logs import_files

import-media-files's People

Contributors

brighteyed avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.