I'm observing an interesting behavior on iOS when uploading edited videos from the Photos library.
Scenario
Device: iPhone
Video: 4K, 60 FPS
Original video size (Photos app): 660 MB
Uploaded original asset: 660 MB
After applying a simple edit (e.g., a filter) in the Photos app:
Photos app still shows the edited video. When my app uploads the current/edited asset, the uploaded file size becomes 167 MB.
So the edited version is approximately 75% smaller than the original (660 MB → 167 MB), even though the duration appears unchanged.
Questions
- Is this expected behavior for edited videos in the Photos library?
- Does iOS automatically re-encode edited videos using a lower bitrate or a different codec (e.g., HEVC) when generating the current rendition?
- Does the Photos app continue to display the size of the original asset rather than the size of the edited rendition?
I'm aware that PhotoKit allows retrieving both the original and the current (edited) versions of a PHAsset. In this case, I'm intentionally retrieving the current version, and this behavior is observed only for the edited asset.
Hey @KarthiRasu,
The answer here is hinted at by the documentation for renderedContentURL which states that the edits must be "baked in", but to maximize clarity, here are the direct answers to your questions:
- Is this expected behavior for edited videos in the Photos library?
Yes, the edit must be "baked in", and that requires a re-encoding of the edited video.
- Does iOS automatically re-encode edited videos using a lower bitrate or a different codec (e.g., HEVC) when generating the current rendition?
I don't know the answer here, but I have a couple of thoughts:
In an editing flow, you can use a slower but more efficient encoder.
At capture time, it's possible that a faster but less efficient encoder is used.
That means the perceptible quality could be the same, even with a disparity in the bitrates.
- Does the Photos app continue to display the size of the original asset rather than the size of the edited rendition?
Yes, it continues to display the size of the original.
-- Greg