Coder Social home page Coder Social logo

data-hoarding's Introduction

Data Hoarding

A collection of scripts to organize and edit files

Installation

  • Install ffmpeg: brew install ffmpeg --with-libvidstab
  • Install jpegoptim: brew install jpegoptim
  • Install exiftool: brew install exiftool
  • Clone the project: git clone [email protected]:johansatge/data-hoarding.git

Then, source the aliases in the shell (in ~/.zshrc for instance):

export DATA_HOARDING_PATH="/path/to/data-hoarding"
. ${DATA_HOARDING_PATH}/aliases.sh

Note: the DATA_HOARDING_PATH var is mandatory, it is used in aliases.sh.

Scripts

Compressing images

โ†’ compress_image
------------------------------
Compress JPEG images in place (85%) without stripping EXIF tags
------------------------------
Usage:
$ compress_image file1.jpg file2.jpg
------------------------------

Compressing videos

โ†’ compress_video
------------------------------
Compress videos to H264/HEVC/AAC (will save to file1.mp4, extract EXIF to file1.json and keep original in file1.orig.mp4)
------------------------------
Usage:
$ compress_video --h264 file1.mp4 file2.mp4 [--options]
------------------------------
Options:
--h264              Re-encode the video with libx264
--hevc              Re-encode the video with libx265
--force-1080p       Re-encode in 1080p
--fps=[number]      Force FPS (default is to stick to source)
--quality=[number]  Encoding quality (CRF with x264, Constant Quality with HEVC) (defaults: 25, 45)
--no-audio          Remove audio track
--no-metadata        Don't export video metadata
------------------------------

Comparing videos

โ†’ compare_video
------------------------------
Compare two videos by extracting frames in the specified directory
------------------------------
Usage:
$ compare_video file1.mp4 file2.mp4 destination/directory
------------------------------

Extracting EXIF from images

------------------------------
Extract EXIF data from a picture and print it as a JSON file
------------------------------
Usage:
$ extract_exif picture.jpg > exif.json
------------------------------

Renaming medias by date

โ†’ rename_media
------------------------------
Rename images and movies by date (Y-M-D-H:i:s.ext)
------------------------------
Usage:
$ rename_media file1.jpg file2.jpg [--options]
------------------------------
Options:
--dry-run           Display results without renaming the files
--strategy=[string] Choose a strategy to get the file date:
                    none                 Keep the same filename
                                         Useful to add a suffix to existing files
                    exif_date            Use the DateTimeOriginal field from the EXIF
                    creation_date        Use the file creation date
                    video_creation_date  Use the movie creation date
                                         (extracted from the metadata with ffprobe)
                    oneplus_media        Use the name of the file (VID_20180413_115301.mp4, IMG_20180418_143440.jpg)
                    samsung_media        Use the name of the file (20220119_225029.mp4)
                    mp3_duration         Append the duration of the mp3 audio to the filename
--suffix=[string]   Add a suffix to the final filename
------------------------------

Stabilizing videos

โ†’ stabilize_video
------------------------------
Stabilize a video by using ffmpeg and vidstab (save file.mp4 to file.mp4.trf|file.stab.mp4|file.compare.mp4)
------------------------------
Usage:
$ stabilize_video file.mp4 [--options]
------------------------------
Options:
--analyze            Perform the analysis step (generate a file.mp4.trf file)
--stabilize          Stabilize the video by generating a file.stab.mp4 file (by using the trf file)
--compare            Merge file.mp4 and file.stab.mp4 in file.compare.mp4
--accuracy=[1-15]    Override accuracy value (vidstabdetect)
--shakiness=[1-10]   Override shakiness value (vidstabdetect)
--smoothing=[number] Override smoothing value (vidstabtransform)
------------------------------

Shifting EXIF date in images

โ†’ shift_exif_date
------------------------------
Shift the date of a picture by updating its EXIF tag
Note: it currently only supports shifting hours
------------------------------
Usage:
$ shift_exif_date file1.jpg file2.jpg --add-hours=1
$ shift_exif_date file1.jpg file2.jpg --substract-hours=2
$ shift_exif_date file1.jpg file2.jpg --model=pentax
------------------------------

Assembling dashcam videos

------------------------------
Assemble dashcam videos (format: YYYYMMDD_HHIISSX.ts) (with X being [F]ront or [R]ear)
------------------------------
Usage:
$ assemble_dascham path/to/ts/files
------------------------------
Options:
--stack    Stack vertically front and rear videos
--overlay  Overlay rear on top of the right left corner of the front
------------------------------

data-hoarding's People

Contributors

johansatge avatar

Watchers

 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.