It is currently Fri Apr 18, 2014 9:01 am

Reply to topic  [ 41 posts ]  Go to page 1, 2  Next
 Using mplayer/mencoder with 3d videos 
Author Message
One Eyed Hopeful

Joined: Tue Nov 30, 2010 12:10 am
Posts: 3
Yes I agree but I also don't. To save us time rendering it twice (side-by-side and single images) we were just going to render with single images (one for left one for right) and then we could do whatever we wanted to! ImageMagik is good idea thanks ;)

Wed Dec 01, 2010 11:17 pm
Cross Eyed!

Joined: Sun Feb 15, 2009 12:50 pm
Posts: 131
Sorry, it looks like i misinterpreted your post - the software i referred to is a _player_ not an encoder.
I concur that imagemagik then is probably the way to go in your case since you are already working with a set of still images.
Good to hear that Sintel is getting the stereoscopic treatment - i look forward to seeing the final result!

PS What viewing solution are you using for S3D?

Thu Dec 02, 2010 8:59 am
Sharp Eyed Eagle!
User avatar

Joined: Tue Feb 10, 2009 8:13 pm
Posts: 367
hi guys!!!

I'm still alive if any of you were wondering what happened to me. I just haven't been reading/posting for a very long time... distractions abound. I don't know if I will get back into the habit of posting more actively but I'll just do a little right now at least.

New stereo3d functions in mplayer source!!! YAY!
This happened late last year but I'm actually not that excited about it since it doesn't really add formats that I could not do before except for easy stereo-to-anaglyph conversion for those times when you want that. Since it's new code, you could have some trouble finding a compiled version of mplayer/mencoder that has it but I found one for windows at
and tried it and it worked. The file was for athlons: mplayer-athlon-svn-32848.7z

The code adds a video filter called stereo3d and you use it in your -vf segment as in
mplayer futbol-3d.mpg -vf stereo3d=sbsl:agmh,scale
to go from LR to anaglyph green/magenta-half-color while converting on-the-fly.
This works with mencoder too so you can make 3d anaglyph videos if you want but I would just keep the originals and just convert on-the-fly as needed. My feelings about anaglyph are that it's not too repulsive and it's a good option for printing out a screenshot on paper. Remember to use scale after stereo3d or else mplayer will crash.

Anyway, there's more info in the man-page at
Once you are there, search for "stereo3d" and that should take you right to it.

NOTE: if you Google mplayer manpage, you can wind up at the Tivo mplayer manpage which is missing alot of functions in the full source so don't freak out if you don't see the options you're looking for. Just go to instead.

Basically the format is stereo3d=input:output format and the possible s3d formats for in/out are:
LR, RL, L/R, R/L, and squashed L/R, R/L.

Output also includes various anaglyph color-sets...
3 kinds of yellow/blue (gray, half-color, and color)
3 kinds of green/magenta (as above)
4 kinds of red/cyan (as above plus dubois)

as well as mono left or right view.

Anaglyph red/cyan dubois?...
I had to try that one and I think it did look the best of all the red/cyans but it might depend on your particular content. The manpage says it is "color optimized with the least squares projection of dubois". Oh, of course. I should have realized that myself. :)

What's missing from the stereo3d option: half-mirrored modes and checkerboard outputs.
I'm glad this is in the code and there's a chance that this function may do a better job at converting between formats but as I said before, we already could do those conversions so this doesn't add much except for easy anaglyph conversion. What's missing is half-mirrored modes as well as checkerboard outputs. That would have been a more welcome addition to the conversions we already can do. I will for the most part not use this new function since the old approach works with older mplayer versions too. Half-mirrored modes should be easy. Maybe someone will contact the author of that subroutine and suggest it to him/her. Volunteers? I have other things on my mind. Also missing is frame-sequential and field-sequential as well as vertical interlaced. Good thing we can do all those already.

Odd-colored glasses:
If your glasses are colored backwards for some reason, it seems like you should just be able to swap eye-views prior to the stereo3d function and it should then look right to you with those odd glasses. See above posts for examples using il=s for eye-view-swapping / parallax-inversion. The other thing missing is arbitrary user-color choices for glasses. A calibration test pattern would also be nice. OH, better yet, just lie to the program instead of swapping views. If you have cyan/red glasses instead of red/cyan, then just pretend the format is opposite when you run the command Use RL when you really have LR and use BA when you really have AB). Also, treat red/blue glasses as red/cyan. That should work well enough.

