GrapheneOS / Camera

Modern camera app focused on privacy and security with QR & barcode scanning.
https://grapheneos.org/
MIT License
796 stars 87 forks source link

Add support for "Motion Photos" #75

Open lbdroid opened 2 years ago

lbdroid commented 2 years ago

GCam creates a small video around the shutter moment in mp4 format and appends it to the end of the jpeg file. They also add a few EXIF tags describing the video, example as follows;

Motion Photo                    : 1
Motion Photo Version            : 1
Motion Photo Presentation Timestamp Us: 1166199
Directory Item Mime             : image/jpeg
Directory Item Semantic         : Primary
Directory Item Length           : 0
Directory Item Padding          : 0
Directory Item Mime             : video/mp4
Directory Item Semantic         : MotionPhoto
Directory Item Length           : 3774306
Directory Item Padding          : 0

The video, in this case, is 3,774,306 bytes at the end of the file. The format of the video is an actual mp4 video. It can be copied into an mp4 file directly using "dd" as; dd bs={filelen-3774306} skip=1 if=file.MP.jpg of=file.MP.mp4

ghost commented 2 years ago

Just to add a bit of information in case anyone's confused:

This is the equivalent to Apple iOS's "Live Photo" pictures.

realpixelcode commented 2 years ago

How could one view such motion photos on ungoogled devices?

lbdroid commented 2 years ago

This link has details about how a viewer can be implemented; https://medium.com/android-news/working-with-motion-photos-da0aa49b50c

realpixelcode commented 2 years ago

@lbdroid Do you know of any OSS apps that have such a viewer included?

lbdroid commented 2 years ago

@realpixelcode : That's out of scope. This issue is about CREATING the files.

realpixelcode commented 2 years ago

Sure, but why bother creating fancy motion photos if the user isn't even able to view them in the first place (or has to rely on proprietary Google apps)?

lbdroid commented 2 years ago

1 step at a time. Feel free to create another issue for that. Please stop polluting this issue.

thestinger commented 2 years ago

The camera's gallery would need to be able to display them.

realpixelcode commented 2 years ago

The camera's gallery would need to be able to display them.

Yeah, exactly. Otherwise, it wouldn't make sense to implement motion photos.

lbdroid commented 2 years ago

@realpixelcode : No, you completely missed the point. The camera's gallery is IN THE CAMERA APPLICATION.

realpixelcode commented 2 years ago

Yes. I know that. Graphene camera's internal gallery must be able to view motion photos. Otherwise it does not make sense to implement the option to take motion photos.

lbdroid commented 2 years ago

Are you quite finished now that you've contributed absolutely nothing?

thestinger commented 2 years ago

@lbdroid Why are you doing this across a bunch of issues?

lbdroid commented 2 years ago

This is an issue that I brought forward, you think its inappropriate to be slightly defensive when someone tries to side track it?

meichthys commented 1 year ago

@lbdroid Do you know of any OSS apps that have such a viewer included?

@realpixelcode Ideally the gallery would support this 👍 There are also other applications that support this including Immich, Nextcloud Memories (no native app yet), Photoprism, and others.

meichthys commented 4 months ago

Just for reference, there currently does not seem to be any open source cameras that implement motion/live photos although there are some viewers like Aves and others.

If GrapheneOS Camera implemented this, it would be the first open source camera to do so AFAIK.