makelive


Namemakelive JSON
Version 0.6.0 PyPI version JSON
download
home_pageNone
SummaryAdd the necessary metadata to photo + video pair so Photos recognizes them as Live Photos when imported
upload_time2024-06-18 04:42:14
maintainerNone
docs_urlNone
authorNone
requires_python>3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MakeLive
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Convert an photo + video pair into a Live Photo.

This is a simple command line tool that will apply the necessary metadata to a photo + video pair so that when they are imported into the Apple Photos, they will be treated as a Live Photo.

This is useful for converting images taken an Android phone into Live Photos that can be imported into Apple Photos.

## Usage

```bash
makelive image_1234.jpg image_1234.mov
```

## Requirements

- macOS (Tested on 13.5.1; should work on 10.15+)
- Python 3.9+

## Installation

### Install via Pre-Built Binary Installer Package

Download and run the latest installer package for your Mac architecture from the [releases page](https://github.com/RhetTbull/makelive/releases).

### Install via pip or pipx

Alternatively, you can install from PyPI:

- `python3 -m pip install makelive`

Or you can use [pipx](https://github.com/pypa/pipx):

- Open `Terminal` (search for `Terminal` in Spotlight or look in `Applications/Utilities`)
- Install `homebrew` according to instructions at [https://brew.sh/](https://brew.sh/)
- Type the following into Terminal: `brew install pipx`
- Ensure that pipx installed packages are accessible in your PATH by typing: `pipx ensurepath`
- Then type this: `pipx install makelive`
- Now you should be able to run `makelive` by typing: `makelive`

Once you've installed makelive with pipx, to upgrade to the latest version:

    pipx upgrade makelive

> [!NOTE]
> When installing other packages with homebrew, homebrew may update the version of Python installed which would then cause any app (including makelive) installed with `pipx` to fail. If this happens, the easiest fix is to reinstall makelive with:

    pipx reinstall makelive

Alternatively, you can reinstall all apps installed with `pipx` with:

    pipx reinstall-all

### Install from Source

To install from source:

- `git clone git@github.com:RhetTbull/makelive.git`
- `cd makelive`
- `pip install flit`
- `flit install`

## API

You can use makelive to programmatically create Live Photo pairs:

```python
from makelive import make_live_photo

photo_path = "test.jpg"
video_path = "test.mov"
asset_id = make_live_photo(photo_path, video_path)
print(f"Wrote Asset ID: {asset_id} to {photo_path} and {video_path}")
```

You can also check if a photo and video pair are a Live Photo pair and get the asset ID:

```python
from makelive import live_id, is_live_photo_pair
photo_path = "test.jpg"
video_path = "test.mov"
print(f"Is Live Photo Pair: {is_live_photo_pair(photo_path, video_path)}")
print(f"Asset ID: {live_id(photo_path)}")
```

Live Photos can also be created as a [.pvt package](https://fileinfo.com/extension/pvt). Use `make_pvt` to create a .pvt package from a photo and video pair. This is useful for creating Live Photos that can be shared via AirDrop or other methods that may not preserve the Live Photo metadata. Unlike `make_live_photo`, `make_pvt` does not modify the original photo and video files but instead copies them into a .pvt package and modifies the copies.

```python
from makelive import make_pvt
photo_path = "test.jpg"
video_path = "test.mov"
pvt_path = make_pvt(photo_path, video_path)
print(f"Wrote .pvt package to {pvt_path}")
```

> [!NOTE]
> XMP metadata in the QuickTime movie file is not preserved by this function which may result in metadata loss.

Metadata including EXIF, IPTC, and XMP are preserved in the image file but will be rewritten and the Core Graphics API may change the order of the metadata and normalize the values. For example, the tag XMP:TagsList will be rewritten as XMP:Subject and the value will be normalized to a list of title case strings.

If you must preserve the original metadata completely, it is recommended to make a copy of the metadata using a tool like [exiftool](https://exiftool.org) before calling this function and then restore the metadata after calling this function. (But take care not to delete the ContentIdentifier metadata.)

## How it works

In order for Photos to treat a photo + video pair as a Live Photo, the video file must contain a Content Identifier metadata tag set to a UUID. The associated photo must contain a Content Identifier metadata tag set to the same UUID. Unfortunately, these tags cannot be written with the standard [exiftool](https://exiftool.org/) utility if they do not already exist in the file as the metadata is stored in Maker Notes which exiftool cannot create.

This tool uses the Core Graphics and AV Foundation frameworks to modify the metadata of the photo and video files.

## Caution

> [!WARNING]
> This tool has not yet been extensively tested. It is recommended that you make a backup of your photo and video files before using this tool as it will overwrite the files which is required to add the necessary metadata. This also means that the files will be re-encoded and as a result, the file size may change, as may the quality of the image and video. I've used the native Apple APIs to do the encoding at maxixum quality but you should verify that the results are suitable for your needs.

## Source Code

The source code is available [here](https://github.com/RhetTbull/makelive).

## License

MIT License, see [LICENSE](LICENSE) for details.

## Credits

The [Live-Photo-master](https://github.com/GUIYIVIEW/LivePhoto-master) project by [GUIYIVIEW](https://github.com/GUIYIVIEW) was helpful for understanding how to set the asset ID in the QuickTime file. Copyright (c) 2017 GUIYIVIEW and [published under the MIT License](https://github.com/GUIYIVIEW/LivePhoto-master/blob/master/LICENSE).

Thank you to [Yorian](https://github.com/Yorian) who proposed this project and provided the test images. For more information, see [this discussion](https://github.com/RhetTbull/makelive/discussions/1398).

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="http://am1006.me"><img src="https://avatars.githubusercontent.com/u/13403435?v=4?s=100" width="100px;" alt="Luitbald"/><br /><sub><b>Luitbald</b></sub></a><br /><a href="https://github.com/RhetTbull/makelive/commits?author=am1006" title="Code">💻</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "makelive",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Rhet Turnbull <rturnbull+git@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/21/85/dff15f76983e6a056f9d8ee3521249e979e1c60a4a8f196118c67934a8e5/makelive-0.6.0.tar.gz",
    "platform": null,
    "description": "# MakeLive\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\nConvert an photo + video pair into a Live Photo.\n\nThis is a simple command line tool that will apply the necessary metadata to a photo + video pair so that when they are imported into the Apple Photos, they will be treated as a Live Photo.\n\nThis is useful for converting images taken an Android phone into Live Photos that can be imported into Apple Photos.\n\n## Usage\n\n```bash\nmakelive image_1234.jpg image_1234.mov\n```\n\n## Requirements\n\n- macOS (Tested on 13.5.1; should work on 10.15+)\n- Python 3.9+\n\n## Installation\n\n### Install via Pre-Built Binary Installer Package\n\nDownload and run the latest installer package for your Mac architecture from the [releases page](https://github.com/RhetTbull/makelive/releases).\n\n### Install via pip or pipx\n\nAlternatively, you can install from PyPI:\n\n- `python3 -m pip install makelive`\n\nOr you can use [pipx](https://github.com/pypa/pipx):\n\n- Open `Terminal` (search for `Terminal` in Spotlight or look in `Applications/Utilities`)\n- Install `homebrew` according to instructions at [https://brew.sh/](https://brew.sh/)\n- Type the following into Terminal: `brew install pipx`\n- Ensure that pipx installed packages are accessible in your PATH by typing: `pipx ensurepath`\n- Then type this: `pipx install makelive`\n- Now you should be able to run `makelive` by typing: `makelive`\n\nOnce you've installed makelive with pipx, to upgrade to the latest version:\n\n    pipx upgrade makelive\n\n> [!NOTE]\n> When installing other packages with homebrew, homebrew may update the version of Python installed which would then cause any app (including makelive) installed with `pipx` to fail. If this happens, the easiest fix is to reinstall makelive with:\n\n    pipx reinstall makelive\n\nAlternatively, you can reinstall all apps installed with `pipx` with:\n\n    pipx reinstall-all\n\n### Install from Source\n\nTo install from source:\n\n- `git clone git@github.com:RhetTbull/makelive.git`\n- `cd makelive`\n- `pip install flit`\n- `flit install`\n\n## API\n\nYou can use makelive to programmatically create Live Photo pairs:\n\n```python\nfrom makelive import make_live_photo\n\nphoto_path = \"test.jpg\"\nvideo_path = \"test.mov\"\nasset_id = make_live_photo(photo_path, video_path)\nprint(f\"Wrote Asset ID: {asset_id} to {photo_path} and {video_path}\")\n```\n\nYou can also check if a photo and video pair are a Live Photo pair and get the asset ID:\n\n```python\nfrom makelive import live_id, is_live_photo_pair\nphoto_path = \"test.jpg\"\nvideo_path = \"test.mov\"\nprint(f\"Is Live Photo Pair: {is_live_photo_pair(photo_path, video_path)}\")\nprint(f\"Asset ID: {live_id(photo_path)}\")\n```\n\nLive Photos can also be created as a [.pvt package](https://fileinfo.com/extension/pvt). Use `make_pvt` to create a .pvt package from a photo and video pair. This is useful for creating Live Photos that can be shared via AirDrop or other methods that may not preserve the Live Photo metadata. Unlike `make_live_photo`, `make_pvt` does not modify the original photo and video files but instead copies them into a .pvt package and modifies the copies.\n\n```python\nfrom makelive import make_pvt\nphoto_path = \"test.jpg\"\nvideo_path = \"test.mov\"\npvt_path = make_pvt(photo_path, video_path)\nprint(f\"Wrote .pvt package to {pvt_path}\")\n```\n\n> [!NOTE]\n> XMP metadata in the QuickTime movie file is not preserved by this function which may result in metadata loss.\n\nMetadata including EXIF, IPTC, and XMP are preserved in the image file but will be rewritten and the Core Graphics API may change the order of the metadata and normalize the values. For example, the tag XMP:TagsList will be rewritten as XMP:Subject and the value will be normalized to a list of title case strings.\n\nIf you must preserve the original metadata completely, it is recommended to make a copy of the metadata using a tool like [exiftool](https://exiftool.org) before calling this function and then restore the metadata after calling this function. (But take care not to delete the ContentIdentifier metadata.)\n\n## How it works\n\nIn order for Photos to treat a photo + video pair as a Live Photo, the video file must contain a Content Identifier metadata tag set to a UUID. The associated photo must contain a Content Identifier metadata tag set to the same UUID. Unfortunately, these tags cannot be written with the standard [exiftool](https://exiftool.org/) utility if they do not already exist in the file as the metadata is stored in Maker Notes which exiftool cannot create.\n\nThis tool uses the Core Graphics and AV Foundation frameworks to modify the metadata of the photo and video files.\n\n## Caution\n\n> [!WARNING]\n> This tool has not yet been extensively tested. It is recommended that you make a backup of your photo and video files before using this tool as it will overwrite the files which is required to add the necessary metadata. This also means that the files will be re-encoded and as a result, the file size may change, as may the quality of the image and video. I've used the native Apple APIs to do the encoding at maxixum quality but you should verify that the results are suitable for your needs.\n\n## Source Code\n\nThe source code is available [here](https://github.com/RhetTbull/makelive).\n\n## License\n\nMIT License, see [LICENSE](LICENSE) for details.\n\n## Credits\n\nThe [Live-Photo-master](https://github.com/GUIYIVIEW/LivePhoto-master) project by [GUIYIVIEW](https://github.com/GUIYIVIEW) was helpful for understanding how to set the asset ID in the QuickTime file. Copyright (c) 2017 GUIYIVIEW and [published under the MIT License](https://github.com/GUIYIVIEW/LivePhoto-master/blob/master/LICENSE).\n\nThank you to [Yorian](https://github.com/Yorian) who proposed this project and provided the test images. For more information, see [this discussion](https://github.com/RhetTbull/makelive/discussions/1398).\n\n## Contributors \u2728\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"http://am1006.me\"><img src=\"https://avatars.githubusercontent.com/u/13403435?v=4?s=100\" width=\"100px;\" alt=\"Luitbald\"/><br /><sub><b>Luitbald</b></sub></a><br /><a href=\"https://github.com/RhetTbull/makelive/commits?author=am1006\" title=\"Code\">\ud83d\udcbb</a></td>\n    </tr>\n  </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!",
    "bugtrack_url": null,
    "license": null,
    "summary": "Add the necessary metadata to photo + video pair so Photos recognizes them as Live Photos when imported",
    "version": "0.6.0",
    "project_urls": {
        "Home": "https://github.com/RhetTbull/makelive",
        "Issues": "https://github.com/RhetTbull/makelive/issues",
        "Source": "https://github.com/RhetTbull/makelive"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "82efb54ba5ac15fc5f7744248f6be600dc716215b0a3e36cfd48987533e12e5c",
                "md5": "c6c127dfa032a71263616db4a25016b4",
                "sha256": "dd7887b61d1f00b813a887e3c41b4c87967089b9c4832556f6b16b6953062046"
            },
            "downloads": -1,
            "filename": "makelive-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c6c127dfa032a71263616db4a25016b4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">3.9",
            "size": 11611,
            "upload_time": "2024-06-18T04:42:08",
            "upload_time_iso_8601": "2024-06-18T04:42:08.904417Z",
            "url": "https://files.pythonhosted.org/packages/82/ef/b54ba5ac15fc5f7744248f6be600dc716215b0a3e36cfd48987533e12e5c/makelive-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2185dff15f76983e6a056f9d8ee3521249e979e1c60a4a8f196118c67934a8e5",
                "md5": "4c7e90ae82e5a0c73fa4f3855cb6650c",
                "sha256": "6e92e5e27af33eff688c25688f6e586057293f87913cd10abf32e91295c3aafe"
            },
            "downloads": -1,
            "filename": "makelive-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4c7e90ae82e5a0c73fa4f3855cb6650c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">3.9",
            "size": 18101,
            "upload_time": "2024-06-18T04:42:14",
            "upload_time_iso_8601": "2024-06-18T04:42:14.982825Z",
            "url": "https://files.pythonhosted.org/packages/21/85/dff15f76983e6a056f9d8ee3521249e979e1c60a4a8f196118c67934a8e5/makelive-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-18 04:42:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RhetTbull",
    "github_project": "makelive",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "makelive"
}
        
Elapsed time: 0.27163s