Hmmmm, should I pick up where I left off or respond to posts I've missed out on? I will respond to posts.


to chinesebob:
Hi guy, how did you find this thread? It's kind of buried. I'll have to put all this in a web page some day rewriting some of the things I've learned. It looks like I'm accidentally writing a book. Anyway, nice to see a new poster. Regarding anaglyph generation, you see I've answered your question with the above info so there you go. Sorry to not reply sooner. Let's see, what else...


to jduncantor:
What you want is AviSynth. It is a really neat helper program that I've started to use late last year and I really like it. However, I'm not ready to post about it at this point in time but it's pretty easy once you get the idea of it. You will be able to then use mplayer/mencoder to reference a fake video file that is really a text file that refers to your real 2 video files. Basically you make a text file that mentions your 2 video files and change the extension of that file from .txt to .avs, then you pretend that that file is a video file and do mencoder file.avs and that will make your new combo file side-by-side or over/under. bounces you to and you can go from there. What you want to click on is "filters", then "internal filters", then search/find StackHorizontal or StackVertical. Read/look/study/research examples and I'm confident you will be on your way to happiness and satisfaction. There could be some stumbling blocks for you though if your files are mpegs. Convert them to avi's and that will help make things a little simpler. Oh, I guess I was able to talk about this stuff now although I would have liked to expand on this more, I'm a little rusty with AviSynth right now. I've used it to add Blue-line-codes to my 3d videos that auto-trigger my shutterglasses so it's pretty great!

Oh, darn. After all that I just remembered SMM (StereoMovieMaker). It can do what you want easier. Google it. I don't know if there's a Linux version of that. Oh wait, I don't think it can input png files, just separate video files. Oh well. Just try AviSynth.

Oh yeah, AviSynth is for windows but I've heard that it works with Linux by using Wine although I haven't tried it myself.

mplayer and HD:
mencoder IS capable of HD as the user is control of the quality settings depending on the codecs used but for stereo3d, I recommend the above-below format since mencoder can crash if you try to make a video-file that is over 2000 pixels wide. Side-by-side HD would be 1920x2=3840 pixels wide although I believe you can edit the source and recompile mencoder so that it can handle that res. I would just user RO/UL which I'm starting to call RoL for short (Right-over-Left). My videocard is older so I have trouble with the playback of that high of a res (1920x2160) but I think modern cards should handle it fine. Maybe I need a quad-core which is what I've heard for Blu-Ray-3d. Anyway, it's not mplayer's fault if my system can't handle the res.

mplayer, AviSynth and png files:
mplayer/mencoder can input png files but what I've suggested was AviSynth. I'm not sure if it can import png files. Wait let me check... Yes! It can! Find ImageSource in the internal filter page and go from there. Else you could use mencoder to make avi files and use AviSynth with them instead.

YouTube videos:
Just make a side-by-side video that is 1280x720 and RL instead of LR and things will be easier for you. Go ahead and squash/squeeze the video into that frame and fix the aspect with the aspect youtube-tag. Reread some of my above post and upload your video to YouTube and post a link here so we can see/find it easily. Good luck!


Hi Mickeyjaw, I'll put bino on my to-try list but who knows when I'll get to it...
Just took a look. It's a nice clean simple webpage just like I like. Seems like it should be decent but I see it also has no half-mirrored modes. Oh well, I don't need those anyway.


Hi Fredz,
Oh, you already answered JD's question. Oh well.


OK, all caught up. No wonder I took such a long break. I guess I get carried away with these posts and get burnt out. Hmmm, what else...?

Spanning mode display under Windows:
Earlier in this thread I wondered how to do dual screen video in Windows and it turns out that the answer was to use -vo directx:noaccel or -vo gl since -vo directx (the default) only works on one screen at a time when playing a video. The other screen is green if you use spanning mode with two monitors/projectors. So now we know how to use mplayer to play 3d videos with dual projectors and horizontal or vertical spanning mode. It was just something simple like -vo directx:noaccel although as mentioned earlier your system might not be fast enough in software display mode to show HD 3d. If so, try -vo gl (openGL mode). If that doesn't work, then I guess we're stuck using some other program or else 2 mplayer programs simultaneously?

Does anyone know how to use FIFO's to control two mplayer programs simultaneously using tee or something? That would be slick.


OK, that's it for now. I've more to say but let's call it a night. Good night all.

--- iondrive ---

