MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by cybereality »

jimmydonc wrote:seriously how does your application work? Is there some long way around? what's the difference between an MPO and a jpeg? I changed the extension to jpeg out of curosity and was able to open it in photoshop. Of course it was the same as the 2 d jpeg. not it's stereo pair. where's that second image hiding in there??
Ok, let me give you a proper response. Basically an MPO file is just two standard JPEG files appended together. All my program does is slice the file into two and save the data with the JPEG extension. There is no conversion going on. The reason renaming the file to JPG works is because it is basically JPEG data. So an image program (like photoshop) will start reading the file as a JPEG and all is fine until it hits the End Of Image marker. The second image is right after that but the program is only expecting one image so it stops there. You can extract this data manually, but it will be time consuming for more than just a couple of pictures at a time. However if you have no other choice, here is how to do it.

- First off, you will need a Hex editor to manipulate the file. This one for Mac looks decent: https://www.ifd.com/product_info.php/products_id/87" onclick="window.open(this.href);return false;

- Open the MPO file in the Hex editor. Start a new search, set it to "Hex" and search for this string "FFD8FFE1". That is the Start Of Image marker for a standard JPEG/EXIF file. Your first find will be the beginning of the file naturally, so hit "Find Next". This will be the break point between the image data.

- Select all the data before this point and save it to a file with the extension "JPG", this will be the left image. Most hex editors will let you do something like "Save selection to file" or something similarly named. Now select all the data after the marker (and including the marker) and save this to another JPG file. This is the right image.

- Thats it, you're done. You now have both stereo pairs.

Obviously this is not very practical for a large set of images, but its at least a solution.

I am looking into how I can make my program for the Mac and I found a way to install OS X on my PC. If I can get OS X running it should be fairly simple to just re-compile the program for use on Mac. However this is a whole other can of worms to get into, so its probably going to be another week to two before I could have this done. But I am looking into it. I am also working on a fully featured 3D image editing program (to compete with StereoPhoto Maker) and now that I think of it, it would be nice to have cross-platform support (PC, Mac and maybe Linux). Would help at least to give me an edge. Macs are also popular with the photography crowd so if this Fujifilm camera becomes popular I could see a lot of demand for something like this. I'm not making any promises, but it is on the table.
jimmydonc
One Eyed Hopeful
Posts: 5
Joined: Mon Aug 31, 2009 1:19 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by jimmydonc »

a week or 2? thats all? hey. I'll wait for you. I'll donate some money for your efforts.

if you are making a program, may I offer a suggestion. a fun thought. I made a template in photoshop that I can put a stereo pair into so I can print out old timey stereoscope cards. That would be a neat plugin. easy enough to do in photoshop but would be awesome to have some automatic program.
Speaking of automatic. Batch features. I constantly use the batch feature in photoshop to apply effects to large numbers of files. A bath feature in your program would be cool too.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by cybereality »

jimmydonc wrote:A batch feature in your program would be cool too.
Yeah, it already does that. You can just drag any arbitrary amount of MPOs onto the exe file and it will convert them all.
scrameta
One Eyed Hopeful
Posts: 4
Joined: Sat Sep 05, 2009 5:23 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by scrameta »

I have a Mac and wanted to split some MPO's so built a little java app. Just extract the DMG, run SplitMPO, click "Convert File", Select a file. It writes a filename_l.jpg (left eye image) and filename_r.jpg (right eye image).

http://ssh.scrameta.net/www.scrameta.net/SplitMPO.dmg

I know the program is rubbish, but it does the job for now until someone writes something better...

Mark

Edit:Fixed URL
You do not have the required permissions to view the files attached to this post.
Last edited by scrameta on Mon Sep 07, 2009 5:17 am, edited 1 time in total.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by cybereality »

scrameta wrote:I have a Mac and wanted to split some MPO's so built a little java app. Just extract the DMG, run SplitMPO, click "Convert File", Select a file. It writes a filename_l.jpg (left eye image) and filename_r.jpg (right eye image).
Very nice work man.
scrameta
One Eyed Hopeful
Posts: 4
Joined: Sat Sep 05, 2009 5:23 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by scrameta »

I had a quick play to improve this this morning, since viewing them was annoying me! i.e. open left/right, resize windows etc...

Anyway it has some new features:
i) Convert a whole directory
ii) Displays last converted image
iii) Ability to select previously converted images (from current directory)
iv) Crosseyed or straight option

