View Full Version : Guide to convert BD 3D to 3D Left+Right Stereoscopic and Anaglyph
Limobar
24th April 2011, 15:36
Does anybody here have successfully used frame sequential encoding? It's the most efficient way to encode 3D.
I've tried it several times with different versions of the H264StereoSource.dll decoder and several different sources. The result appears to be like it should, but around 53 minutes in the encode the video suddenly starts to jump. A fellow encoder confirmed my results and only uses it for encodes shorter than 53 minutes.
I tried a workaround, by cutting the encode in half, but that doesn't work either, because "right.h264" doesn't have some sort of time stamps, so I cannot use the 'trim' command in Avisynth. I also cannot remux "right.h264" to a format that gives it time stamps.
What are your experiences with frame sequential encoding?
crl2007
25th April 2011, 06:58
Didn't try it myself, but from encoders reports it results the same behavior as yours.
Lately i haven't been able to work with H264StereoSource.dll. Aviscript doesn't work.
Is this my system's issue or one of those MS's jokes?
Any feedback will be appreciated.
Lately i haven't been able to work with H264StereoSource.dll. Aviscript doesn't work.
Is this my system's issue or one of those MS's jokes?
Any feedback will be appreciated.
I got it; i'm living issues with "Tron Legacy 3D".
Something does not allow me to decode right eye with H264StereoSource.dll.
Anybody else?
crl2007
7th June 2011, 00:48
Try SSIFsucka! if you can't manage to make it work through avisynth. The software is based on h264stereosource.dll too. Try and get Beta3. RC2 has a few annoying bugs that beta3 doesn't.
In this case, i think 3DBD.net Beta is much better than SSIFSucka. But i am still wondeirng why i can not get it with avisynth?
crl2007
8th June 2011, 06:02
Maybe you don't have the correct avisynth or maybe the paths are wrong. I never had this problem. Maybe a re-install of avisynth will do it.
rica
19th June 2011, 00:22
Maybe you don't have the correct avisynth or maybe the paths are wrong. I never had this problem. Maybe a re-install of avisynth will do it.
OK, i reorganised my PC and it works. Thanks.
rica
27th June 2011, 22:35
Lately i've been awared i don't need to re-encode left.h264 for making SBS 3Ds.
I use Stereoscopic Player to play SBS 3D files and SP can play avs files.
So here is the way i follow:
1) Extracting left.h264, right.h264 and audio via eac3to.
2) Remuxing left.h264 and audio into an m2ts or mkv container via TSMuxer or MKVMergeGui without re-encoding.
3) Re-encoding right.h264 to right.264 and remuxing it to m2ts or mkv container.
For this i used a similar avs:
LoadPlugin("H264StereoSource.dll")
H264StereoSource("decoder.cfg",180027)
[4) Here is the aviscrypt to play with SP:
vidL=DirectshowSource("C:\3D-ex\left.m2ts",audio=true)
vidR=DirectshowSource("C:\3D-ex\right.m2ts",audio=false)
StackHorizontal(vidL, vidR)
_ _ _ _ _
Movieslut
2nd July 2011, 17:47
On page 1 of this thread it is said that you can now select from multiavchd more 3D modes.
Where can I find this option??
On page 1 of this thread it is said that you can now select from multiavchd more 3D modes.
Where can I find this option??
Here you are:
Important Update: You can now select from multiavchd more 3D modes ( green/magenta, top/bottom, left/right etc ). All you have to do is to set your mode before adding a playlist. The same steps as for anaglyph are used here too.
http://thumbnails30.imagebam.com/8645/5f2e0486440654.jpg (http://www.imagebam.com/image/5f2e0486440654)
Movieslut
3rd July 2011, 00:09
Thanks
frencher
16th December 2011, 14:30
Hi all,
H264StereoSource.dll Don't decode all right stream..
Left & Right = 466 frames
Code error at 444 frames / 466:
PicParset 1 references an invalid (uninitialized) Sequence Parameter Set with ID 1, expect the unexpected...
An unintentional loss of pictures occurs! Exit
A gap in frame number is found, try to fill it.
Where find H264StereoSource.dll to work ?
Where find the latest update compiled of H264StereoSource.dll + source code ?
crl2007
16th December 2011, 16:47
That's normal. There's no bug, that's just the way it is. I trim the last 50 frames in my avisynth scripts and that error does not come up anymore. You'll lose 2-3 seconds from the end.
frencher
16th December 2011, 16:50
Hi clr2007,
ldecod.exe work to 466 frames without problem
ldecod.exe = (H264StereoSource.dll Avisynth)
crl2007
16th December 2011, 16:55
It doesn't output that error, but if you check, you'll see that you are missing 2-3 seconds from the end. ldecod already trims 50-60 frames from the end.
frencher
16th December 2011, 17:16
ldecod already trims 50-60 frames from the end.
Read your message ;)
crl2007
16th December 2011, 20:45
I took your sample. As I said, ldecod is using H264StereoSource tweaked. Every software that you use is doing the same thing, trimming 2-3 seconds at the end. There is no other H264StereoSource.dll available. Maybe in the future, when it will be possible to edit 3D BD, we will have a faster and better decoder.
frencher
17th December 2011, 00:26
It already exists (stereoscopic player) with CoreAVCDecoder.dll but is not free right what I find a shame.
The only one who convinced me as in my example is that on my config ldecod.exe gives me almost more than 0.5 fps (H264StereoSource.dll with avisynth) and completes the conversion of all my MVC tracks with an average of 4,5 fps with a Q9550 @ 3,4 Ghz & x264_x64.exe and Windows 7.
Strongly an MVC plugin free and fast ;)
slavanap
12th January 2012, 02:29
How did make ldecod.exe to parse two input streams (left.h264 & right.h264)? How did you combine them?
Thank you in advance.
frencher
12th January 2012, 05:47
Hello Slavanap,
This is actually my current project I'm working with him, but now only a dll of WarpEnterprises (RawSource.dll (http://avisynth.org/warpenterprises)) compiled with support pipes is able to recover the two flows (left & right) in an Avisynth script, but the big problem lies in the stability of receipt or processing of images stream by jumping or flashing.
I actually contacted WarpEnterprises and for 3 or 4 private messages I have not heard since the compiled version in the base plugin does not support pipes for receiving two streams RAW.
If another solution to decode really 100% 2 flow I'm interested (H264StereoSource.dll) skip the end of streams.
Cordially.
frencher
15th January 2012, 12:19
Hi slavanap,
Here's my demo that uses the pipe
Demo (http://www.mediafire.com/?7g33cnlagpkbzyl)
Thank you for fix :)
damorsoft
17th January 2012, 22:34
I have been reading this post and have a 1/2 SBS working fine. Would like to interleave?? the final mkv with one frame from left.mkv then one frame from right.mkv and so on and so on...
would this replicate a 3dbluray disc? Anyhow any ideas on the synth file for x264 that would maybe accomplish this. The output mkv would be a full 1080p.
One final thing when the 1/2 sbs.avs file(sample.avs) runs the dts audio is missing and requires another pass with mkvmerge to get the sound.. even tho the left.mkv has audio..
-lv = DirectShowSource("left.mkv")
-rv = DirectShowSource("right.mkv")
-stacked = StackHorizontal(HorizontalReduceBy2(lv), HorizontalReduceBy2(rv))
-ConvertToYV12(stacked)
-SBS.cmd = c:\x264 --frame-packing 3 -o 3DSBS.mkv SBS.avs
THanks
damorsoft
22nd January 2012, 05:22
That's normal. There's no bug, that's just the way it is. I trim the last 50 frames in my avisynth scripts and that error does not come up anymore. You'll lose 2-3 seconds from the end.
Dumb question maybe, but how do you trim the last 50 frames. Is it a trim command or do you just subtract 50 from the eac3to value?
Thanks
crl2007
22nd January 2012, 08:56
I do it like this:
frames=number of frames from eac3to
.
.
.
H264StereoSource("decoder.cfg", frames-50)
frencher
22nd January 2012, 12:20
Dumb question maybe, but how do you trim the last 50 frames. Is it a trim command or do you just subtract 50 from the eac3to value?
Thanks
Not needed with ldecod is the only one to finish all the work :cool:
crl2007
22nd January 2012, 18:19
Yeah, sacrifice quality for 2 seconds of black screen trimmed from the end credits. Great work.
l.e. Don't get me wrong, but I don't like how ldecod outputs. That's why I don't use any automated software, I like to do it manually. If you and/or someone else likes it, it's ok, but it's not right to preach it everywhere.
There are softwares like 3DBDBuster and SSIFsucka that can output to the finish and it's a lot easier than using ldecod.
frencher
22nd January 2012, 19:48
3DBDBuster works with ldecodp and am sorry I do not preach everywhere.
I'm on this forum to advance in my work, share and work in order to provide free software quality
damorsoft
2nd February 2012, 00:35
I do it like this:
frames=number of frames from eac3to
.
.
.
H264StereoSource("decoder.cfg", frames-50)
Played with this for days and found that -12 works every time I tried it.
I got to agree with you on the more automated stuff, it is nice to get your fingers dirty playing around inside these routines.
Still I would like to open the right eye delta and cut the file in half, along with left eye and spread over 2 BD-Rs. Sort of like a BD3d shrink...
mini-moose
21st February 2012, 11:37
I've been trying to do as suggested but I'm stuck at the reencoding right.h264 as avisyth refuses to load H264StereoSource.dll. I'm not new to avisynth, it just won't load it for me (using 2.5.8).
Penecho
21st February 2012, 13:29
So let me get that straight, if i want to do a SBS 3D 1080p x264 .mkv file that i can play on my Samsung TV, i need to:
1. demux the right eye + left eye stream + audio
2. put this in my avs file:
LoadPlugin("H264StereoSource.dll")
H264StereoSource("decoder.cfg",time from eac3to)
VideoLeft = directshowsource("D:\3D\left.m2ts", audio=false)
VideoRight = directshowsource("D:\3D\right.m2ts", audio=false)
VideoStacked = StackHorizontal(VideoRight,VideoLeft)
ConvertToYV12(VideoStacked)
#together with my
Spline36Resize(whatever)
crop(whatever)
and then just run x264.exe in commandline as i would with a non 3D 1080p x264 ?
r0lZ
4th March 2012, 14:47
I did a 1-pass encode with a script similar to this:
LoadPlugin("DGAVCDecode.dll")
LoadPlugin("H264StereoSource.dll")
sidebyside = true
left = AVCSource("left.dga").KillAudio()
try {
right = H264StereoSource("decoder.cfg", left.FrameCount()).KillAudio()
}
catch(err_msg) {
right = left
}
clip = (sidebyside) ? StackHorizontal(left, right) : StackVertical(left, right)
clip = LanczosResize(left.Width(), left.Height())
return(clip)
The Try/Catch part of the script is an attempt to avoid the problem of the missing last frames bug of H264StereoSource. If the try instruction is able to catch the missing frames, the left stream should be used for both eyes during the last seconds of the clip. But I'm not sure it works, as I haven't tested it. I don't want to launch again an extremely slow encoding just to check it.
Unfortunately, H264StereoSource() is extremely unstable (at least under my Win7 x64), and it crashes if you're attempting to seek to any frame after a few seconds from the beginning. That means that it is not possible to render the avs script with a player (even with AvsP) to verify or debug it. But the script works fine if you encode the frames normally, one at a time, from the beginning.
Of course, this script is not suitable if you want to encode it in several passes, as each pass will be extremely slow.
crl2007
5th March 2012, 13:49
If you use frames-12 as damorsoft suggested, then you're fine. I've tested with several movies and it goes to the end with the encode without clipping 2-3 seconds from the credits.
r0lZ
5th March 2012, 14:07
Sorry, but it's not always true. I've just ripped Toy Story 2, and there are 73 missing frames at the end: just more than 3 seconds. Enough to cut the Pixar logo in the middle. I don't like that!
Anyway, I would like to find a way to replace the missing frames with the left eye frames, but unfortunately, the try/catch method doesn't work: H264StereoSource outputs its error message to the console, but after that it doesn't stop, but hangs, and the avs script is blocked and of course doesn't catch the error. I have had to kill it.
The trim method should work fine if you trim enough frames. But unfortunately, you have to decode the whole movie from the beginning to know the exact number of frames, and, as you know, it's damn slow! Pity!
crl2007
5th March 2012, 18:31
As I said, I always used in my script
frames=number of frames from eac3to
.
.
.
H264StereoSource("decoder.cfg", frames-50)
but damorsoft tested and suggested frames-12 and it works with just 12 frames trimmed. And it works, because I've already tested with Transformers: DOTM 3D BD, Puss in Boots and Immortals. I'm ripping them for my personal collection and the duration is the same.
r0lZ
5th March 2012, 18:45
I haven't said that -12 frames cannot work, but I know now that it's not always enough.
My script uses the number of frames of the left eye, that was always identical to the output of eac3to in all my tests, but it's not the problem here. I would like a way to precisely determine the number of missing frames, before starting to encode, to use as many original frames as possible and to switch to the left eye when necessary. Unfortunately, I think it's not possible.
crl2007
5th March 2012, 19:11
Those frames aren't missing from the right eye. H264StereoSource can't finish the job with all the left frames and so you have to subtract some frames so that x264 doesn't spit an error. -50 and -12 worked all the time.
r0lZ
5th March 2012, 19:24
Those frames aren't missing from the right eye. H264StereoSource can't finish the job with all the left frames and so you have to subtract some frames so that x264 doesn't spit an error.
I know that. It's the subject of all my posts here.
-50 and -12 worked all the time.
For you, but not for me. As I have said, I must trim 73 frames to encode Toy Story 2 without the error. The problem is here: that number seems totally unpredictable. I wonder what is causing that bug.
slavanap
5th March 2012, 21:14
Hi slavanap,
Here's my demo that uses the pipe
Demo (http://www.mediafire.com/?7g33cnlagpkbzyl)
Thank you for fix :)
Thank you!
The main problem for me now is that alex's ldecod mod crushes at huge blu-ray movies. (H264StereoSource.dll avisynth plugin in that case don't crush, but make green screen frame.) So, untill we get alex's mod source code and/or new stable version this solution seems not reliable for me. :(
crl2007
5th March 2012, 21:20
What do you mean by huge blu-ray movies ?
frencher
5th March 2012, 23:48
Sorry, but it's not always true. I've just ripped Toy Story 2, and there are 73 missing frames at the end: just more than 3 seconds. Enough to cut the Pixar logo in the middle. I don't like that!
Anyway, I would like to find a way to replace the missing frames with the left eye frames, but unfortunately, the try/catch method doesn't work: H264StereoSource outputs its error message to the console, but after that it doesn't stop, but hangs, and the avs script is blocked and of course doesn't catch the error. I have had to kill it.
The trim method should work fine if you trim enough frames. But unfortunately, you have to decode the whole movie from the beginning to know the exact number of frames, and, as you know, it's damn slow! Pity!
Try with ldecod :rolleyes:
0% failure with my method and nothing is missing at the end :cool:
Sorry for speed ldecod uses only one thread so it is slow
r0lZ
6th March 2012, 00:40
Where can I find the stable ldecod.exe? I've searched everywhere, but each time a download link is provided, it is dead. :-(
crl2007
6th March 2012, 00:48
@frencher Please share with us.
frencher
6th March 2012, 05:59
Hi,
Unrar ldecod 17.2 alexpk mod.rar (http://www.mediafire.com/?4no7xo1mynto1xb)
Just add your left.264 & right.264 into the folder
Launch 0 - RUN.cmd
The output file is right.mkv
For more than 100 different tests: 0 frame skipped
Into 0 - RUN.cmd
Change fps if different
If you can specify the number of images add --frames 12345 (12345) is the total frames of your video ;)
If you have 64 Windows OS change x264_x86.exe by x264_x64.exe
If you have quad core use --threads 3 (4-1=3) 1 = for ldecod.exe
http://i44.tinypic.com/2myzomb.png
crl2007
6th March 2012, 08:38
Thanks. But I still don't know what slavanap means by huge blurays. 2-3 hours duration ?
r0lZ
6th March 2012, 10:50
Thanks!
I will do a new encode of the same Toy Story 2. I'll report here if the 73 frames are still missing. But I need some time. I have deleted the original streams, and I have to re-rip them again, and free some room on my hdd...
crl2007
6th March 2012, 15:21
@frencher Is there a site where you keep ldecod up to date with your mods ?
@r0lZ I'll wait for you to test it with Toy Story 2 and tell us if it's ok to migrate from h264stereosource.dll and avisynth.
r0lZ
6th March 2012, 15:35
@r0lZ I'll wait for you to test it with Toy Story 2 and tell us if it's ok to migrate from h264stereosource.dll and avisynth.
I'm currently encoding the right view with your method. So far so good, but only 30% complete after 3,5 hours (and 22.5 GB of disc space). It would be nice to improve its speed, and to find a way to pass the output directly to Avisynth, to encode both eyes with a single encoder pass. ;-)
frencher
7th March 2012, 06:31
@r0lZ
I chose a lossless encoding setting (--qp 0) in my CMD command to preserve the quality of the right video.
@crl2007
I'm sorry but I am not the developer of ldecod, it is true that a version as stable as ldecod and decodes all the images in avisynth will be more than welcome
r0lZ
7th March 2012, 11:21
I can confirm that the version you gave here (link in post #244) works well: it has decoded all frames of Toy Story 2.
However, there is still a problem. The batch never stops. When the decode is finished, a meaningful message is printed, but the next command in the batch is never executed. (I have added the "echo %time%" and "pause" commands to be able to precisely measure the time it took to decode the whole movie, but they were never executed.) I had to ^c to kill the decoder. It's a pity, as that problem will prevent to use the method in a fully automated way, as there is no way to know from a batch that the decode is finished.
@r0lZ
I chose a lossless encoding setting (--qp 0) in my CMD command to preserve the quality of the right video.
I've understood that, and it's not a bad idea of course, but it would be nice to frameserve the right view directly to avisynth, without having to write that very big file to disc.
Also, I have a problem with the next step. How do you actually encode the final side-by-side video?
I haven't been able to open the decoded right-eye stream in avisynth. If I use DirectShowSource to open the mkv, it seems that the whole file must be parsed by the decoder (probably to count the number of frames, but I'm not sure). After 2 minutes or so, the decoder returns a timeout error. (I have tried to play with the timeout argument of DirectShowSource but without success.)
I have also tried to extract the h264 elementary stream (it took a long time!) to pre-process it with DGAVCIndex and to open the dga file with DGAVCSource, but DGAVCIndex outputs this error:
PicParset 0 references an invalid (uninitialized) Sequence Parameter Set with ID 0, expect the unexpected...
However, it seems to work just fine, and (again after a long time) it has found the right number of frames. But opening the dga file with avisynth doesn't work. StackHorizontal complains because the image heights don't match. :confused:
So, I can now play the right eye mkv with MPCHC, but I can't encode the final video. What am I missing?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.