Last edited by iondrive on Tue Mar 13, 2012 7:49 pm, edited 6 times in total.

Wed Feb 23, 2011 5:27 am
Sharp Eyed Eagle!
User avatar

Joined: Tue Feb 10, 2009 8:13 pm
Posts: 367
hey jduncantor and others,

You don't need to use AviSynth after all. To combine two video files into one using mencoder, you just have to do it the hard way and convert the videos into image files frame-by-frame but JD, you already have that so this solution is fine for you. Try to get all your image files into the same folder with a naming pattern like this:


OK, JD is using png's but my examples will use jpg's cause it's more generic. It still gives good results even though jpegs are lossy. It has a quality option if you want to use it. For example: -vo jpeg:quality=99. Output file formats for mplayer include jpeg, pnm, png, tga, and animated gifs with certain limitations. See the manpage for details in the -vo section. As far as inputs for mencoder go with mf://*.xxx, I think it's the same but haven't tested all those. What's interesting is that mplayer can input files with mf://*.jpg and output files with -vo jpeg in the same command so that you can use mplayer as a file-converter (image files in, image files out). Neat huh? By the way, the mplayer versions I have can play MNG ("ming" like "ping") files. Those are like PNG image files except that it is Multiple image files. This may be of interest to you if you record game video with MAME's built-it recorder since it records in MNG. It seems to make gameplay way to slow though and doesn't record sound. Oh well, onward.

Try to have nothing else in that directory that might cause problems. If you have 100's of thousands of images, it might be a problem for the filesystem to handle so many files in one folder. Anyway, once you've got this setup, get in that directory and use this command to get an avi using h264 codec.

*** frame-sequential image files to left-over-right full frames via tile
mencoder mf://*.jpg -vf tile=1:2:2:0:0,scale -fps 48 -ofps 24 -o left-over-right.avi -ovc x264 -x264encopts crf=20

This is for a video with 24 frames/sec. If you want 30 fps output, then use "-fps 60 -ofps 30" instead of "-fps 48 -ofps 24". Use whatever output fps is right for you, just make -fps double of -ofps where -ofps is your output fps. Output fps should be 1/2 of input fps because of the tile function... every two input images create one output image.

This stacks your images above/below with Left on top just because L comes before R. Adjust as needed.

*** frame-sequential image files to side-by-side LR via tile
For side-by-side, use "-vf tile=2:1:2:0:0,scale" instead of the above but be warned that you may crash mencoder if your output res is more than 2000 pixels wide. If you're up to it, try to edit the source and recompile in order to fix this limitation.

What about sound?
Yes, this has no sound. Do you need help adding sound? I don't want to get into sound right now but maybe you can just use -audiofile file.mp3 or whatever. You may have timing issues.

What if you don't have all those image files?
In that case use mplayer to make them:

*** 2 input files to frame-sequential image files in one folder (windows version)
mkdir left
mkdir right
mkdir combo
mplayer -nosound left.avi -vo jpeg:outdir=left
mplayer -nosound right.avi -vo jpeg:outdir=right
cd left
rem    renaming for windows (appending L or R to constant-length filenames)
ren ????????.jpg ????????L.jpg
move *.jpg ..\combo
cd ..
cd right
ren ????????.jpg ????????R.jpg
move *.jpg ..\combo
cd ..
cd combo

Dealing with unsynced input videos:
The above assumes that your videos are in perfect frame-by-frame sync. If they are not, then you have to find some work-around like cutting off the beginning of the earlier one or if it's only a few frames off, then you can delay one of the fields when your video is interlaced using -vf phase=t or phase=b. For example, use phase=t,phase=t,phase=t to delay the left-eye view by three frames. t is for top (odd lines) and b is for bottom (even lines) although some videos can have labels in them that designate the opposite relationship. Another option is to use a text file as input with all your image files listed in the order you want them. You need some experience with the text-manipulating gnu/linux/bash command line utilities to make it easier to rearrange long lists of filenames in a text file. Then you could use mf://@list.txt instead of mf://*.jpg

Doing a short test play/encode via -frames :
use -frames 600 in your mplayer commands above if you just want to do a little test that is 20 seconds long if your videos are 30 fps. This is a good option to remember and also works with mencoder. A 90 minute video at 30 fps gives you 162000 frames so make sure you have the space by testing with shorter durations first if you think it's needed.

