Tool to extract Samsung Motion Photos to plain jpg and mp4

Search This thread

Chupi383

Member
Mar 7, 2017
41
44
Boston, MA
First off, I've been browsing here for some time, but I've just registered so I'm sorry if I'm breaking any etiquette or conventions on posting.

I ran across goofwear's tool to extract videos and photos from Samsung Motion Photos and thought it was useful. But I really wanted something that I'd be able to throw a whole album of motion photos at, rather than doing one at a time with this or the share app. I looked at the .bat file they used and implemented the same technique in C, so it could quickly process many photos. It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.

Here's the exe.
See the main page of that Github repository for more complete instructions and full source.

How to use:
1. Copy your Motion Photos off your Samsung phone, to your PC. Just copy them out of the DCIM folder.
2. Run the program. An "open" dialog appears. Apart from that there's no GUI on this program.
3. Browse to your photos and select them. Hold ctrl to select more than one, or shift to select a range. Or, ctrl+A to select all in a folder.
4. Click Open.
5. Wait. Depending how many you selected, it might take a little bit. When it's done, a message box will appear.
6. You should see *_photo.jpg and *_video.mp4 files next to the originals in the source directory. Note that this program does not modify the original files. It doesn't even open them with write permissions enabled.

Alternately, drag one or more photos from Windows Explorer onto the exe's icon instead of using the open dialog.

Screenshots:

Iho7LzC.png

XXh6sDj.png

Zg0lt2x.png



Version History:

1.0: Initial release
1.1: Added optional compile-time option to delete the original file after extracting
2.0: Refactored a bit, added a proper build system, and multilanguage support; moved to a 'real' Github repo
2.1: It now preserves timestamps when making the extracted files, and now supports a -r flag to rename the original file instead of appending _photo and _video to the extracted ones.


Andylain has written a Chinese language explanation of the usage of this program, and kindly translated the UI to Chinese (Traditional). To use it in Chinese, either have your Windows set to Chinese language, or rename the exe to put _zh at the end of the name. To use it in English on a Chinese Windows, put _en at the end of the name.

If for some reason you want the old version exe, the old "delete-original" exe, or the old source code, you can still have them.
 
Last edited:
This is super helpful, Thank you! Oh, there is no beautiful icon in this version.

BTW, I am a Chinese blogger live in Taiwan, I blogged this tool and made a Chinese user guide in my blog "andylain‧blogspot‧com/2017/07/SamsungMotionPictureExtractor.html" .
(Sorry, I am a new user and not allowed to post link.)
If you think that's not a great idea, please tell me and I'll delete my post.
 

Chupi383

Member
Mar 7, 2017
41
44
Boston, MA
@Andylain Thanks for linking me to your post, and thanks for writing a Chinese explanation for how to use it. I'm happy for people to use my program if they find it useful.

Would a proper Chinese language version of the program be helpful, or are most people there able to read enough English to understand the few error and status messages the program has?
 
  • Like
Reactions: Andylain
@Andylain Thanks for linking me to your post, and thanks for writing a Chinese explanation for how to use it. I'm happy for people to use my program if they find it useful.

Would a proper Chinese language version of the program be helpful, or are most people there able to read enough English to understand the few error and status messages the program has?

I think it's not hard to understand the status messages
However, a proper Chinese language version of the program would be much more helpful for girls and elderly since Samsung sell a lot of pink S8/S7 for this target.

I really love this app (super helpful for me) and I am happy to translate it , but I don't know how to code BTW. :silly: (just a blogger/photographer)

---------- Post added at 12:55 PM ---------- Previous post was at 12:47 PM ----------

@Andylain Please update your link to the "delete original" version to this one. I forgot to include the icon when building it yesterday.

Thank you for the update. I update the link to my blog and facebook fanpage :)
 

Chupi383

Member
Mar 7, 2017
41
44
Boston, MA
@Andylain I've extracted all the user-facing strings from my code. The text in [square brackets] are comments giving some context for the message that follows, and don't appear anywhere in the program.

Code:
=====
[this message is shown in a dialog box if you click cancel on the open photos dialog]

You can use this program 3 different ways:

GUI USE: Just run it. You'll get an file-open dialog where you can open .jpg files. Use ctrl or shift or drag to select more than one.

DRAG & DROP USE: Drag one or more motion photos onto the icon for this exe.

COMMAND LINE USE: Run this program with one or more motion photo file names as arguments. Remember to use "quotes" if there are spaces in the names.