http://ssh.scrameta.net/www.scrameta.net/SplitMPOv2.dmg

I've also attached the jar in case someone wants to try this on a non-Mac. I think I might need to fix directory selection on non-Macs...

Mark

edit: Fixed URL
You do not have the required permissions to view the files attached to this post.
Last edited by scrameta on Mon Sep 07, 2009 5:17 am, edited 1 time in total.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by cybereality »

This is really great news, now I don't have to bust my balls porting to Mac.

I am in the process of adding support for JPS output and hopefully that will be done soon (almost working now).
scrameta
One Eyed Hopeful
Posts: 4
Joined: Sat Sep 05, 2009 5:23 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by scrameta »

Yes I should add JPS output too. Just jpeg with the images next to each other right? Also I think animated gif for the wiggle style viewing would be good. Have to see how much Java will just do for me for almost free...

I'd offer to do the Mac port of your stuff, but I can't be bothered to learn Objective C and the OSX API right now!

Has anyone with a Mac tried this BTW? In case I messed up the deployment and it only runs on mine...

Mark
BDJ
One Eyed Hopeful
Posts: 1
Joined: Sat Oct 10, 2009 6:31 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by BDJ »

I just got a FUji W1 today. I almost sent it back until I downloaded your app for the MAC. It works fine for me (IMAC 20" Intel)

Bernard
User avatar
grumpyMike
One Eyed Hopeful
Posts: 1
Joined: Tue Oct 13, 2009 3:23 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by grumpyMike »

I have just updated my 3D slide maker for the Mac to include MPO files.
It's free at:- http://www.thebox.myzen.co.uk/Steroscop ... tware.html
It's a bit of a hack, let me know if it works for you.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by cybereality »

I figured I'd post the source in case anyone wants. I compiled using Visual C++ 2008 Express, but it should work with any compiler.
MPO2Stereo.zip
You do not have the required permissions to view the files attached to this post.
ArmanHunanyan
One Eyed Hopeful
Posts: 1
Joined: Wed Nov 04, 2009 1:25 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by ArmanHunanyan »

I am developing C++ class MPOWritter. The goal is to write mpo files which can be opened with Fuji Finepix V1 digital frame. The class is almost complete but it has some issue. I am looking tool that will help me to find that issue. I found Stereo Photo maker program, which has functionality to create MPO files. It also can preview mpo files. When I created mpo file with that program digital frame opens it as mpo file. When I creating mpo file using my class frame doesn't recognize it as MPO file. It opens file as single image. However stereo Photo Maker opens that file as MPO image. When I using your MPO2Stereo tool Left image becomes invalid jpeg while right image becomes valid. I think having your sources I will easily debug and find issue. Could you send it to my email arman.hunanyan@gmail.com. Thanks in advance
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by cybereality »

The source is posted in the post directly above the last one. It should be pretty easy to follow. The MPO is basically just two JPGs in one file, as I'm sure you realized. The left image is first, then the right image. If your left image is getting corrupted then most likely you are not writing the proper end of file marker for the JPEG/EXIF data. Take a look at some real MPO files and split them with my program if necessary. Then use a hex editor to check the last byte of data. That is most likely where the error is.
scrameta
One Eyed Hopeful
Posts: 4
Joined: Sat Sep 05, 2009 5:23 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by scrameta »

That Slide Maker looks cool. Any chance of a PPC tiger build? :-)
Vsevolod
One Eyed Hopeful
Posts: 1
Joined: Wed Jan 20, 2010 6:21 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by Vsevolod »

