Giter Club home page Giter Club logo

macos-photos-video-fixer's Introduction

Video Fixer for MacOS Photos

Some video formats aren't recognised properly by MacOS Photos and cannot be imported. Other times, videos might be missing key metadata that the Photos app uses to determine the capture date. This tool helps to fix that.

Prerequisites

You must have Python3.5 or later installed locally. You can install it using Homebrew:

$ brew install python

Make sure the version is correct by running:

$ python --version

You must also have ffmpeg installed:

$ brew install ffmpeg

How to use this tool

Create a directory named input and copy all the video files you are having trouble with there. Then run the following command:

$ python main.py

The tool will then start processing and converting all the video files to mp4 and set the creation and modification dates as the capture dates for the video.

Once the script is done processing the videos, you can import them into the Photos app from the output directory.

Notes

I put this script together after spending hours trying to download and import photos and videos from Google Photos into Apple's Photos app on MacOS. Over the years, I had accumulated videos in all sorts of formats (3gp, mov, mpg, mpeg, avi, mp4, mts, wmv, etc.) from all sorts of devices (Android phones, iPhones, digital cameras, DSLRs, GoPro, and even Hi8 camcorders).

The first issue I noticed is that a lot of the older files would get imported using the import date as the capture date, even though the file's creation and modification dates were set to years ago.

The second issue was that several file formats were unreadable to the Photos app. This was true for almost all AVI, MTS, and WMV files.

ffmpeg will do its best to preserve the video size and quality in the exported files. However, you will notice a reduction in file size especially when converting from avi to mp4. This is normal and personally, I can't tell if there is any drop in quality.

Shoutouts

macos-photos-video-fixer's People

Contributors

luisten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

macos-photos-video-fixer's Issues

Rescue creation date

I've successfully used your script to encode old videos (AVI) into Fotos.app compatible files. Unfortunately exif-data was wrong in many cases. I've added the following 2 lines to your code to copy old creation date to the new file.

    command_copy_metadata = f"exiftool -tagsFromFile \"{input_video_path}\" '-DateTimeOriginal>FileModifyDate' \"{output_video_path}\""
    subprocess.run(command_copy_metadata, shell=True, check=True, stdout=subprocess.PIPE, universal_newlines=True)  

I'm not sure, if this is a general solution. It works for my files.

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.