Scripts to rename files and extract motion photos for Google Pixel 8
These are meant to work on the files generated by the stock camera app.
Each of these scripts works in batch on an entire directory tree that contains image files in various subdirectories.
-
Rename pairs of RAW (DNG) and JPEG files to have the same base name
Google Pixel 8 is unconventional in naming these pairs of files with distinct base names, which makes it difficult for photo processing software to associate them together.
This script renames each of these pairs to have the suffix ".RAW.jpg" and ".RAW.dng" to allow interoperability.
Note: Motion photos with an accompanying RAW file are NOT renamed, as the JPEG file contains additional data and thus should not be subsumed under the RAW file in photo management software.
-
Extract motion photos to give the photo and video as standalone files
This should only be run if you do want to have such standalone files.
exiftool must be installed.
-
Python and the package
motionminer.This package exists on PyPI, but the version required has been patched to allow extracting standalone (non-motion) photos in addition to the embedded videos. This is available from https://github.com/yushiyangk/MotionMiner/tree/photo until such time as it gets merged by the maintainer.
To intall this dependency, the recommended way is to use pipx. Assuming that the patched version of motionminer has been cloned locally as is the current working directory, run
pipx install .
Change the ALLCAPS variables at the top of each script as necessary.