There is another way to work with MPO files. Latest version of STOIK Imagic 5.0.4 (http://www.stoik.com/imagic" onclick="window.open(this.href);return false;) can split MPO files such as made by FujiFilm FinePix Real 3D W1 into standard JPEGs, generate stereo pairs (JPS, PNS), and anaglyphs. STOIK Imagic is free, but some advanced features will require purchase of activation key after initial 30 days. Splitting of MPO into JPEGs is available in free version.
magestik
Two Eyed Hopeful
Posts: 79
Joined: Tue Dec 22, 2009 11:48 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by magestik »

Hello,

I'm working on S-3D apps for Linux. I wan't to include MPO viewing or converting. But I can't find MPO files.
Can you help me please ?

Thank you,

Magestik.

PS: Sorry for my bad english ... I'm french.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pairs

Post by cybereality »

There are some MPO files in this post:
http://www.mtbs3d.com/phpBB/viewtopic.p ... 306#p32306" onclick="window.open(this.href);return false;
quizpalme
One Eyed Hopeful
Posts: 2
Joined: Wed Aug 25, 2010 2:11 pm

Convert all Fujifilm MPO files to JPS

Post by quizpalme »

I have found the link to this page in the program from here:
http://3dvision-blog.com/tag/mpo2jps/" onclick="window.open(this.href);return false;
I like that program, but I needed to convert all files of a directory.
I have modifed the BAT-file to convert all MPO-files of a directory to JPS-files:

FOR /F %%i IN ('dir /b /s *.mpo') DO (
"%~dp0\MPO2Stereo.exe" "%%i"
"%~dp0\jpg2jps.exe" "%%i" -delete
)

Maybe this is helpfull for other people too...
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

You can also simply drag a number of files over the EXE and it will convert them all at once.
quizpalme
One Eyed Hopeful
Posts: 2
Joined: Wed Aug 25, 2010 2:11 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by quizpalme »

Yes, I like your program and I can drag a number of files over the EXE, but that does not work with the batch-file, which creates a JPS-file too.
You find it when you click on the link I have submitted before.
I have now found a way to resize the new JPGs too. Maybe this is a more interesting feature for other users
(because you can now create easily jps- and jpg-files for your website which your custom resolution):

Code: Select all

@echo off
set linksa=_L.JPG
set rechtsa=_R.JPG

if %1.==loop1. goto loop1

FOR /F %%i IN ('dir /b /s *.mpo') DO call %0 loop1 %%i
goto ende

:loop1
"%~dp0\MPO2Stereo.exe" "%2"
set alt=%2
set neu=%alt:~0,-4%
"c:\Program Files (x86)\IrfanView\i_view32.exe" "%neu%%linksa%" /resize_long=800 /aspectratio /resample /convert="%neu%%linksa%"
"c:\Program Files (x86)\IrfanView\i_view32.exe" "%neu%%rechtsa%" /resize_long=800 /aspectratio /resample /convert="%neu%%rechtsa%"
"%~dp0\jpg2jps.exe" "%2" -delete
goto ende
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

You may also want to take a look at my other utility, MPO2JPS, which converts directly to JPS:
http://www.mtbs3d.com/phpBB/viewtopic.php?f=3&t=4419" onclick="window.open(this.href);return false;
zbr
One Eyed Hopeful
Posts: 4
Joined: Tue Sep 14, 2010 3:32 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by zbr »

thanks for writing MPO2Stereo, cybereality
thanks for writing SplitMPOv2, scrameta

they make the W1 usable ; P
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

No problem. Anything I can do to help.
ALeeSVI
One Eyed Hopeful
Posts: 1
Joined: Thu Jan 20, 2011 1:06 pm
Location: Toronto, ON Canada
Contact:

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by ALeeSVI »

Great program, but I was unable to use the MPO to JPG converter to convert by dragging from windows. It will run the converter, but the physical files are never created. I had to do it one by one from the dos promt.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

Yeah, there was a problem with the file paths. I know on Vista 32-bit it works perfectly and you can drag and drop files on the exe. Other OSes may not not work the same, but the files should still be created. Its just that the folder is wrong. I don't remember where the JPEGs went, but they're on your computer somewhere. You could try searching for the filename and see if it comes up (for example: myImage.mpo would become myImage_L.jpg and myImage_R.jpg so search for that).
philipkd
One Eyed Hopeful
Posts: 9
Joined: Mon Feb 28, 2011 11:25 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by philipkd »

I tried the hex technique that cybereality suggested, and I noticed that the first image isn't always the left image. Here are two MPO files. What's interesting is they both have the same camera make, model, and software. I'm working on parsing the MPO file specification to see how I can determine the difference between the two.

DSCF0006 (chess) has the left-eye content as the first image.
DSCF0035 (bench) has the right-eye content as the first image

I have a batch of 25 sample MPO files, and 6 of them has the left-eye first, but 19 of them have the right-eye first. These are taken from Fjufilm's Real 3D W1, W3, and Sony DSC-TX9

Any ideas?

Thanks,

- Phil
You do not have the required permissions to view the files attached to this post.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

Interesting. Not sure what the answer is. All the MPOs I was testing with I believe were Left eye first, and I tried at least a dozen. But its possible there is something else going on. I am planning on picking up the W3 at some point, so that will make it a lot easy for me to test these things and update the program.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

@philipkd: I just looked at those images you posted and they are fine. Tried them with the DDD photo viewer and they looked good. Then I converted them to JPS using my MPO2JPS utility and the JPS files were rendered correctly. So I assume those images had left image first, just like all the other ones I tried. So I am not sure what they were supposed to prove.
philipkd
One Eyed Hopeful
Posts: 9
Joined: Mon Feb 28, 2011 11:25 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by philipkd »

Thank you for verifying this. You're right. I made the wrong guesses as to which eyes the images corresponded to. My mistake was not cropping appropriately according to parallax information. I found out how to do it here:

http://www.davidglover.org/2010/09/usin ... xunix.html" onclick="window.open(this.href);return false;
philipkd
One Eyed Hopeful
Posts: 9
Joined: Mon Feb 28, 2011 11:25 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by philipkd »

I just wanted to let you know I finished my website that'll convert MPO to various formats: http://3dporch.com/" onclick="window.open(this.href);return false;

I gained a lot from the resources in this thread, so I want to thank you. Have a go at the site, and let me know what you think!
Mich
One Eyed Hopeful
Posts: 1
Joined: Sat Mar 26, 2011 12:40 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by Mich »

Surry guys for stupid question, but I'am beginer on your forum and in 3D technologies also and not in good english speaking performance (Iam ukrainian). In this topic I found lot of useful link and participant of this forum seems very professional. In this case let me ask you, is the any analog of StereoTracer software for mac for making this lovely GIF. I mean not a simple gif animation from MPO file, I mean good mathematic algorithm as in link above.

Thank for reply before :)
shortcipher
One Eyed Hopeful
Posts: 1
Joined: Thu Jun 16, 2011 1:53 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by shortcipher »