Any way you run it, the original files will not be modified. The extracted photo and video will be stored in *_photo.jpg and *_video.mp4 where * is the name of the original file, minus the .jpg extension.

Coded by Chupi383. All credit for the method goes to goofwear at the XDA forums. I've just ported their .bat file to plain C and Win32.

=====
[this is the title of the program]

Samsung Motion Photo Batch Extractor

=====
[this is displayed in the open dialog, under the box where you can type a filename, in a drop-down list]

Motion Photos (*.jpg)

All Files (*.*)

=====
[this is the title bar of the open dialog]

Open some Samsung Motion Photos

=====
[this message is shown if the user selected a file with a really really long name]

Skipping too-long path: <filename goes here>

=====
[title bar for error dialogs]

Error

=====
[error if the user selects over the maximum number of files (currently 10000)]

You've selected too many files. I can only do up to 10000 at a time.

=====
[error if the user selects so many files the Windows "open" dialog box gives up]

You've selected too many files. Try selecting fewer files and process them in bunches.

=====
[appended to names of extracted files - not sure if these should be translated]

_photo
_video

=====
[error if enough memory couldn't be allocated, possibly because the computer is out of RAM]

Can't allocate RAM to read <number> bytes from <filename>

=====
[error if a file can't be read for some reason, perhaps a damaged disk]

Skipping due to read error:
<filename>

=====
[error if an output file can't be written, generally because of full disk, read only disk, file exists and is read only, or permissions on the folder]

Can't write to <filename>

=====
[message on completion]

Finished extracting Motion Photos
    Photos extracted: <number>
    Videos extracted: <number>

=====
[added to the end of the previous success message if some files didn't contain a photo and a video]

<number> files were skipped because they weren't Motion Photos

=====
[title bar of completion message if at least 1 file was processed successfully]

Success

=====
[title bar of completion message if nothing was done successfully]

Failure

=====
["description" shown in right-click->properties dialog for the exe file]

Extract Samsung Motion Photos to jpg and mp4

=====
["product name" shown in properties dialog for the exe file]

Motion Photo Batch Extractor Utility

If you translate these for me, I'll put them back into my program to make either a Chinese or multi-language version.
 
Here is the translation of Chinese, sorry for the delay of this reply.
BTW, maybe a dialog for user to choose whether delete original files would be a great idea?

Code:
=====
[this message is shown in a dialog box if you click cancel on the open photos dialog]
有三種方式可以使用本軟體:

一:點開軟體後選擇你要轉存的照片,你可以使用Ctrl或是Shift來多選檔案。

二:把你要的照片拖移到本軟體的icon上也能轉存!

三:你也能使用Command Line來處理喔! (記得用”quotes”取代空格)

請放心:無論你怎麼做,原始檔案都不會被修改。轉存成功的檔案將會存在原始檔案位置,並新增為 *_photo.jpg 和 *_video.mp4。

GUI軟體由Chupi383撰寫,軟體內核由XDA forums的goofwear撰寫,Andylain翻譯正體中文,詳細中文使用教學請上「安迪連碎碎念」。

=====
[this is the title of the program]

三星動態相片批次轉存工具

=====
[this is displayed in the open dialog, under the box where you can type a filename, in a drop-down list]

動態相片 (*.jpg)

所有檔案 (*.*)

=====
[this is the title bar of the open dialog]

開啟一些動態相片

=====
[this message is shown if the user selected a file with a really really long name]

已忽略太長的路徑:<filename goes here>

=====
[title bar for error dialogs]

發生錯誤

=====
[error if the user selects over the maximum number of files (currently 10000)]
你一次選太多檔案了。我一次只能處理一萬個檔案。

=====
[error if the user selects so many files the Windows "open" dialog box gives up]

你一次選太多檔案了。嘗試選少一點檔案吧!

=====
[appended to names of extracted files - not sure if these should be translated ]

_photo
_video

=====
[error if enough memory couldn't be allocated, possibly because the computer is out of RAM]

記憶體定位錯誤,無法讀取 <number> bytes 上的 <filename> 檔案,有可能電腦的RAM不足。

=====
[error if a file can't be read for some reason, perhaps a damaged disk]

由於讀取錯誤,已跳過處理:
<filename>


=====
[error if an output file can't be written, generally because of full disk, read only disk, file exists and is read only, or permissions on the folder]

無法寫入 <filename> 可能目的地已滿或是為唯讀。

=====
[message on completion]

動態相片轉存結果:
	有 <number> 張照片輸出成功!
	有 <number> 個影片輸出成功!


=====
[added to the end of the previous success message if some files didn't contain a photo and a video]

<number> 個檔案被跳過了,因為它們不是三星動態相片。

=====
[title bar of completion message if at least 1 file was processed successfully]

轉存成功

=====
[title bar of completion message if nothing was done successfully]

轉存失敗

=====
["description" shown in right-click->properties dialog for the exe file]

批次把三星動態相片轉存成JPG照片和MP4影片!

=====
["product name" shown in properties dialog for the exe file]

動態相片轉存工具


[/CODE]
 

Chupi383

Member
Mar 7, 2017
41
44
Boston, MA
I'm sorry I'm being slow on this. My work has been especially busy lately. This thread isn't forgotten -- I'll make the translated app once I'm over this hump in workload.
 

Chupi383

Member
Mar 7, 2017
41
44
Boston, MA
@Andylain Thank you for the translation! I've finally got a working bilingual exe -- see the original post. Sorry it took a while.

The "delete original" feature is now built into the main exe. You use the /d command line option to activate it. To make a drag-and-drop icon that will delete the original, right-drag it and create shortcut. Then right click the shortcut, go to properties, shortcut tab, and add a space and /d to the end of the target, after the closing quote.

BTW, if you could, please link people to "https://github.com/joemck/ExtractMotionPhotos/releases/latest" to get the exe -- that's a special link that will always go to the latest version I've posted there.

Coming up, I'd like to add an option to add/remove Explorer context menu integration.
 
Last edited:

kiathong

New member
Nov 4, 2011
1
0
This is absolutely amazing. Thank you so much!!

First off, I've been browsing here for some time, but I've just registered so I'm sorry if I'm breaking any etiquette or conventions on posting.

I ran across goofwear's tool to extract videos and photos from Samsung Motion Photos and thought it was useful. But I really wanted something that I'd be able to throw a whole album of motion photos at, rather than doing one at a time with this or the share app. I looked at the .bat file they used and implemented the same technique in C, so it could quickly process many photos. It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.

Here's the exe.
See the main page of that Github repository for more complete instructions and full source.

How to use:
1. Copy your Motion Photos off your Samsung phone, to your PC. Just copy them out of the DCIM folder.
2. Run the program. An "open" dialog appears. Apart from that there's no GUI on this program.
3. Browse to your photos and select them. Hold ctrl to select more than one, or shift to select a range. Or, ctrl+A to select all in a folder.
4. Click Open.
5. Wait. Depending how many you selected, it might take a little bit. When it's done, a message box will appear.
6. You should see *_photo.jpg and *_video.mp4 files next to the originals in the source directory. Note that this program does not modify the original files. It doesn't even open them with write permissions enabled.

Alternately, drag one or more photos from Windows Explorer onto the exe's icon instead of using the open dialog.

Screenshots:

Iho7LzC.png

XXh6sDj.png

Zg0lt2x.png



Version History:

1.0: Initial release
1.1: Added optional compile-time option to delete the original file after extracting
2.0: Refactored a bit, added a proper build system, and multilanguage support; moved to a 'real' Github repo


Andylain has written a Chinese language explanation of the usage of this program, and kindly translated the UI to Chinese (Traditional). To use it in Chinese, either have your Windows set to Chinese language, or rename the exe to put _zh at the end of the name. To use it in English on a Chinese Windows, put _en at the end of the name.

If for some reason you want the old version exe, the old "delete-original" exe, or the old source code, you can still have them.
 

RhinoTMT

New member
Apr 11, 2018
1
0
Thanks

Just wanted to add my thanks for this fantastic tool.

I can't quite believe there's no official Samsung Motion Photo viewer (The Windows app doesn't appear to play Motion Photos). And there's practically no 3rd party support around for what you would think would be in high demand.

So I registered on XDA to show my appreciation. Thanks again.
 

konieckropka

New member
May 29, 2018
1
2
It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.

I also wanted to say thanks! That program is a wish-come-true! I wanted to create some script to batch-process JPG's and extract videos but that .exe is even better.

I have just one suggestion. Would you be able to modify program to set video's
Windows date modified
and maybe even date taken (EXIF) attributes
values to correct date, not current date when the extraction takes place?

7C6Igf0.png


It would help a lot, because Gallery apps or cloud services like Google Photos shows videos sorted / grouped by the date attribute which is different thandate of photo (when you extract old photos from last couple of months you will have a mess).

For now only way is to use some bulk date changer software to fix that - changing dates based on filename pattern, but it would be a nice feature for your exe. Do you think it's doable?


And yes. I created my XDA account just to say thank you for your great program! ;)
 
Last edited:
  • Like
Reactions: goofwear and jelbo

jabur

Member
Feb 27, 2014
7
0
Thanks a lot for this tool, Chupi383!
I'd like to "vote" for konieckropka's suggestion as well. Having the corrent timestamps on the extracted images and videos would be important for a correct file management.
The tool basically needs to read the original "modified timestamp" and set it to the created files (same for "created timestamp").
Could this please be added?
 

Chupi383

Member
Mar 7, 2017
41
44
Boston, MA
Sorry for the delay, guys. I've added timestamp preservation and a -r flag to rename the original instead of adding _photo and _video. You can use -dr to delete the original and don't append _photo or _video to the extracted files.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 18
    First off, I've been browsing here for some time, but I've just registered so I'm sorry if I'm breaking any etiquette or conventions on posting.

    I ran across goofwear's tool to extract videos and photos from Samsung Motion Photos and thought it was useful. But I really wanted something that I'd be able to throw a whole album of motion photos at, rather than doing one at a time with this or the share app. I looked at the .bat file they used and implemented the same technique in C, so it could quickly process many photos. It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.

    Here's the exe.
    See the main page of that Github repository for more complete instructions and full source.

    How to use:
    1. Copy your Motion Photos off your Samsung phone, to your PC. Just copy them out of the DCIM folder.
    2. Run the program. An "open" dialog appears. Apart from that there's no GUI on this program.
    3. Browse to your photos and select them. Hold ctrl to select more than one, or shift to select a range. Or, ctrl+A to select all in a folder.
    4. Click Open.
    5. Wait. Depending how many you selected, it might take a little bit. When it's done, a message box will appear.
    6. You should see *_photo.jpg and *_video.mp4 files next to the originals in the source directory. Note that this program does not modify the original files. It doesn't even open them with write permissions enabled.

    Alternately, drag one or more photos from Windows Explorer onto the exe's icon instead of using the open dialog.

    Screenshots:

    Iho7LzC.png

    XXh6sDj.png

    Zg0lt2x.png



    Version History:

    1.0: Initial release
    1.1: Added optional compile-time option to delete the original file after extracting
    2.0: Refactored a bit, added a proper build system, and multilanguage support; moved to a 'real' Github repo
    2.1: It now preserves timestamps when making the extracted files, and now supports a -r flag to rename the original file instead of appending _photo and _video to the extracted ones.


    Andylain has written a Chinese language explanation of the usage of this program, and kindly translated the UI to Chinese (Traditional). To use it in Chinese, either have your Windows set to Chinese language, or rename the exe to put _zh at the end of the name. To use it in English on a Chinese Windows, put _en at the end of the name.

    If for some reason you want the old version exe, the old "delete-original" exe, or the old source code, you can still have them.
    3
    @Andylain Here's one that deletes the original file after splitting it into photo and video.

    Oops -- turns out it was smaller because I forgot to include the icon last time. I've updated the link now and it points at a new build that has an icon.
    2
    It's written with some direct Win32 API calls, so it's pretty much Windows only though making a cross platform command line version without the open dialog would be trivial. It is a simple program though, so it should work fine on Linux or Mac through Wine.

    I also wanted to say thanks! That program is a wish-come-true! I wanted to create some script to batch-process JPG's and extract videos but that .exe is even better.

    I have just one suggestion. Would you be able to modify program to set video's
    Windows date modified
    and maybe even date taken (EXIF) attributes
    values to correct date, not current date when the extraction takes place?

    7C6Igf0.png


    It would help a lot, because Gallery apps or cloud services like Google Photos shows videos sorted / grouped by the date attribute which is different thandate of photo (when you extract old photos from last couple of months you will have a mess).

    For now only way is to use some bulk date changer software to fix that - changing dates based on filename pattern, but it would be a nice feature for your exe. Do you think it's doable?


    And yes. I created my XDA account just to say thank you for your great program! ;)
    2
    Fair point. I'll add it in a bit when I have the time.
    1
    @Andylain Thanks for linking me to your post, and thanks for writing a Chinese explanation for how to use it. I'm happy for people to use my program if they find it useful.

    Would a proper Chinese language version of the program be helpful, or are most people there able to read enough English to understand the few error and status messages the program has?