Giter Club home page Giter Club logo

mediadater's Introduction

Mediadater

Mediadater is a small BASH CLI utility for Linux, used to rename media files created by recording devices. By default it renames the files to the date the file was created, plus the camera model. It's behaviour is very flexible and it can work with all picture, audio and video files that Exiftool supports. It's licensed with the GNU GPLv3 License.

Installation

The easiest way to install is to clone the repository and then install with make:

git clone https://github.com/nsrosenqvist/mediadater.git && cd mediadater
make && sudo make install

The script requires exiftool which is in the Ubuntu repositories:

sudo apt-get install libimage-exiftool-perl

Usage

The argument you provide can either be a file or multiple files as separate arguments (and even a pattern through shell expansion). By default the file is named after the created date followed by the camera model if the tag is available (e.g. 20140101_122301_Nikon D60.jpg).

Example usage:

mediadater -vx -s "My friends camera" DSC_*.JPG

You can specify the files to rename in several different ways. You can specify them, pipe the input, use file input, or even run with nothing specified at all and the script will use find to locate every supported file in the current working directory, but first prompt you and ask if that is really what you want to do.

Note: Due to the nature of the getopts argument parsing you cannot specify the files before the parameters so make sure to set them in the right order. A warning might be implemented later, patches are welcome.

Parameters

Parameter Explanation
-d Set a date format for the file names using the strftime syntax.
-v Print the changes being made.
-p Prefix the file name (before the date).
-s Suffix, by default it tries to use the camera model but it can be helpful to use a custom suffix, for example if you want to name files from different occasions, like "Vacation" and "Wedding".
-x If a related Darktable XMP-file is found this will also edit it so that it's still connected to the new file name.
-l Log the file changes to "mediadater_log.txt" which will be created in the current working directory. Good if you want to make sure that everything went alright.

mediadater's People

Contributors

nsrosenqvist avatar

Watchers

 avatar  avatar

mediadater's Issues

Support recursive search

Verify if the file renaming works as it is currently and also add a recursive option that is enabled when using find.

Use Date/Time Original instead of Create Date

Date/Time Original              : 2013:06:23 20:41:52
Create Date                     : 2002:12:08 12:00:00

Date/Time Original is the correct one according to the exif-specification. Create Date can be used as a backup if it's not defined.

Create a GUI

First rewrite the cli app and then create the GUI.

Handle files without exifdata better

Currently if we can't find the timestamp or camera model we name files like ".jpg" and "_01.jpg". To improve this we should check that we actually find the exifdata and in that case provide an option to skip files without proper metadata or prefix them with "unknown".

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.