The Galaxy S7/Edge can take photos with a few seconds of video before the photo. iOS and Windows Phone devices can do the same, as I’m sure many other phones can. I was curious about how well it would work on the street, as it might be useful to show how a shot came about. Surprisingly, it worked well! I could even take two photos in quick succession, and the phone would record overlapping video for each. I didn’t notice any lag.
The phone records the motion photo as a regular jpg file. It’s much bigger though, as there’s a mp4 video files appended to the Jpeg image. You can find some technical info about the file format here.
Yes you can manually do this is 10 seconds with a hex editor by opening your original Photo and searching for MotionPhoto_Data then select everything above MotionPhoto_Data and copy and paste it as a new file and save as a JPG. Do the same for the MPG BUT this time select every thing BELOW MotionPhoto_Data make sure for either one you are doing not to copy the MotionPhoto_Data text. Also the hex for the MotionPhoto_Data is 4D 6F 74 69 6F 6E 50 68 6F 74 6F 5F 44 61 74 61.
Technically the JPG ends at ÿÙ or FF D9 so the ÿÙ SHOULD be included too.
Technically You really want to delete all this “……..Image_UTC_Data1458170015363SEFHe……… ..#…#…….SEFT..0…..MotionPhoto_Data”
But if you leave all this “……..Image_UTC_Data1458170015363SEFHe……… ..#…#…….SEFT..0…..MotionPhoto_Data” in the end of the JPG you can easily merge them back together and have the display and play on your phone
For this first test of motion photos I just used the phone to extract the images. Here’s what I did:
- Load up Samsung Gallery, and select all the motion photos. Then tap the share button, and a popup appears asking to pick picture or video. I picked video, so it worked away for a few seconds, up popped the list of sharing applications and I hit back. The videos were now in my Camera folder next to the Jpeg files.
- Copy files to computer, but rename videos (add “-1” or something to the end). Lightroom stacks jpg/mp4 files and it’s not possible to edit Jpeg files when they’re stacked like this.
- Backup Jpeg files, run them through an optimizer to remove embedded videos. ImageOptim will half the file size.
- Import into Lightroom.
- Edit Jpeg files, upload mp4 files and have fun!
Sometimes ImageOptim messes up and Lightroom shows the image as a sort of double-image with interlaced lines like this:
If you don’t have any backups, I found I could fix the problem by loading the image in GIMP and saving it again. Then I’d have to update the EXIF data or overwrite it in Lightroom.
Using the Ruby script above is even easier. Point it at your import directory and it’ll extract any images and videos it finds, appending “_Extracted” to the filename. It’s probably worth renaming them in some deterministic way to avoid the stacking problem I talked about above. Since it extracts everything, you can delete the original jpg file. I should modify the Ruby script so it does the rename step..
I doubt I’ll use this feature much but I’m sure I’ll use it from time to time.