*** frame-sequential video encoded from 2 input video files
Just follow the above approach and encode it using mf://*.jpg and appropriate -fps. I need to expand on this in a later post since there can be complications involving both encoding and playback. It can get hairy but not always.

So now you have your files all set up in that combo directory ready to run the previously mentioned mencoder command. Linux users should be able to do something similar. My linux is getting rusty or else I'd give you an example straight away. In the past, I've kept left and right images in their own dirs and just used symlinks in the combo dir. Just get the files paired up in any way you can in an alternating LR order.

To get the audio from your video files, use -ao pcm:
mplayer left.avi -novideo -ao pcm
and this will make a file called audiodump.wav that you can use with -audiofile.
If this doesn't work for some reason, try replacing "-novideo" with "-vc null -vo null" instead.

OK, this needs better examples but I'm getting lazy. Sorry.

Yes, it's awkward to make all those image files just to put the videos together but on the other hand, you can script this and it can be pretty transparent.

It's still surprising to me what you can do with mplayer/mencoder, but wait there's more for later. Here's a clue: "-vf phase=b"
Can you guess what kind of 3d conversion that would be good for?

--- iondrive ---

PS: I also wanted to mention using -vf tinterlace=0 instead of tile in order to get to LR or L-on-R. tinterlace is the opposite of tfields and takes sequential frames and combines pairs of frames into one frame by interlacing the two into alternating horizontal lines which makes your video twice as tall when you use the tinterlace=0 option. The top line of the output comes from the first frame and is considered odd so that the top line is line 1 and not line 0. Then you can use il=d to get L-on-R or else if you want LR, then use fil=d. If you get weird colors, then stick an ilpack before il or fil and a scale afterwards if needed. The tests I did, did not need ilpack.

*** frame-sequential (jpeg) image files to Left-over-Right (L-on-R, LoR), full-frames (doubles height)
mencoder mf://*.jpg -vf tinterlace=0,il=d,scale,dsize -o tinterlaced-LonR.avi -ovc x264 -x264encopts crf=20 -fps 48 -ofps 24

As before, -ofps must be half of -fps since you are combining every two frames into one or else you get each pair of frames repeated in the output video. Scale as needed.

*** frame-sequential image files to side-by-side LR, full-frames (doubles width)
For LR instead of L-on-R, just replace il=d with fil=d and rename the output file appropriately. Just beware that the output width will be the double of a single input frame and if it's more than 2000 pixels wide, it will probably crash mencoder. I think that can only be fixed by editing the mencoder source and recompiling but I really haven't investigated that. It's just a guess. Otherwise it could be a codec format limitation.

*** frame-sequential image files to RL or R/L
If you want R-on-L or RL, just append ,il=s after =d in your -vf video filter list section.

*** frame-sequential image files to interlaced (or field-sequential) video file
tinterlace does that job for you so if you just want to go from frame-sequential to field-sequential, then just don't use il=d and then make sure you use a codec that preserves interlacing integrity but I don't have examples of that handy, mpeg2video and mpeg4 should work. That's why I don't save files in field-sequential format since it limits your choices of codecs. Instead, I use R-on-L and convert to field-sequential interlaced on the fly with mplayer. Use il=s,scale to swap fields as needed of course. Also you probably want to squash the double-framed height down to a single-framed height so use scale=width:height:1 . Don't forget the :1 or else you'll lose line integrity. You have to use the right number for the height value since mencoder doesn't have a generic halving option in it's scale filter. Read the text on the console for the original video's res when you play it with mplayer. The left-eye view will be in the top (odd) line in this case.

So which approach should you use, tinterlace or tile? In this case I think tile is a little better since it doesn't go through an interlaced stage which sometimes causes color-spilling problems due to subsampling although it's easy enough to test your output and if it looks good, then it looks good. Too bad the stereo3d option includes neither frame-sequential nor field-sequential 3d formats. Oh well, maybe in the future. Bye now.

Last edited by iondrive on Tue Apr 26, 2011 4:12 am, edited 3 times in total.

Wed Feb 23, 2011 8:32 am
Sharp Eyed Eagle!
User avatar

Joined: Tue Feb 10, 2009 8:13 pm
Posts: 367
Hi again,

Before I get to talking about a new topic using the phase filter, let me finish what I started before regarding making YouTube slideshow videos.

Making s3d video slideshows for YouTube: specific examples

Section 3: using real photos from separate left/right image files

