keith-turner / motion-photos

Script to extract mp4 video at end of MVIMG jpg files created by Pixel 2
Apache License 2.0
42 stars 10 forks source link

Extract JPG #2

Open wsoyka opened 5 years ago

wsoyka commented 5 years ago

Hi Keith, just wanted to let you know this also works the other way around to get the JPG part only from the MVIMG. I was looking to remove the video of a few hundred accidental MVIMG's and your script helped out a lot!

In case you'd like to add jpg extraction as an option: I just changed tail to head to get the part before "ftypmp42" and applied the new filename via local newFile=${file:2}

According to jpeginfo -c *.jpg the in this way extract jpgs are valid!

keith-turner commented 5 years ago

I just changed tail to head to get the part before "ftypmp42" and applied the new filename via local newFile=${file:2}

That's neat, I had not thought of that.

aivus commented 1 year ago

As for the new PXL_*MP*.jpg files you need to catch ftypisom additionally.

See https://mjanja.ch/2021/10/stripping-embedded-mp4s-out-of-android-12-motion-photos/

I created a gist with a script to recursively remove video from all MP files in directory https://gist.github.com/aivus/dec3aaa0b1a9175d340ffb7b1294c9e4