How to Reduce iCloud Storage by Shrinking Videos
In fact, removing unnecessary segments from 4k videos can be a more effective way of saving space.
When I view videos in the “Photos” gallery, it shows me when and where I took them.
This is a great feature that helps me reminisce my memories. However, the original 4k videos take up too much space in iCloud.
For example, even with HEVC (High Efficiency Video Coding), a 2:30 video will take up 1GB of space. My 200GB iCloud plan is almost full.
Therefore, I plan to compress the videos slightly to save some space.
But,
FFmpeg video conversion loses GPS even with metadata
Luckily, I found a solution.
Tools
- FFmpeg
- Exiftool
Export the original videos to a folder
A common method to export videos from “Photos” to a folder is to have “Photos” convert the videos.
Therefore, you must select all the videos you want to export and then go to:
File -> Export -> Export Unmodified Original For...
Shrink each video
The default stream for iPhones is:
#0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709)
So re-encoding with -pix_fmt yuv420p10le
(10-bit) doesn’t help.
1 | ffmov() { |
You can then copy and paste this code into the Terminal, navigate to the VideoFolder using cd VideoFolder
, and then run shrinkVideos
.
The shrinking process will take a long time.
On my MacBook Pro (15-inch, 2018), it takes only 0.3x longer. But in general, the videos will be reduced by 5x without too much loss of quality.
Once everything is done, the shrunken videos will be in the shrunk/
folder.
You can then compare them, delete the original videos, and import the shrunken videos.
Okay, at last I couldn’t stand the slow speed, so I used Nvidia 1080 GPU for acceleration. To learn more, visit: CUDA GPU Accelerated h264/h265/HEVC Video Encoding with Staxrip.
Next step is to tag the converted videos as hvc1
, otherwise, an error will occur when importing the photos:
Invalid: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.)
So the whole step is:
1 | ffhvc1() { |
Hope this helps you.
Translated by gpt-3.5-turbo