Well, I sort of accidentally covered this in the above post. If you read it, then you can guess that you need to put your files in a temp folder so that they are arranged in pairs and then use mf://*.jpg and "-vf tile..." or "-vf tinterlace..." on them as above. Otherwise use a list file. Let's see. Suppose you had a list.txt file like this:


All your images should be the same res and aspect ratios. Notice that the left view is first. Then you could do the following:
(in the same directory as the image files and list.txt)

*** separate eye-view 16:9 aspect image files to YouTube LR 3d video slideshow
mencoder mf://@list.txt -o temp.avi -nosound -ovc x264 -x264encopts crf=20 -fps 0.5 -ofps 30 -vf scale=640:720,tile=2:1:2:0:0,scale=1280:720,dsize

YouTube tags:
OLD: yt3d:enable=true yt3d:aspect=4:3
NEW: yt3d:enable=LR

The tricky thing here is that -fps 0.5 makes it look like each image is going to be 2 seconds but the tile filter is combining every two images into one so that each image of your slideshow actually is 4 seconds long. I use scale in the beginning in case your pics are 12 megapixels or something. The last scale could probably be left off or just "scale" but I include it for clarity regarding the final dimensions of the video.

If your files are right-image first:
Then use -vf scale=640:720,tile=2:1:2:0:0,ilpack,fil=i,il=s,fil=d,scale,dsize
or else use -vf scale=640:720,tinterlace=0,ilpack,il=s,fil=d,scale,dsize

All the things mentioned have been explained in previous posts so I think I can skip explaining all things here. I think that's it for now. If I remember something, I'll just have to edit this.

--- iondrive ---

Fri Feb 25, 2011 6:37 am
Sharp Eyed Eagle!
User avatar

Joined: Tue Feb 10, 2009 8:13 pm
Posts: 367
Hey there y'all,

Ready for more boring stuff? Let's finish this so we can get on to more interesting stuff.

Firstly, note that Ive edited my previous posts regarding YouTube tags so that they're now up-to-date as of April, 2011. Basically, I'll try to stick to side-by-side LR unless I have reason to use L-on-R or R-on-L. RL (crosseyed) format is discouraged. These are the current tags.

Single-eye views must be 50% squeezed horizontally or 50% squashed vertically so that the new video has the same aspect as a full-framed single-eye view. That's how they avoid needing to specify aspect with a tag. That means 4:3 aspect video should be 640x480 or something like that although I have not tried it yet. Hopefully it can take higher res like 1024x768 or 1280x960. Does anyone have more info on this? I think those should be fine. Anyway, onward...

Making s3d video slideshows for YouTube: specific examples

Section 4: using interlaced png files from nvidia or other

Old-school nvidia screenshots are normally jps files but if you use interlaced or checkerboard 3d output formats, then the screenshots are interlaced PNG files since jpegs are lossy and not good for interlaced images. Most likely, this would be used on a Zalman 3d interlaced display and so that means that the top line is meant for the right eye. Strategy is like in the previous examples but in this case, when we deinterlace the screenshots, we get a R-on-L frame that already has it's images 50% squashed so it's pretty convenient. Examples:

*** nvidia (Zalman) interlaced-3d 16:9 aspect png screenshots to YouTube R-on-L 3d video slideshow:

mencoder "mf://*.png" -o temp.avi -ovc x264 -x264encopts crf=20 -fps 0.25 -ofps 30 -vf scale=1280:720:1,ilpack,il=d,scale=1280:720,dsize=16/9

YouTube tags: yt3d:enable=RonL

General notes:
If you decide to remove the first scale, then also remove ilpack or else it will give you some software ghosting. I stuck it in there just in case your screenshots do not have a res that is multiples of 16. It's normally not needed here but it's good practice to have it.
-mf type=png is unneeded since mencoder can autodetect it.
Other options are explained in previous posts.
For left-view-first interlaced images, use il=ds instead of il=d, or else "yt3d:enable=LonR" but not both or else they'll cancel each other out and you'll have inverted stereo.

And finally, if you want to "standardize" your interlaced images into a LR slideshow:
(This is not recommended due to image data loss.)

*** interlaced-3d 16:9 aspect png screenshots to YouTube LR 3d video slideshow:

mencoder "mf://*.png" -o temp.avi -ovc x264 -x264encopts crf=20 -fps 0.25 -ofps 30 -vf scale=640:1440:1,il=s,fil=d,scale=1280:720,dsize=16/9

YouTube tags: yt3d:enable=LR

