Using mplayer/mencoder with 3d videos

Talk about the latest 3D movies in the theater and at home!
User avatar
iondrive
Sharp Eyed Eagle!
Posts: 367
Joined: Tue Feb 10, 2009 8:13 pm

BLC detection testing using mplayer

Post by iondrive »

OK well, I've been away for a while and now I've got BLC (blue-line code) on my mind so I'll post about that but first let me catch up on missed posts that are way too late to respond to. Sorry gyurman.

hi,

Hmmm, best glass/glasses for mplayer, well, it seems like most are pretty similar but I have a red/cyan pair from X3dworld that is a little better than the others because they show less ghosting for some reason. They are small like child-sized but I can fit them inbetween my eyes and my prescription glasses. They are from a credit-card sized CD case with an anaglyph Marvel Comic story that you can read on your computer. These are unfortunately hard to find. But regarding your other question. Yes, you are right, you can't really find red/blue options here so just use the red/cyan and it should still be good. So for you with a left/right video side-by-side, you would use this command:

mplayer -vf stereo3d=sbsl:arcd filename.avi

adapt as needed. If video is squeezed, use sbs2l instead of sbsl (that's a small L on the end there).
You can also change arcd to any of arcg, arch, or arcc, but I feel confident that arcd will be the best. Again, see the manpage for more details. http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.txt (search for stereo3d)

---

now that that's done, let's move on to testing your hardware for BLC detection using mplayer.

BLC detection test using mplayer: (Linux-friendly)
To test for BLC-detection, you could play a video file that has long and short BLC codes on alternating frames but it turns out that you can just use a tiny image file. The image is like a tiny above-below formatted video frame with appropriate BLC codes built-in. Let's call it BLC-test.png. Go ahead and download it if you want to try this. Put it in your mplayer folder or anywhere if mplayer is usable via your PATH variable.

BLC-test.png
BLC-test.png
Here is the short version of the mplayer console command:
(you might want to put it in a .bat or .sh file)

*** simple BLC detection test for 1024x768 resolution. Change value of scale for other resolutions.
mplayer mf://BLC-test.png -vf il=i,tfields=0,scale=1024,dsize -fs -loop 180

Run this in the same folder as the image and watch your glasses to try and confirm any shuttering. There is a long version of the above command and the major difference is in the location of the blue lines, mid-screen or bottom. It turns out that my eDimensional dongle still gets triggered even if the blue lines are in the middle of the screen so that enabled me to make a simpler command. If you want the lines on the bottom, then see the long version below. The video is only a few seconds long and the only thing you might need to change in the command is the number 1024. This should be the current pixel-width of your screen's resolution. Either change your display to 1024x768 or change the number 1024 to whatever your screen's current width is. You should probably stick with 32 bits per pixel but I don't think that matters. This command works on my 7800GTX and even on my old geforce-2 laptop so I expect it to work for you too if you have an nVidia card although I could be wrong since I don't have all cards. Regarding ATI cards,I don't have any so I can't really be sure that it will work on them. Testers' results are welcome. Important: v-sync should be set to "on" or "application" but preferably "on".

test image properties:
right view is in the upper half, left view on bottom
blue lines are two pixels tall to make detection easier
resolution is 16x32 pixels
image is png and not jpeg since jpeg is lossy although jpeg can also work, png is more reliable.
image is not considerred squashed vertically, but only squeezed horizontally.


I started testing with a longer version of the command and trimmed it down to what still worked so if the above command doesn't work, you may want to try the longer version.

mplayer command, the long version:

*** BLC detection test for 1024x768 screen res.
mplayer mf://BLC-test.png -sws 4 -vf il=i,tfields=0,scale=1024:16,expand=1024:768:0:752,dsize -vo gl -fs -loop 180 -fps 60

Explanation:
mf://BLC-test.png --> this is how you input an image file as if it were a video frame.
-sws 4 --> this chooses a point-scaler that does not blend neighboring pixels when you stretch the image.
-vf --> start listing video filters
il=i --> "interlace" turns above/below stereo format into interlaced format
tfields=0 --> turns interlaced format into frame sequential format with half-height res (16x32-->16x16) at twice the frame-rate.
scale=1024:16 --> stretches image horizontally (16x16-->1024x16)
expand=1024:768:0:752 --> fill/pad screen vertically with black while positioning blue lines on bottom of screen (768-16=752)
dsize --> do not do any aspect fixes. make output video same as current video image res (1024x768).
-vo gl --> try to use OpenGL display pipeline. More reliable for this test than directx. Try directx if you want.
-fs --> show video in fullscreen mode
-loop 180 --> this loops the video (image in this case) 180 times.
-fps 60 --> this sets the frames per second input rate to 60. This value should be fine even if you're not at 60 Hz as long as vsync is on and your display is not more than 120 Hz. If unsure, set it to half your true refresh rate since output rate should be doubled via tfields=0


For other resolutions, you have to change the numbers to match your res...

*** BLC detection test for 1920x1080 screen res.
mplayer mf://BLC-test.png -sws 4 -vf il=i,tfields=0,scale=1920:16,expand=1920:1080:0:1064,dsize -vo gl -fs -loop 180 -fps 60

That's it for now.

--- iondrive ---
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “3D Movies (Blu-Ray and Theater)”