joemck / ExtractMotionPhotos

Extract Motion Photos created by Samsung phones to mp4 videos and plain jpg photos
MIT License
141 stars 19 forks source link

Dual Camera Photos (Samsung DualShot) #3

Open jimbuck opened 5 years ago

jimbuck commented 5 years ago

How do you explore the image file for embedded media?

Many cameras now have 2 lenses for simulated depth of field (subject in focus, background out of focus). When a picture is taken it stores both the "Close-up" and "Wide angle" photos in a single JPEG (I'm guessing in a similar manner to motion photos).

How would I go about investigating the file structure? I would love to be able to extract motion photos or dual camera photos.

jimbuck commented 5 years ago

Looking in one of my files I see the following readable text:

Any tips for searching or splicing the file up? I'd love to dig deeper and understand the process.

howff commented 2 years ago

A very good tool for exploring binary files is SweetScape's 010editor. It has Templates which you can apply to parts of the file, so you can use a JPEG template to parse it and explore the markers and tags.

joemck commented 2 years ago

Thanks. This looks like an interesting tool. Sorry I let this thread slip between the cracks. Does anyone know if it uses a semi-standard format or if it's Samsung-specific? From "DualShot" appearing in identifiers in the file, I would guess it's Samsung specific. My phone only has 1 back camera (S7 Edge). Just from those strings, I would expect that what directly follows (or preceeds, perhaps) "DualShot_1" and "DualShot_2" are the actual jpg photos from each camera. Then the other 3 are probably going to be proprietary formats storing metadata and some algorithmically-generated map to help it adjust the depth-of-field effect in the Gallery app.

jimbuck commented 2 years ago

No worries, I'm still interested in this but don't have time to dig in right now.

makt commented 1 year ago

This shows file structure nicely: https://exiftool.org/htmldump.html