fil quirks:
ilpack was not needed for some reason. It probably has something to do with fil. If your screenshots were 800x600, then you might have a little problem if you leave off the first scale. 800x600 is not a res that is multiples of 16 (600/16=37.5) and fil does not like it so it puts a thin gray stripe down the middle of your image-pair. The solution is to scale to dimensions that are multiples of 16 before using fil. Just remember how fil changes the dimensions of the image and figure the scale dimensions accordingly.

Viewing the images without making a video file:
Before you make these videos, you may want to preview what the slideshow will look like and you can easily use mplayer to do that if you are an interlaced user. That's what the next post is all about.

--- iondrive ---

Last edited by iondrive on Thu Apr 28, 2011 8:45 am, edited 1 time in total.

Tue Apr 26, 2011 5:11 am
Sharp Eyed Eagle!
User avatar

Joined: Tue Feb 10, 2009 8:13 pm
Posts: 367
Hi all,

Lately I've been talking about making 3d slideshows from your files in various formats but what if you just want to view some images without actually making a video file? Well, that's what this post is about... using mplayer to view files without mencoding anything. Why not just use a slideshow program like sView or Tridef's or nvidia's 3d image viewer? Well, IDK, maybe they don't work right for you or something or if you're on Linux and have no better options. Anyway, onward.

For interlaced users:
Interlaced users are really blessed with some nice conveniences like not worrying about timing issues, being able to pause a video and still have it be in 3d, viewing 3d in a window or web browser, and being able to play some games that only offer interlaced mode. Anyway, regarding slideshows, if you have interlaced png files it's pretty easy and this works fine for 2d slideshows too of course.

*** The general slideshow command: (1 second / image)
mplayer -fps 1 mf://*.png

Quirk-1: driver ghosting
For interlaced images, if you see more than normal ghosting, you may need to use a different output driver since some of them do you the "favor" of de-interlacing video for you and so they harm the 3d effect. You might find a way to turn that off or just use another driver. I like the opengl output driver. Try -vo gl or else direct:noaccel. Both should work on Windows. Linux users can also try -vo x11.

Quirk-2: Last image lost
hmmm, darn, I see the last image is missing from view. I tried mf://*.png,filename.png but that didn't work. I guess if you care about the last image, then you should make a text file like list.txt or whatever you want to name it. For Windows: dir /b *.png > list.txt (or dir /b /s for full paths ) and then edit that txt file and duplicate the last entry. That will fix the problem.

*** general slideshow command using a list.txt file: (4 seconds / image)
mplayer -fps 0.25 mf://@list.txt -vo gl

Quirk-3: unresponsive keyboard controls
It seems that input is only checked in-between frames so when you play a video at 30 fps, it's fine, but if it's 0.25 fps, then most input seems ignored. If this is intolerable, then make a video file as shown before and play that instead. Unfortunately, mplayer cannot use a pair of input/output fps options like with mencoder using -fps and -ofps as that would probably fix things. There is another great solution for interlaced users though. Use -fps 25 and -loop 0 and then step through the images with the "." key. It's a nice slick, convenient solution but what's better is that an fps of 25 is the default for mf:// so you don't even need to specify it. Yay, a simpler command line.

*** user-controlled slideshow using "." to step through the images.
mplayer mf://*.png -loop 0 -vo gl

-loop 0 means loop the video continuously until you quit mplayer with "q" or escape. This means that you don't need to duplicate the last line of your list.txt file and you don't need to even make one since this method also fixes the missing last image quirk. Just use *.png. Nice. Note that when you reach the last image in the series, it behaves as if there is a second copy of it. Press "." once and the image is still the same. Press "." again and you start back at the first frame again. It's a good way to tell which frame is the last one in the series. Also note that -loop should be after the mf:// option and not before. It just works better that way.

Quirk-4: correct interlacing
if you are viewing in a window, you have a 50/50 chance of having the correct interlacing. If it's wrong, you can slide the window up/down till it's right or if you're using a CRT with an EDim controller and ED-Activator, then just use the hotkeys to flip the sync of the line-blanking. The other option is to rescale to fullscreen and then you will be able to always be in sync once you know if you need to use il=s or not. For 22" Zalman monitors:

*** Fullscreen slideshows for 22" Zalman Trimons ("." steps through images)
mplayer -vf il=s,scale=1680:1050:1,dsize -fs mf://*.png -loop 0 -vo gl