I used cybereality's idea to get the left and right images in Python using the Python Imaging Library. This example doesn't save the images, as I am using them in a Python app:-

from PIL import Image
from StringIO import StringIO
file = open(r'F:\My Pictures\FinePix W3 3D\DCIM\100_FUJI\DSCF0007.MPO', 'rb')
left = Image.open(file)
left.show()
file.seek(4) # skip SOI and APP1 markers of 1st image
data = file.read() # read both images
file.close()
offset = data.find('\xFF\xD8\xFF\xE1') # find SOI and APP1 markers of 2nd image
file = StringIO(data[offset:]) # make a file containing the 2nd image
right = Image.open(file)
right.show()
file.close()
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

Ok cool.
ozzman2020
One Eyed Hopeful
Posts: 2
Joined: Wed Apr 18, 2012 8:48 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by ozzman2020 »

Hey guys, thanks for all the great work. I recently bought a viewsonic 3DPF8 3d Digital frame. I converted my .mpo files to side-by-side .jpg using Mpo2Stereo, but when I view the image on the digital frame, it displays it as 2 2D side-by-side images instead of 1 3D image. Its not the frame, because I tried loading some side-by-side images that I found online and they seem to work great. I also tried the stereo photo maker, but get the same results. Any help is greatly appreciated. Thanks in advance!.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

Can you post one of the images that works so I can see the format? Also, you may want to try MPO2JPS and then renaming the files to JPG.

http://www.mtbs3d.com/phpBB/viewtopic.p ... 19&p=31457
ozzman2020
One Eyed Hopeful
Posts: 2
Joined: Wed Apr 18, 2012 8:48 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by ozzman2020 »

Thank you very much cybereality. I tried the MPO2JPS and it seems to work now. Thanks!!!
idushy
One Eyed Hopeful
Posts: 3
Joined: Thu Jun 05, 2014 11:56 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by idushy »

ozzman2020 wrote:Thank you very much cybereality. ..
+1
But. How to work with multiple images simultaneously?
that is, how to handle multiple photos at a time?
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

You can just drag multiple files onto the exe file at once.

Or you can use a command window and type each name out, ie:

MPO2Stereo.exe img1.mpo img2.mpo img3.mpo ...
idushy
One Eyed Hopeful
Posts: 3
Joined: Thu Jun 05, 2014 11:56 am

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by idushy »

tried - http://yadi.sk/d/3aE7NALUSXHpk
I do something wrong?
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: MPO2Stereo: Convert Fujifilm MPO files to JPEG stereo pa

Post by cybereality »

That batch file is not my work, and I don't know how to use it.

Please use the exe file from this post: http://www.mtbs3d.com/phpBB/viewtopic.p ... 19&p=31457
Post Reply

Return to “General Stereoscopic 3D Discussion”