Tuesday, June 12, 2012

Convert and display 3D MPO pictures on your 3DTV

3D pictures are typically in .mpo format, basically two jpg files concatenated. There many image viewer can see the first (left) image while ignoring the other.

First you have to split the two images. In Linux, there is a tool for that - exiftool. Just type in the command and the os will tell you how to install it.

Then you have to resize and stitch the pair of images together, side-by-side or top-to-bottom.  The former is for active 3DTV's, but for the newer passive TV's, top-to-bottom is the best option.  In Linux, there is imagemagick for everything (convert).

The complete bash script, let call it ttb:  (I put it together from the web.)

name=`basename $1 .MPO`
echo $fname
exiftool -trailer:all= $1 -o $fname.lt.jpg
exiftool $1 -mpimage2 -b > $fname.rt.jpg
convert -append $fname.lt.jpg $fname.rt.jpg -geometry '1920x540!' -mosaic $fname.ttb.jpg

The command
#ttb mypic.mpo

will generate mypic.lt.jpg and mypic.rt.jpg and then stitch them into mypic.ttb.jpg.  This assumes your picture size is 1920x1080 pixels.

It's trivial to modify the script to go through all the .mpo files on the camera attached as an USB drive.  Then image management software such as shotwell can import the left and right and ttb images separately.

Typically 3DTV's can't display the .mpo files directly, nor the TTB (or SBS) images.  They do recognize mpo files, nor expect any 3D picture formats.   Therefore in picture mode, the TV's don't allow or expect any 3D mode.

Typically 3D video cameras have mini HDMI ports.  You can display mpo files correctly via the HDMI into your TV.  But this is not practical.  You have to store everything in the cam, or load a slideshow into your cam every time.

Luckily, reading from USB drives is a capability for Vizio TV's as well as blu-ray players.  When the TV receive signal from the player via HDMI, the TV doesn't care it's video or pictures.  So you can set you TV to 3D TTB, the same as you set for 3D movies.  I still haven't buy a single blu-ray disk yet.  But the display of 3D pictures make it all worthwhile.

Unfortunately, although the Walmart TV can read from external USB drive, the Blu-ray player can only read from USB flash drives.

No comments: