The script has to be changed for magenta/green glasses:
The magenta side needs to see red and blue, the green side only green. I'm assuming the left lens is green here -- because pictures I've seen of trio-scopic glasses show that. If the image doesn't look right try flipping the glasses around and see if it looks any better.DirectShowSource("SBS.mkv")
ConvertToRGB()
# extract left and right views as separate videos
left=Crop(0,0,width/2,-0)
right=Crop(width/2,0,width/2,-0)
# merge color channels to make an anaglyph image
r=ShowRed(right)
g=ShowGreen(left)
b=ShowBlue(right)
MergeRGB(r,g,b)
+ Reply to Thread
Results 31 to 58 of 58
-
-
Originally Posted by jagabo
PERFECT!
It looks great. I mean its not absolute awesome 3d but its more on par now with what I've been seeing on youtube.
I think maybe I'll try to do another sample or two from my source and check it out with the new process in place.
FYI here is the working script I have for the left/right sbs for the trio-scopic glasses with jagabo's latest bit of avisynth magic:
Originally Posted by jagabo trio-scopic left-right sbs script
----------------------------------------
I have some samples that will be top and bottom sbs. Do I simply replace left and right with top and bottom?Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
You probably don't need to adjust the parallax. Keep in mind that moving the left frame left and the right frame right moves the picture farther away. Moving the left frame right and the right frame left moves the picture closer.
-
Actually what I meant was in the script for crop do I replace the words "left" and "right" with "top" and "bottom" respectively?
Because these clips I'll be acquiring are top and bottom sbs. They are literally on top of each other.
Thanks.Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
You won't replace the words, but you will have to change the variables.
In jagabo's script above, his 1st section with crop is the extract section. Those variables need to change. Instead of cropping the width (x values), you'll need to crop the height (y values). Note: the 2nd crop section (parallax adjustment) may still apply.
BTW, the accepted industry nomenclature is never SbS "top/bottom", it's just "Top/Bottom" or "Over/Under". Side-by-side is only for those items that are actually aligned horizontally.
Scott -
What you call the two videos doesn't matter. I use left and right because one image is for the left eye, the other for the right eye. It's easier to keep track of that way.
If your source is top/bottom you need to adjust the first Crops() so that the frame gets split accordingly:
left=Crop(0,0,-0,height/2) #the top half of the frame
right=Crop(0,height/2,-0,-0) #the bottom half of the frame
Some AviSynth basics:
If you don't explicitly name a stream "last" is assumed. So
AviSource("filename.avs")
last = AviSource("filename.avs")
DirectShowSource("E:\high def captures\*****test 2.M2TS")
ConvertToRGB()
# extract left and right views as separate videos
left=Crop(0,0,width/2,-0)
right=Crop(width/2,0,width/2,-0)
etc.
last = DirectShowSource("E:\high def captures\*****test 2.M2TS")
last = ConvertToRGB(last)
# extract left and right views as separate videos
left=Crop(last, 0,0,width/2,-0)
right=Crop(last, width/2,0,width/2,-0)
etc.
If you don't explicitly say which stream to return (the output of the script) "last" is assumed. Ie,
AviSource("filename.avs")
last = AviSource("filename.avs")
return(last)Last edited by jagabo; 2nd Apr 2011 at 21:40.
-
Originally Posted by cornucopia
Originally Posted by cornucopia
I appreciate both of your contributions.
I think I'll tackle this later. Its been fun and looking forward to more.Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
Bump.
Well I'm back at this. I did purchase the stereoscopic player and it works great. I want to make a combined anaglyph file from a side by side file I made from one of my 3d bluray discs I bought and ripped with dvd fab 3d bluray ripper to side by side mkv.
Here is what I am trying to use:
3dscript layout version 3.jpg
I get this error:
3d script error.jpg
What do I need to do to correct this?
The file is a uncompressed yuv clip from the original h264 file that bluray 3d ripper created - chopped with virtualdub for a 10 second or so test clip.
It is 1280x720 at 23.976.
Your help in correcting this script is appreciated. Thanks.
And I want to make this for trioscopic anaglyph the green/magenta glasses - green is for the left eye.
Edit - I intend to make a new h264 file with one of the vfw x264 plugins that was linked to in the x264 encoder link in the tools section.
Edit 2 - My reason for wanting a combined instead of side by side file is I want to play it on my ps3 or wdtv media player. I want to connect one of them to my old video projector that is just less than standard defintion and only has composite and svideo inputs. I have tried to get my ati all in wonder hd video card to output to it with the riser card with svideo and component outputs. However i have not had any luck with that. I have a separate thread on that going in the computer forum here and I'm waiting a response on that.Last edited by yoda313; 24th Apr 2011 at 22:36.
Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
Well, it looks like you must have mistyped...
Should be
left=Crop(0,0,width/2,-0)
right=Crop(width/2,0,width/2,-0) -
The only way that line 6, left=Crop(2,0,width/2,-0), can produce the error "Crop: Destination width is 0 or less" is if Avisynth thinks the clip has a width of zero. (That would still apply if you had used Crop(0, ...)).
This suggests DirectShowSource is not opening your file correctly. Test this by using this script on its own:
DirectShowSource("E:\ ... 3dclip.mkv")
Info()
You might have more success replacing DirectShowSource by FFVideoSource (from the ffms2 plugin). -
In "left=Crop(2,0,width/2,-0)" the leading 2 may cause a slight misalignment of the two frames.
Do you really need to adjust the parallax? That was given earlier just as an example of how to do it (and, arbitrarily, by 16 pixels). Not an indication that it was necessary.Last edited by jagabo; 25th Apr 2011 at 07:02.
-
@gavino - I think it might have been because my clip was yuv uncompressed. I used x264 and made a h264 mkv file to work with. I can open that on its own just fine with directshowsource.
When I replace that in the script I still get the same message.
@cornucopia - I have changed the 2 to a 0 and still get the crop error message.
@jagabo - I have removed the adjust parallax lines. I still get the width is 0 line 6 error message (but I can open the new compressed file on its own with directshowsource)
You're help is appreciated. Thanks.
3d script revised.jpgDonatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
What does Info() say about your source (using Gavino's script)? Especially the frame size.
-
I used mediainfo and the compressed file I'm using is still 1280x720.
How do I use info? I tried a simple script with one line of Info(filename.mkv). It said it was expecting a , or (. What else do I need? Do I still need to do directshowsource first then the info line?Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
No, you want:
DirectShowSource("filename.mkv")
Info() -
Ok I missed the "" in the directshowsource line. I used what gavino posted as you suggested. Here is the snippet from avisynth info:
avisynth info.jpgDonatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
Ok, that confirms AviSynth got a 1280x720 frame. The script in post 42:
https://forum.videohelp.com/threads/333552-What-program-to-convert-sbs-left-right-to-an...=1#post2074190
Is your current script that's causing problems? Which line number? The same error message as before? -
Ok I'm not sure which step in the correction solved it but it loads now!
#ASYNTHER DirectShowSource
DirectShowSource("E:\*****introcliph264.mkv")
ConvertToRGB()
# extract left and right views as separate videos
left=Crop(0,0,width/2,-0)
right=Crop(width/2,0,width/2,-0)
# merge color channels to make an anaglyph image
r=ShowRed(right)
g=ShowGreen(left)
b=ShowBlue(right)
MergeRGB(r,g,b)
The above is what now loads ok. I'll go ahead and try to save it as a anaglyph 3d h264 combined file. Hopefully this will work. If it does than I can load the entire original file and go from there.
Thanks a ton jagabo and gabino and cornocopia.
------------------------
At the moment I think the two hangups for me was using a yuv uncompressed clip in the first place AND the 2 instead of a 0 in the crop line. So it looks like I'm good to go. I'll run the test clip and see how it goes.
Edit - SUCCESS!
I got the output file and played it in mediaplayerclassic. I can do the 3d without stereoscopic player. It was not a waste of money because this conversion is a big extra task and I can just do one conversion with bluray 3d ripper and play right away.
This task is so I can make a video file that I can play on my ps3 or wdtv player so I can output it to my video projetor.
This file was a bit blotchy since it was compressed from a compressed file. I'll be using the source file directly this time and use the same bitrate.
Thanks again!Last edited by yoda313; 25th Apr 2011 at 09:14.
Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
Ok this is an important post related to this discussion so I need to post this here.
MULTIAVCHD CAN CREATE 3d ANAGLYPH AVHCD MOVIES!!!
The output from above was not what I needed. I ended up getting a 640x720 file that did not have the proper ratio - it was .88 something - it was all tall and skinny I believe.
I tried again using divx at 720p instead of x264 and got the same result - actually the ps3 wouldn't even play the file even though it read it as a divx file but it would not play.
Long story short I used multiavchd to create a combined trioscopic green/magenta 3d avchd movie. It plays perfectly in my ps3. I was able to hook that up to my video projector and it played in the proper aspect ratio (letterboxed in my 4:3 projector - the ps3 was set to 4:3 and the bars for the movie were exactly where they were supposed to be for the originally 16:9 1.85 - or 1.78 can't remember - movie.
Step by step then I'll post it in the guides if its not already there:
1 - load video in multiavchd
2 - select the video to be coverted then click properties - in the properties window click ALTER DETECTED PROPERTIES
3 - Select stereo left/right in my case or choose the order the video is in. Click ok.
4 - While still in properties click the TRANSCODE button. Immediately left of the APPLY button is the CREATE 3D ANAGLYPH check box - check it. Click apply.
5 - Click ok to save and close the properties tab.
6 - Back on the main screen click the settings tab. On the right side above the mpeg encoder selection box is the 3d ENCODING selection window. Choose the type of glasses you'll be using. I use trioscopic green/magenta glasses so that is what I select. Select your choice.
7 - prepare the avchd the rest of the way you want. Then start and choose your output options.
8 - I assume this would be usable for any of the output options multiavchd has to offer from avi to mkv and the like. I assume this means that a standard defintion dvd can be produced as well in anaglyph form. I have only personally created an avchd from a 3d bluray rip (originally ripped and converted to side by side h264 mkv by dvd fab 3d bluray ripper - originally ripped to iso with anydvdhd).
------------------------------------
Wow what a chore. But now it is complete and I can watch it anyway I want to.
Thanks for everyones assistance. I'll be posting this guide in the guides section if it hasn't already been posted.Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
Glad you got what you wanted with MultiAVCHD, however one of the main reasons it didn't work via AVISynth was because, in your later versions of your script, you omitted the Resize-Back-to-Normal-AR function. LanczosResize() or similar. This in turn @*#'d up your Divx encode most likely, since it didn't have a standard format size when using a standard profile. The AVISynth method DOES work, you just have to know how to "massage the data" correctly.
Scott -
Oh ok. I guess I had too many rewrites and didn't go back to the core the right way.
I'll keep that in mind for any future endeavors.
However for now it seems like most of my needs will be met with multiavchd.
Thanks again.
(I didn't say I didn't get an output I just didn't get a correctly ratio'd output - thanks for letting me know what happened)
edit - multiavchd is probably more up my ally anyway since it seems to do this avisynthy stuff "UNDER THE HOOD" which is more my speed. But this has been an important learning process regardless.
edit 2 - Here is what was missing that was in my first script that wasn't in my latest version:
BilinearResize(960,540)
So that would have given me a properly fitted frame then? I'll have to remember that.
edit 3 - correction again 640x360 for 1280x720Last edited by yoda313; 26th Apr 2011 at 20:47.
Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
#ASYNTHER DirectShowSource
DirectShowSource("E:\high def captures\*****test 2.M2TS")
ConvertToRGB()
# extract left and right views as separate videos
left=Crop(0,0,width/2,-0)
right=Crop(width/2,0,width/2,-0)
# adjust parallax by 16 pixels
left = Crop(left, 0,0,-16,-0) # shift the left image to the right by 16 pixels
right = Crop(right, 16,0,-0,-0) # shift the right image to the left by 16 pixels
# merge color channels to make an anaglyph image
r=ShowRed(right)
g=ShowGreen(left)
b=ShowBlue(right)
MergeRGB(r,g,b)
You split it in 1/2 horizontally, so you end up with 2 files each 640x720.
You've got a crop to implement a parallax adjustment (aka Horizontal Image Translation, or HIT).
While this may be appropriate for what you wanted to do, it's not complete as an HIT function, because it changes the AR and because it doesn't include padding which is meant to represent the "floating window". This is important in maintaining the positive reinforcement of and lack of disconnect between convergence, occlusion, and size, furthering the "realism" of the 3d image.
So now you've got 2 files of 622x720.
So you add a line in the script to pad them the complement of what was cropped (16). So now you've got 2 files of 640x720.
Merging makes it 1 file of 640x720.
You now need a 2:1 AR readjustment to get back to what SHOULD have been an original (2D) image (or would have 2x this for a 3D image).
So you add a final line in the script to resize to 1280x720. Or you could do the resize before the crop&pad - to keep the crop&pad edge from getting fuzzy - but the resize, crop, &pad would take on different dimensions.
Scott -
Originally Posted by cornucopia
I readded the Billenear resize line that was left off. My first test with it yielded the same results. After reading your post again I added the LanczosResize() line you mentioned. I set it to 1280x720. I did the divx conversion again and this time it came out and the ps3 played it just fine. EXCEPT it plays as a 2.35:1 video instead of the original 1.85:1 video that the original bluray 3d is encoded at. So everything is squished a bit inside the frame - much better than the 640x720 file that I got the first time around.
Here is the frame detail of the converted divx file:
1280 x 720 (AR 517:240) - from mpchc.
Video: DivX 5 1280x720 23.98fps 2867kbps [Video 0]
Audio: Dolby AC3 48000Hz 6ch 448kbps [Audio 1]
It looks good it just needs to be encoded to 16:9 1.85 so the proportion is correct.
FYI inside the divx config screen I have the video in out resolution set to ntsc 16:9. Is this throwing off the resize function and double squeezing it instead of leaving it at 1.85?
divx setting.jpg
Here is the script I am currently using that got the 2.35:1 file instead of the 1.85:1 that I want - but this is playable on my ps3 so it is nearly there:
#ASYNTHER DirectShowSource
DirectShowSource("E:\****3D.Title1000.mkv")
ConvertToRGB()
# extract left and right views as separate videos
left=Crop(0,0,width/2,-0)
right=Crop(width/2,0,width/2,-0)
# merge color channels to make an anaglyph image
r=ShowRed(right)
g=ShowGreen(left)
b=ShowBlue(right)
MergeRGB(r,g,b)
BilinearResize(640,360)
LanczosResize(1280,720)
Do I still need the bilinearresize AND the lanczosresize line together? Are they counteracting each other or are they complimentary?
Edit - in the divx video tab should I set it to SQUARE PIXELS? Would that make the video 1.85:1 instead of 2.35:1?
Thanks again.Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
You only need one resize.
If you resize the frame back to 1280x720 the pixel format is square (PAR 1:1), not 16:9. -
Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw?
-
Great. Thanks jagabo. I'll probably work on this tomorrow and let you know how it goes.
Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
Just thought I'd report in and let you know the corrections worked! I deleted bilenear resize and did square pixels on the divx setting. I left the lanczos resize at 1280x720 and reencoded (from the original sbs file of course). It works great! It even reads as 16:9 in mpchc. It looks perfect on the ps3 (in the proper 1.85:1 on my hdtv without needing to zoom in or do anything to it - it just displays at the right size like its supposed to).
Thanks again jagabo and cornucopia and gavino.
I'll go on converting the rest of mine so I get the right settings.
edit - for my future reference I"m posting the correct script:
#ASYNTHER DirectShowSource
DirectShowSource("E:\****3D.Title1000.mkv")
ConvertToRGB()
# extract left and right views as separate videos
left=Crop(0,0,width/2,-0)
right=Crop(width/2,0,width/2,-0)
# merge color channels to make an anaglyph image
r=ShowRed(right)
g=ShowGreen(left)
b=ShowBlue(right)
MergeRGB(r,g,b)
LanczosResize(1280,720)Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw?
Similar Threads
-
Convert sbs mkv to avi
By woody565 in forum Video ConversionReplies: 1Last Post: 26th Apr 2012, 11:40 -
Converting Left Right 3D MKV to Half SBS MKV
By TehBotolSOsro in forum Video ConversionReplies: 10Last Post: 3rd Apr 2012, 06:24 -
Is it possible to convert sbs to trioviz infinicolor with avisynth?
By yoda313 in forum Video ConversionReplies: 3Last Post: 4th Dec 2011, 13:53 -
how to convert alternate-frame 3D into SBS 3D ??
By mauslyon in forum Video ConversionReplies: 1Last Post: 10th May 2011, 08:23 -
Help converting Left/Right files to SBS with avisynth
By mason dixon in forum Video ConversionReplies: 7Last Post: 2nd Mar 2011, 17:05