Just drop the "il=s," if the lines are in the wrong place. I didn't need ilpack in my case.

In case you forgot, "-fs" is for fullscreen and the ":1" on the scale is to do the rescale without mixing the interlacing. Of course, you can change the numbers to change the size of your window if you don't use -fs. The dsize is important here to make sure that image alignment on your screen will match pixel for pixel. When dsize has no "=" after it, it defaults to the image's pixel dimensions which is exactly what we want here. If the interlacing is still wrong, then you just use the old ilpack,il=s, options before the scale. If you get weird colors, then drop the ilpack. Also remember that mf:// can autodetect some filetypes like png and jpg. If your input files are jps files, then you can still use them, just add -mf type=jpeg. If you have trouble remembering "mf", just think "multiple files". I think that's what it stands for but I don't really know. It's just a guess.

Side-by-side and above/below input formats:
If you have jpegs in side-by-side or above/below formats, then follow examples from previous posts regarding interlacing using "-vf fil=i" or "-vf il=i". In some cases you don't need ilpack before the il or fil but if you use it, then always follow it with a scale sometime after the il in the filter chain or else you'll get an error message. If you get some other weirdness, you may need to make sure that all your input files are the same size or aspect or that their dimensions are multiples of 16. Normally, things should just work right from the start.

using separate L and R image file-pairs as input:
For this kind of input, just follow the examples in the above posts regarding making slideshow videos. Get the files in pairs in one folder. They should all be the same size and have dimensions in multiples of 16 (800x600 screenshots need tweaking). If they are not sized right, then tile and fil may not work right. tinterlace is probably your best option. Here're some examples in case you have 800x600 separate L and R input files:


*** slideshowing separate L and R 3d image files using tinterlace ("." steps through images)
mplayer mf://*.jpg -vf tinterlace=0,scale=800:600:1,dsize -loop 0 -vo gl

tinterlace will make the images doubly tall so rescale before or after. You may need ilpack before tinterlace and then scale after. The first of each image pair will go into the odd lines and the second image will go into the even lines (top line is odd, #1). This causes the framerate to be cut in half but we're not worried about that here and the same goes for tile. Tile examples follow.

Vertical tiling:

*** tiling separate image files vertically and using il ("." steps through images)
mplayer mf://*.jpg -vf scale=640:480,tile=1:2:2:0:0,ilpack,il=i,scale=640:480:1,dsize -loop 0 -vo gl

This could be more efficient/effective but I chose the numbers for clarity. You should understand that after the tile, dimensions of the newly tiled image is 640x960 and after the il=i, it's still 640x960 so you could have made the original scale 640:240 and it would be more efficient. "fil=i" is a little trickier.

Horizontal tiling:

*** tiling separate image files horizontally and using fil ("." steps through images)
mplayer mf://*.jpg -vf scale=640:480,tile=2:1:2:0:0,ilpack,fil=i,scale=640:480:1,dsize -loop 0 -vo gl

As above, this could be more efficient/effective. After the tile, dimensions of the newly tiled image is 1280x480 and after the fil=i, dimensions are again 640x960 so you could have made the original scale 640:240 and it would be more efficient.

That's all for now, next let's start dipping our toes into frame-sequential page-flipping shutterglass mode.

--- iondrive ---

Thu Apr 28, 2011 7:37 am
One Eyed Hopeful

Joined: Tue Nov 15, 2011 4:08 pm
Posts: 2
Sorry I can't find information, what i need to do with my mplayer, :oops: if
I have a glass, with red and blue, and movie with left and right side. How I need to setup mine mplayer for playing. Do you can?
Could you offer me a best glass for movie with mplayer?

Tue Nov 15, 2011 4:16 pm
User avatar

Joined: Sat Jan 09, 2010 2:06 pm
Posts: 2161
Location: Perpignan, France
Have a look at Bino, it's a full featured 3D movie player for Linux, you won't have all the hassles with the command line :

Tue Nov 15, 2011 4:37 pm
Profile WWW
One Eyed Hopeful

Joined: Tue Nov 15, 2011 4:08 pm
Posts: 2
Bino is too slow.

Tue Nov 15, 2011 5:18 pm
Sharp Eyed Eagle!
User avatar

Joined: Tue Feb 10, 2009 8:13 pm
Posts: 367
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.


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. (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.


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

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.

Tue Mar 13, 2012 8:17 pm
Display posts from previous:  Sort by  
Reply to topic   [ 41 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 0 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.