jPS2MPO : Convert JPS file into an MPO file

Post Reply
philipkd
One Eyed Hopeful
Posts: 9
Joined: Mon Feb 28, 2011 11:25 pm

jPS2MPO : Convert JPS file into an MPO file

Post by philipkd »

Is there a command-line tool/method for converting from a JPS to a MPO file. I'm trying to preview 3D files on my Nintendo 3DS which only reads .MPO files.

I'm able to concatenate two left and right jpegs from the JPS file into something resembling an MPO file. However, I need to be able to edit/modify the MP tags in the MPO. Unfortunately, exiftool does not know how to write the MP tags because they're too obscure and the author hasn't gotten around to it.

I was thinking of taking a pre-existing MPO file, and replacing the left and right JPEG data with the new file. I'm not sure how to go about doing that, though, so any suggestions would be much appreciated.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: jPS2MPO : Convert JPS file into an MPO file

Post by cybereality »

I don't know of any command-line tools (I could write one, but there's only so much time). This might help, though:

[youtube]http://www.youtube.com/watch?v=ItD6tUh3Vhw[/youtube]
philipkd
One Eyed Hopeful
Posts: 9
Joined: Mon Feb 28, 2011 11:25 pm

Re: jPS2MPO : Convert JPS file into an MPO file

Post by philipkd »

Cool thanks, yeah, I want a command-line tool so I can add this functionality to 3DPorch.com and automate it for everybody.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: jPS2MPO : Convert JPS file into an MPO file

Post by cybereality »

Heres the source code for my program that converts Fujifilm MPOs to JPS files:
MPO2JPS.cpp
It may be a good starting place to doing the reverse. Basically what you need to do is extract the left/right images from a JPS file (which is basically just a side-by-side RL image). Then take those two images and save them as JPEG files. Then take those two saved files and concatenate them into one file and save as MPO. You may or may not need to edit the EXIF data to special parameters used by Nintendo (probably not). Should be pretty simple, and the code I posted should help if you already know C++. Keep in mind that utility has problems with the Nintendo 3DS MPO files, as they seem to be slightly different than the Fujifilm version. I have not looked into this further, but just a heads-up.
You do not have the required permissions to view the files attached to this post.
philipkd
One Eyed Hopeful
Posts: 9
Joined: Mon Feb 28, 2011 11:25 pm

Re: jPS2MPO : Convert JPS file into an MPO file

Post by philipkd »

That looks pretty helpful. I might be able to seek out the binary data out of a template MPO file and change it out with new left and right images.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: jPS2MPO : Convert JPS file into an MPO file

Post by cybereality »

All the MPO format is is 2 JPG files literally duct-taped together. If you have two JPG files (for example that you could output from the LibJPEG library) then you just need to combine the binary data together. In my code I am splitting the MPO file into JPEGS, you would just need to combine (actually concatenate) them together. Pretty simple.

Also, you said you wanted to add this to 3DPorch.com. How so? Do you want this to run on the server-side automatically as people upload images. That could get a little more complicated. Please explain exactly what it is you are trying to do, maybe I can help.
philipkd
One Eyed Hopeful
Posts: 9
Joined: Mon Feb 28, 2011 11:25 pm

Re: jPS2MPO : Convert JPS file into an MPO file

Post by philipkd »

I'm the creator of 3DPorch.com. Right now users can upload .mpo files and .jps files and they get converted to anaglyph and wigglescopy through some server-side scripts I wrote. If they upload .mpo files, I'm able to create a .jps file. But if they upload a .jps file, I can't make the .mpo file.

I wrote a script that concatenated two .jpg files into an .mpo file, and when I loaded it on my 3DS, it did not show in 3D, it just showed the first jpeg. My guess is that I need some of the MP exif flags included for the 3DS to figure it out. One of the markers indicates where in the file the second jpeg starts. These are the MPO-format related tags:

Code: Select all

MPF Version                     : 0100
Number Of Images                : 2
MP Image Flags                  : (none)
MP Image Format                 : JPEG
MP Image Type                   : Multi-frame Disparity
MP Image Length                 : 70806
MP Image Start                  : 60300
Dependent Image 1 Entry Number  : 0
Dependent Image 2 Entry Number  : 0
MP Individual Num               : 1
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: jPS2MPO : Convert JPS file into an MPO file

Post by cybereality »

Yeah, that makes sense. Would a Windows command-line utility work with your backend? This doesn't sound that difficult to do.
philipkd
One Eyed Hopeful
Posts: 9
Joined: Mon Feb 28, 2011 11:25 pm

Re: jPS2MPO : Convert JPS file into an MPO file

Post by philipkd »

Unfortunately my server's a Linux machine. However, if you had source code for a command-line tool on Windows, I could recompile it for Linux.

Thanks.
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: jPS2MPO : Convert JPS file into an MPO file

Post by Fredz »

Maybe the best solution would be to write a converter in PHP, using its EXIF functions for 3DS compatibility and something like GD for converting the images between JPS and MPO. If you can't program there are some websites where you can offer a bounty for a programming task.
philipkd
One Eyed Hopeful
Posts: 9
Joined: Mon Feb 28, 2011 11:25 pm

Re: jPS2MPO : Convert JPS file into an MPO file

Post by philipkd »

Hi Fredz, do you know what sites where I could offer a bounty off the top of your head?
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: jPS2MPO : Convert JPS file into an MPO file

Post by Fredz »

You can try those :
- http://www.freelancer.com/" onclick="window.open(this.href);return false;
- http://www.vworker.com/" onclick="window.open(this.href);return false; (ex Rent A Coder)
- http://nextsprocket.com/" onclick="window.open(this.href);return false; (code then released as Open Source)
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: jPS2MPO : Convert JPS file into an MPO file

Post by Fredz »

Here you can see how to manually convert 3D images (MPO or side-by-side) in the format accepted by the Nintendo 3DS :
http://operationyashima.wordpress.com/2 ... tendo-3ds/" onclick="window.open(this.href);return false;
Post Reply

Return to “General Stereoscopic 3D Discussion”