What is a motion photo? How Android hides a video inside a JPG, and how to get it out
How Android hides a video inside a motion photo JPG, the MotionPhoto and MicroVideo markers, why messengers strip it, and how to extract it.
Many Android phones save a few seconds of video along with each photo. Google calls these Motion Photos (earlier, "Top Shot" and "Motion"), Samsung calls them Motion Photos, and other brands such as Xiaomi, OnePlus and vivo have their own names. In the gallery app the picture moves when you press on it. Copy the file to a computer, though, and you usually just see a still JPG that happens to be much larger than it should be.
The video has not gone anywhere. It is inside the JPG. This guide explains how that works, why the video sometimes really is lost, and how to extract it or strip it out.
A JPG with an MP4 glued to the end
Motion photos rely on one simple fact. A JPEG image ends with a two-byte marker, FF D9 ("end of image"), and image viewers stop reading there. Anything after that marker is ignored. So the phone writes a normal JPEG and then appends a complete MP4 video directly after it, in the same file.
Any normal viewer opens the file, reads the picture, and never looks at the rest. A gallery app that knows about motion photos reads a small marker in the image's metadata, finds where the video starts, and plays it. One file holds both.
This is why motion photos are large. A 12-megapixel JPG might be 3–4 MB, and the embedded clip, usually around 1.5 seconds before and after the shutter press with sound, can add as much again or more.
How the phone marks the video
The metadata lives in an XMP block, a small piece of XML stored near the start of the JPEG. There are two generations of the format:
- MotionPhoto (the current format). The XMP contains
GCamera:MotionPhoto="1"and aContainer:Directorythat lists the parts of the file. The video entry carries anItem:Lengthfield giving its size in bytes. Files often have names likePXL_20240904_080000000.MP.jpg. - MicroVideo (the older format, Pixel 2 and 3 era). The XMP contains
GCamera:MicroVideo="1"andGCamera:MicroVideoOffset, the number of bytes from the end of the file to where the video starts. Files are typically namedMVIMG_….jpg.
Both count from the end of the file, so the start of the video is always the file size minus that number. Samsung adds its own trailer data in some models, but the video inside is still an ordinary MP4.
Why the metadata can't be trusted alone
Editing apps sometimes rewrite a photo's metadata without updating the video offset, and some manufacturers write values that are slightly off. Reliable tools therefore don't just trust the marker. They scan the bytes after the end of the image for the signature that every MP4 file starts with: a small box whose type is the four letters ftyp, followed by a brand such as mp42 or isom.
When that signature is found right where the video should be, the extraction is safe, and the metadata just confirms what kind of motion photo it is. When the metadata is missing but the signature is present, the file is still a motion photo. It was probably re-saved by an app that dropped the XMP. The Motion Photo Extractor reports this case as "heuristic" so you know where the result came from.
Extracting the video
Once the start of the video is known, extraction is just cutting the file in two. Everything before the offset is the still image, and everything from the offset to the end is the MP4. Nothing needs to be decoded or re-encoded, so the extracted video is bit-for-bit what the phone recorded, and the process takes milliseconds even for large files.
The same cut in the other direction gives you a plain JPG without the hidden video. This is useful if you want to share or archive the picture at its normal size. The Motion Photo to JPG tool does this and also removes the motion-photo markers from the metadata, so gallery apps don't go looking for a video that is no longer there.
Why your motion photo has no video
If a tool reports that there is no embedded video, the cause is almost always how the file reached you. Most messaging and social apps re-compress photos when you send them. They decode the JPEG, shrink it, and save a new one, and the video glued to the end of the original is dropped along the way. The same happens with many "save to device" buttons and with screenshots.
To keep the video, transfer the original file: export it from the gallery app, use a cable or a cloud drive that keeps originals, or choose an "original quality" or "send as file" option where the messenger offers one.
Motion photos vs iPhone Live Photos
Apple's Live Photos look similar but are stored differently. A Live Photo is two separate files, a HEIC or JPG image and a MOV video, linked by a shared identifier in their metadata. There is no video hidden inside the image file.
This has a practical effect. When you share a Live Photo through a website upload or most apps, iOS usually sends only the still image, and the video file never leaves the phone. To get the video, export it on the device (for example, AirDrop to a Mac keeps both parts) or save the Live Photo as a video from the Photos app.
A note on privacy
The hidden clip records sound and the moments before and after you took the photo, which can include things you did not mean to capture. People sometimes share a "photo" without realising a video with audio came with it. If you post original files online, check whether they are motion photos first. Removing the video is a quick way to make sure you share only the picture.
For the same reason, it is worth being careful about where you process these files. Both tools on this site read the file in your browser and cut it locally. The photo is not uploaded.