问题描述
Google Pixel 2以及其他手机可能具有覆盖动态照片"的功能.这些被保存为MVIMG并且相对较大.
我正在寻找一种删除/提取视频的方法.
到目前为止,我发现了一个很有前途的exif标签
$ exiftool -xmp:all MVIMG_123.jpg
XMP Toolkit : Adobe XMP Core 5.1.0-jc003
Micro Video : 1
Micro Video Version : 1
Micro Video Offset : 4032524
我认为视频可能以指定的偏移量出现,但这不起作用:
$ dd if=MVIMG_123.jpg of=video.mp4 bs=4032524 skip=1
$ file video.mp4
video.mp4: data
是否有任何文献可以证明嵌入?甚至还有删除/提取视频的工具吗?
我确实找到了 https://github.com/cliveontoast/GoMoPho 会扫描mp4标头,然后转储视频.
我们可以做同样的事情,从MP4头中扫描ftypmp4
(实际文件比文件开头早4个字节):
因此提取视频:
for i in MVIMG*.jpg; do \
ofs=$(grep -F --byte-offset --only-matching --text ftypmp4 "$i"); \
ofs=${ofs%:*}; \
[[ $ofs ]] && dd "if=$i" "of=${i%.jpg}.mp4" bs=$((ofs-4)) skip=1; \
done
并删除视频:
for i in MVIMG*.jpg; do \
ofs=$(grep -F --byte-offset --only-matching --text ftypmp4 "$i"); \
ofs=${ofs%:*}; \
[[ $ofs ]] && truncate -s $((ofs-4)) "$i"; \
done
The Google Pixel 2 and probably other phones since have the capability to cover "Motion Photos". These are saved as MVIMG and comparatively big.
I’m looking for a way to remove/extract the video.
So far I found a promising exif tag
$ exiftool -xmp:all MVIMG_123.jpg
XMP Toolkit : Adobe XMP Core 5.1.0-jc003
Micro Video : 1
Micro Video Version : 1
Micro Video Offset : 4032524
I thought the video might be present at the specified offset, but this doesn’t work:
$ dd if=MVIMG_123.jpg of=video.mp4 bs=4032524 skip=1
$ file video.mp4
video.mp4: data
Are there any resources that document the embedding? Are there even any tools to remove/extract the video?
I did find https://github.com/cliveontoast/GoMoPho which scans for the mp4 header and then dumps the video.
We can do the same, scanning for ftypmp4
from the MP4 header (actual file starts 4 bytes earlier):
Thus to extract videos:
for i in MVIMG*.jpg; do \
ofs=$(grep -F --byte-offset --only-matching --text ftypmp4 "$i"); \
ofs=${ofs%:*}; \
[[ $ofs ]] && dd "if=$i" "of=${i%.jpg}.mp4" bs=$((ofs-4)) skip=1; \
done
And to remove videos:
for i in MVIMG*.jpg; do \
ofs=$(grep -F --byte-offset --only-matching --text ftypmp4 "$i"); \
ofs=${ofs%:*}; \
[[ $ofs ]] && truncate -s $((ofs-4)) "$i"; \
done
这篇关于如何提取MVIMG的照片/视频组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!