View Full Version : BD3D2MK3D v1.17: Convert 3D BDs or MKV to 3D SBS, T&B or Frame-sequential MKV
r0lZ
18th July 2016, 08:45
Just one more question: is there a way to convert HSBS files to FS? Looks like the software only can work with ISO or 3D-MKV (where the last one requires the 3D file created by MakeMKV). What if I do not have the required extra file? Did some playing around by downloading some 3D SBS test files, but no go :(. Any advice?
As promised, here is a little avisynth script to help you convert Half or Full SBS or T&B to Frame Sequential:
# SBSorTAB2FS.avs v1.0 by r0lZ, July 18, 2016
# Avisynth script to convert a 3D clip from Full or Half SBS or T&B to 720p or 1080p frame sequential
# Requires the FFMpegSource2 avisynth plugin: http://avisynth.nl/index.php/FFmpegSource
# Usage: Copy this script in the directory containing the source clip, and edit the settings below to suit your needs.
# Encode the script using a good x264 or x265 frontend, and mux with MkvToolnix GUI.
# Don't forget the very important x264 option --frame-packing 5
# Select the stereography mode 13: both eyes laced in one block (left first) for the video stream in MkvToolnix GUI.
# Edit the settings below:
# Source clip file name. If the AVS script is not in the same directory, the full path must be provided.
SourceClip = "3D Movie HSBS.mkv"
# Source format is SBS?. Can be true for SBS or false for T&B
SourceSBS = true
# source is half-TAB ? Can be true for Half-T&B or false for full T&B. (This setting is ignored if the source is full-SBS or half-SBS)
SourceFull = false
# Source has left view first ? Can be true for left view first (usual), or false for right view first.
SourceLeftViewFirst = true
# Source vertical resolution. Can be 720 or 1080
SourceResolution = 1080
# Output vertical resolution. Can be 720 or 1080
OutputResolution = 720
# Load the source clip in Half or Full-SBS 1080p format
FFMpegSource2(SourceClip)
# Crop left and right images from Half or Full SBS source
view1 = SourceSBS ? Crop(0, 0, last.width / -2, 0) : Crop(0, 0, 0, last.height / -2)
view2 = SourceSBS ? Crop(last.width / 2, 0, 0, 0) : Crop(0, last.height / 2, 0, 0)
# Build Frame sequential clip
fs = SourceLeftViewFirst ? Interleave(view1, view2) : Interleave(view2, view1)
# If the horizontal black borders have been cropped, restore them
border = ( SourceSBS || SourceFull) ? (SourceResolution - fs.height) / 2 : (SourceResolution / 2 - fs.height) / 2
fs = ( border > 0 ) ? AddBorders(fs, 0, border, 0, border) : fs
# Resize FS clip to 720p or 1080p
LanczosResize(fs, OutputResolution * 16 / 9, OutputResolution)
You can download the script here (http://download.videohelp.com/r0lZ/BD3D2AVS/SBSorTAB2FS.avs).
Usage:
You need: Avisynth with the FFMpegSource2 avisynth plugin (http://avisynth.nl/index.php/FFmpegSource) properly installed, a good GUI for x264 (I suggest the Simple x264/x265 Launcher (http://forum.doom9.org/showthread.php?t=144140)), and MkvToolnix (https://mkvtoolnix.download/index.html). I suggest also to install the avisynth editor AVSp Mod ([URL="http://forum.doom9.org/showthread.php?t=153248), to edit and verify the avisynth clip.
Copy the script in the directory containing the SBS or T&B script you want to convert.
Open it in AVSp Mod (or in any text editor like Notepad) and edit the settings at the top of the file. They should be self-explanatory. You must specify the file name of the clip, and the format, such as Half SBS Left view first 1080p (the most frequent situation). There is also an option to convert to FS full-HD (1080p) or "small-HD" (720p).
Note that the SourceResolution is the height of the source clip BEFORE any cropping of the black borders, that may have been done when the clip has been encoded to SBS or T&B. Usually, the source resolution is 1080. Note also that the SourceFull argument is used only when converting from T&B format, and is ignored for SBS.
If you have AVSp Mod, click the Play arrow in the bottom left corner of the window, and then use the Right cursor key on your keyboard or use the timeline with the mouse to start the rendering and verify that everything works as expected. (You may have to wait a long time when you play the script for the first time, because FFMpeg must generate an index file once, and that requires to scan the whole input clip.)
Now, launch your GUI for x264. Open the AVS script in the GUI. Select the x264 options you want to use, like the CRF value. DO NOT FORGET the very important --frame-packing 5 option. (Without that option, x264 will "think" that the differences between the even and odd images of the frame sequential clip are constant moves, and it may blur them !) If you use the Simple x264 Launcher, you must type that option in the "Custom encoder parameters" field.
You may want to specify other x264 options as well, such as the frame rate, the total number of frames, the level, and so on, but none are really necessary. (If you want to know the options that BD3D2MK3D uses, encode a small clip to frame-sequential, and have a look at the __ENCODE_3D.cmd file.)
Finally, launch the encoding.
When the encoding is finished, open the original SBS or T&B clip in MkvToolnix GUI, and untick the video stream. Add the new video stream you have just encoded, and specify the stereoscopy mode 13 "both eyes laced in one block (left first)". For the "Default Duration/FPS", you should use the same frame rate than in the input clip (usually 24000/1001p).
Remux. The output should be OK. Verify if there are no sync problems with the audio tracks, and if necessary, specify the correct delays in the MkvToolnix GUI and mux again.
Have fun. :-)
robl45
18th July 2016, 12:41
Obviously, there is something wrong with the subtitle track. It is empty, or it has discrepancies. Try another subtitle track.
You can also try to extract that track with another program, like eac3to, but I doubt you will succeed.
I suppose you have used the option to hardcode a subtitle stream over the video in the last tab. Right?
Can you post the content of the __ENCODE_3D_MOVIE.avs file? It should load the SupTitle plugin.
Also, please verify that you have the SupTitle.dll, SupCore.dll, loadhelper.dll, msvcp100.dll and msvcr100.dll files in the BD3D2MK3D\toolset folder.
Files above are there, file info below. I don't believe this is going to do what I need it to, but there appears to be a bug here so I'm happy to help. The subtitle is definately good, its the forced subtitles and plays fine in MPC-HC. I also tried to extract it like you suggested and it worked as well.
# Avisynth script generated Mon Jul 18 07:24:00 EDT 2016 by BD3D2MK3D v0.92
# to convert "C:/Users/Rob/Downloads/ironman/John_Carter_t01.mkv"
# to 3D Frame Sequential.
# Hardcoded subtitles file "MKV3D.track_4.Eng.3D_left.sup" not generated,
# probably because there is no forced subs in the original file.
# No subtitles will be hardcoded.
# Movie title: john carter
#
# Source information: Interleaved 3D MKV generated by MakeMKV v1.10.0 win(x64-release).
# MKV file: John_Carter_t01.mkv
# Video : Eng AVC, 1080p, 23.976 fps, left-eye
# Audio : Eng DTS-HD-MA, Bitrate: 1536Kbps core + MLP data.Sample Rate: 48KHz Channels: 7.1 (DTS Master Audio 24bit)
# Subtitle: Eng PGS, 3D-plane: 5
# Subtitle: Eng PGS, 3D-plane: 0
# Video : Eng MVC, 1080p, 23.976 fps, right-eye (32 3D-Planes)
LoadPlugin("C:\Users\Rob\Downloads\BD3D2MK3D\BD3D2MK3D\toolset\LoadHelper.dll")
LoadPlugin("DGMVCDecode.dll")
#LoadPlugin("FRIMSource.dll")
#LoadPlugin("C:\Program Files (x86)\BDtoAVCHD\MVCSource.dll")
##LoadPlugin("VSFilter.dll")
#LoadPlugin("SupTitle.dll")
# Load the two video streams (189933 frames per stream)
interleaved = DGMVCSource("MKV3D.track_1.264", "MKV3D.track_1.mvc", view = 0, frames = 189933, hw = 0)
#interleaved = FRIMSource("mvc", "MKV3D.track_1.264", "MKV3D.track_1.mvc", num_frames = 189933, cache = 2, platform = "")
#interleaved = MVCsource("MKV3D.track_1.264", "MKV3D.track_1.mvc", 189933, 2)
# Current base view: left eye.
# The views are in the common order: AVC stream = left view, MVC stream = right view.
left = SelectEven(interleaved)
right = SelectOdd(interleaved)
# Hardcode subtitles
#left = VobSub(left, "MKV3D.track_4.Eng.3D_left.sub")
#right = VobSub(right, "MKV3D.track_4.Eng.3D_right.sub")
left = SupTitle(left, "MKV3D.track_4.Eng.3D_left.sup")
right = SupTitle(right, "MKV3D.track_4.Eng.3D_right.sup")
# Build Frame Sequential stream
Interleave(left, right)
AssumeFPS(48000/1001.0)
# Return the 3D clip.
Return(last)#.Info()
r0lZ
18th July 2016, 13:26
OK, for the second error (there is no function named "SupTitle"), it's because the line #LoadPlugin("SupTitle.dll") is commented out. Remove the "#" at the beginning and that should work.
Have you edited the script manually yourself, or is it exactly what BD3D2MK3D has generated? In the second case, there is a bug in my code.
For the problem of the "empty" subtitle stream, it seems that it's a Java error. Try to re-install the Java Runtime (32 and/or 64 bit, depending of the version installed on your system) and/or update it to the latest version. To check if Java works as expected, you can launch a conversion to 3D from the Subtitle Tools menu. It's faster than having to re-create a project from scratch. If you can't get BDSup2Sub to work, try to select the ++ version (with the Settings -> BDSup2Sub menu), and again try to launch a conversion manually to verify.
robl45
18th July 2016, 14:04
I have not touched any of the files, just run the program. I did as you suggested below with the subtitles tool menu, when using the ++ version it worked. I don't really understand it. I just built this computer and I installed Java and verified it. not sure what exactly is going on with that.
OK, for the second error (there is no function named "SupTitle"), it's because the line #LoadPlugin("SupTitle.dll") is commented out. Remove the "#" at the beginning and that should work.
Have you edited the script manually yourself, or is it exactly what BD3D2MK3D has generated? In the second case, there is a bug in my code.
For the problem of the "empty" subtitle stream, it seems that it's a Java error. Try to re-install the Java Runtime (32 and/or 64 bit, depending of the version installed on your system) and/or update it to the latest version. To check if Java works as expected, you can launch a conversion to 3D from the Subtitle Tools menu. It's faster than having to re-create a project from scratch. If you can't get BDSup2Sub to work, try to select the ++ version (with the Settings -> BDSup2Sub menu), and again try to launch a conversion manually to verify.
r0lZ
18th July 2016, 14:21
OK, thanks. Unfortunately, BDSup2Sup++ has some bugs that the java version doesn't have, so it is better if you can fix the problem and use the java version.
BTW, BD3D2MK3D tries to determine itself the "best" java exe to run, but it's not easy due to the incredibly bizarre way it is installed. If you wish, you can edit the BD3D2MK3D.cfg file (in the BD3D2MK3D folder) and change the path in the following line:
set ::config(javapath) {C:\ProgramData\Oracle\Java\javapath\java.exe}
Note that you should replace the backslashes in the path with normal slashes or double backslashes.
Personally, I use often the real exe, located in "C:\Program Files\Java\jre1.8.0_92\bin", because the exe in ProgramData are just shortcuts, not well supported by some programs). But due to the version string in the installation path (why?!?), you will have to modify the config file after each new release of java. You may also try to use "java.exe" without the path. That may work, or not, depending of the Java installer.
I think that the commented out LoadPlugin is a bug that happens only when the subtitles cannot be converted to 3D. In that case, hardcoding them over the video is not possible, and therefore the SupTitle plugin is not necessary. The problem is that the SupTitle command is used because it has not be commented out, and the script cannot start. I will fix that bug for the next version. In the meantime, you can re-generate the project with BDSup2Sup++, or simply convert the subtitles manually, comment out the LoadPlugin line, and launch the encoding normally.
robl45
18th July 2016, 14:26
I did play around with the java just now and it seems that BDsup2Sup java version is now working as it did convert the subs manually.
OK, thanks. Unfortunately, BDSup2Sup++ has some bugs that the java version doesn't have, so it is better if you can fix the problem and use the java version.
BTW, BD3D2MK3D tries to determine itself the "best" java exe to run, but it's not easy due to the incredibly bizarre way it is installed. If you wish, you can edit the BD3D2MK3D.cfg file (in the BD3D2MK3D folder) and change the path in the following line:
set ::config(javapath) {C:\ProgramData\Oracle\Java\javapath\java.exe}
Note that you should replace the backslashes in the path with normal slashes or double backslashes.
Personally, I use often the real exe, located in "C:\Program Files\Java\jre1.8.0_92\bin", because the exe in ProgramData are just shortcuts, not well supported by some programs). But due to the version string in the installation path (why?!?), you will have to modify the config file after each new release of java. You may also try to use "java.exe" without the path. That may work, or not, depending of the Java installer.
I think that the commented out LoadPlugin is a bug that happens only when the subtitles cannot be converted to 3D. In that case, hardcoding them over the video is not possible, and therefore the SupTitle plugin is not necessary. The problem is that the SupTitle command is used because it has not be commented out, and the script cannot start. I will fix that bug for the next version. In the meantime, you can re-generate the project with BDSup2Sup++, or simply convert the subtitles manually, comment out the LoadPlugin line, and launch the encoding normally.
r0lZ
18th July 2016, 16:25
OK, so if you have a chance to generate again a project with similar settings (including a hardcoded subtitle stream), please let me know if everything is working as expected. Thanks in advance.
r0lZ
19th July 2016, 10:54
This version fixes the "Script error: there is no function named SupTitle" bug occurring rarely and discussed here (http://forum.doom9.org/showthread.php?p=1774347#post1774347). I have also added in the error message that the error can be caused by Java.
There are also some improvements, notably in the functions available to format correctly the actor and character names in the Title & Tags tab.
Finally, the x264, x265 and MkvToolnix tools have been updated to their latest versions.
v0.93 (July 19, 2016)
- Improved the functions available with the context menu in the Actors (and characters) field of tab 3.
- Modified the Help message about the DTS decoder, because ArcSoft is not the best choice any more.
- Fix: The encoding should not crash any more when the subtitles to hardcode on the video cannot be generated.
- Updated the MkvToolnix exes to the latest version (v9.3.1 "Mask Machine")
- Updated the x264 exes to the latest version (v0.148.2705)
- Updated the x265 exes to the latest version (v2.0+2)
Download: BD3D2MK3D.7z (http://download.videohelp.com/r0lZ/BD3D2AVS/BD3D2MK3D.7z)
frank
4th August 2016, 11:51
After Upgrading my Dell from W7Pro to W10Pro 1511 (not
anniversary) BD3D2MK3D cannot read covers from BD.
ISO mounted with W10. Latest Java 8 Update 101.
If I select cover From BD then I get an error in the bottom line:
convert.exe: Not recognizing known sRGB profile that has been edited
`C:/Users/tester/AppData/Local/Temp/thumb_cover_land_9208.png'
@ warning/png.c /MagickPNGWarningHandler/1832.
But there are .jpg pictures in BDMV/META/DL with other names.
Same issue with the button and selecting the jpg on BD.
Tested v0.93 and v0.85.
What happend?
EDIT: BD was Batman v Superman. US. Something is strange with the pictures. Other BD works. I couldn't find a difference to other BD. :(
r0lZ
4th August 2016, 12:25
I have already encountered this error. It's a limitation in the ImageMagick library (convert.exe). It seems that some kind of RGB data (sRGB) cannot be recognised. Unfortunately, I can't fix it, because it's not a problem in my code.
I will try to do something, but I need more info. Please check your PMs.
In the meantime, you can open the image in any image editor, and save it in another format (such as PNG). Then, use that image in BD3D2MK3D. That should work.
frank
4th August 2016, 12:33
I found a workaround.
png didn't work.
Conversion with Windows Paint ->24 bit bmp
and back to jpg works. :)
I cannot test in W7 anymore. I think the issue is not in W10.
r0lZ
4th August 2016, 12:39
Great! Note that you don't need to convert to JPG again. If the input image is in PNG format, it is resized if necessary to PNG too, or it is kept unchanged. In all other formats, it is converted to JPG anyway. (It's necessary because the MKV standard supports the thumbnail images in JPEG and PNG formats only.) So, you can convert to BMP, and let BD3D2MK3D convert the BMP to JPG.
Anyway, I would like your original JPG image. Perhaps I'll find a workaround, but I need an example. (I can't remember what image or BD has caused that problem here.)
robl45
27th August 2016, 19:06
is this supposed to convert to SBS using hardware encoding?
r0lZ
27th August 2016, 19:19
No. The encoding is done with x264 or x265, and they are software-only encoders. BTW, GPU based encoders are well known for their relative low quality. x264 is certainly the best free AVC encoder currently available. IMO, it is much better to spend a relatively long time in the encoding process and have a good compression without losing much quality than using a fast but bad encoder.
robl45
27th August 2016, 20:18
No. The encoding is done with x264 or x265, and they are software-only encoders. BTW, GPU based encoders are well known for their relative low quality. x264 is certainly the best free AVC encoder currently available. IMO, it is much better to spend a relatively long time in the encoding process and have a good compression without losing much quality than using a fast but bad encoder.
no problem, I thought I had read it did, my mistake, it crashed part way through doing the encoding, not sure what happened.
r0lZ
28th August 2016, 17:17
The Intel MVC decoder can use hardware acceleration if you have the right CPU (supporting QuickSync) and the latest Intel drivers, but the gain is not very important.
For the crash, be sure to launch __ENCODE_3D_LAUNCHER.cmd and not directly __ENCODE_3D.cmd, as otherwise the PC can go to sleep or hibernate mode during the encoding, and x264 doesn't like that at all! Also, if the problem persists, try to turn off the hardware acceleration of the decoding with Settings -> MVC Decoder -> Hardware Acceleration -> Disabled.
konikpolny
3rd September 2016, 00:00
Hi r0lZ,
After a long break I can finally get back to BD3D2MK3D to make my MK3Ds, and I just thought that it would be very useful to be able to make a quick and short sample by selecting specific chapter(s) to do. What I mean is to have something similar to handbrake where one can select the duration from-to chapter.
In case of BD3D2MK3D this could produce a fully functional quick test with all the config files as well and would definitely be helpful in making decisions as to what settings to use.
What do you think?
r0lZ
3rd September 2016, 08:57
Unfortunately, currently it's not possible. All MVC decoders must decode all frames, starting at the first frame, and therefore they are currently unable to seek to a certain point in the movie to begin the decoding at that point. (In fact, there is a way to drop the beginning of the movie and start to encode only after a certain frame number, but it will be necessary to decode the beginning of the movie anyway, and that's long and useless.) That means that there is no practical way to encode only a specific chapter, or to provide the starting and ending frame numbers.
However, if you really want to do a short test, you can manually change the number of frames to encode in the __ENCODE_3D.cmd file. (You have to change that number two times, or 4 times if you encode in 2-pass mode.) That way, you can restrict the encoding to the beginning of the movie, and that should be sufficient to do a quick test. But it is impossible to encode the middle or end of the movie only, and therefore I will not implement that feature in the GUI. Sorry.
Note also that if you want to build a short MK3D after having computed the full movie, you can use the Mkvtoolnix GUI to cut a short sample anywhere in the movie. That may be handy if you need to provide a sample, but you'll have to encode the full movie anyway.
konikpolny
3rd September 2016, 12:28
Thanks for the workaround.
I guess you would have done it by now if it were possible. :)
slavanap
6th September 2016, 14:38
r0lZ,
All MVC decoders must decode all frames, starting at the first frame, and therefore they are currently unable to seek to a certain point in the movie
If you remember, ssifSource (http://forum.doom9.org/showthread.php?p=1631733#post1631733) decoder is able to seek (because FFMpegSplitter is able to do so in .ssif files), although seek is not frame accurate.
konikpolny,
Looks like link in the post (http://forum.doom9.org/showthread.php?p=1631733#post1631733) got expired, although sources (https://github.com/slavanap/ssifSource) are available now. And you can get binaries here (https://github.com/slavanap/ssifSource/releases).
r0lZ
7th September 2016, 09:55
That's right, but I don't want to rewrite BD3D2MK3D again (almost) from scratch just to implement a way to seek in the video. And IIRC SsifSource is much slower than the current solutions. I didn't know that its seek is not frame accurate, but it's another reason to not recommend it. But you're right. I should have written that the MVC decoders currently supported by BD3D2MK3D or based on the Intel MVC decoder are not able to seek.
slavanap
10th September 2016, 14:39
No offense.
That's right, but I don't want to rewrite BD3D2MK3D again (almost) from scratch just to implement a way to seek in the video.
I didn't mean it that way! A person asked for a possibility of cutting source video during encoding. I just wanted to fix your "impossible" answer. This is all. My answer doesn't have meaning "add this solution". I wanted to say that this is impossible with BD3D2MK3D, but you can use other difficult way if you really want to achieve what you want. This is it.
And IIRC SsifSource is much slower than the current solutions.
Well, this is that slow because it's using original sample_decode.exe from Intel SDK. If any all those people who developed their fast solutions wanted to make it faster, they could develop their own optimized sample_decode.exe version that would still work with ssifSource. Unfortunately, I didn't have time to optimize sample_decode.exe myself. Still, the fact is that all these fast solutions are close-source while mine became open.
I didn't know that its seek is not frame accurate, but it's another reason to not recommend it.
It is I-frame accurate. I-frames usually appear every second of the video. 1-second accurate solution is something. And with SequentialToSeekable you can make it to start from the frame you want.
But you're right. I should have written that the MVC decoders currently supported by BD3D2MK3D or based on the Intel MVC decoder are not able to seek.
The latter is incorrect though. ssifSource is based on Intel SDK. The truth is that all decoders that work with .h264 files are unable to seek, because .h264 files does not contain an index, meanwhile, for example, .ssif file does. tsMuxeR.exe just ignores the index while extracting .h264 streams from .ssif/.m2ts file.
r0lZ
11th September 2016, 16:08
I agree. Sorry if my answer was not accurate. BTW, when I wrote "(In fact, there is a way to drop the beginning of the movie and start to encode only after a certain frame number, but it will be necessary to decode the beginning of the movie anyway, and that's long and useless.)", I was referring to your SequentialToSeekable plugin. It is very useful, but since the whole beginning of the movie must be decoded anyway, it's slow and it's not really a good solution to encode only from a certain point. But that works, and it is relatively easy to modify a BD3D2MK3D project to use it if it's really necessary.
However, honestly, I don't think that there is an obvious advantage in the possibility to encode only a part of a movie, at least with BD3D2MK3D. Usually, the whole movie must be encoded, or if the BD is made of several episodes, there are almost always titles containing one episode only on the same BD. And the samples that may be useful in some circumstances can be easily extracted from the whole MKV, as I have explained above.
In fact, Donald Graft has proposed to improve his DGMVCDecode plugin by adding the possibility to seek. That requires to process the input file first to build an index and save it to HDD (as FFMpegSource2 does when necessary), and that takes some time, but when the index exists, the seeks are immediate and frame accurate. Of course, I have accepted his proposition, but he has never released the new version, probably because he has not enough time to do it. Perhaps with that solution I would have added the starting and ending points in the BD3D2MK3D GUI, although there are other problems to solve, such as how to cut the audio and subtitles properly (but that should be easy).
Anyway, thanks for the precisions and for your work.
r0lZ
17th September 2016, 08:44
Here is v0.93, that fixes several minor issues:
v0.94 (September 17, 2016)
- Fix: BDSup2Sub crash when the language code of the stream to convert is "und" or "un" (undefined).
- Fix: Subtitles not converted to 3D when the language code is not known by BDSup2Sub.
- Fix: The wrong error messages about renaming subtitle files in the BD3D2MK3D log have been removed.
- Fix: Workaround for a bug in ImageMagick when converting an image from sRGB JPEG to PNG.
- Updated the MkvToolnix exes to the latest version (v9.4.2)
- Updated the x265 exes to the latest versions (2.0+55 or 2.0+54)
Download: BD3D2MK3D.7z (http://download.videohelp.com/r0lZ/BD3D2AVS/BD3D2MK3D.7z)
konikpolny
27th September 2016, 23:44
r0lZ,
I noticed that if I select h265 HEVC encoder and I click "Do it!" to create the project files, a number of subtitles files are missing when compared to doing the similar with the h264 AVC encoder. These include xml 2D picture subs, and all the 3D planes, but most importantly all the chosen 3D streams (idx/sub, sup) are missing. Strangely the 2D idx/subs and sups are not affected.
konikpolny
28th September 2016, 08:41
I should have added that it happens when doing encoding for full-SBS. And that actually seems to matter.
r0lZ
28th September 2016, 09:13
The answer is in your second post. The problem is not at all related to h265, and it's not a bug.
Unfortunately, there is a big limitation in the BD SUP and DVD SUB formats. The picture dimension must be standard (1920x1080 for HD), and the width (or height for T&B) cannot be multiplied by two. Therefore, it is possible to generate 3D subtitles for Half-SBS or Half-T&B, but not for Full-SBS and Full-T&B. (A similar limitation exists for Frame Sequential, but for other reasons.) However, it is possible to hardcode the 3D subtitles over the image (with the option in the last tab) without problem, regardless of the output format (because the subtitles are hardcoded on the full left and right frames before they are combined together). So if you really want to encode in Full-SBS and you want the correct 3D subtitles, hardcoding a single subtitle stream is your only option.
Note that this is briefly explained in the warning dialog that appears when you untick the "Half" option in the last tab.
If your player supports (correctly!) the ASS (Advanced SubStation Alpha) subtitle format, you may want to convert the subtitles to ASS 3D. As far as I know, ASS has not that picture format limitation and should be OK for Full-SBS or Full-T&B. But it's a text-based format, so you have to either convert the original SUP to SRT (with SubtitleEdit) or download a SRT for your movie first. Then you will have to convert the SRT to ASS 3D with the last option of the Subtitle Tools menu of BD3D2MK3D, and either modify the __MUX_3D_OPTIONS.txt file to include the new subtitle stream or mux it manually with MkvToolnix. And the result might not be perfect. If you want to try that method and you don't understand how to generate the correct 3D ASS, ask here for help. It's not really easy, but it's feasible.
konikpolny
28th September 2016, 13:22
R0Iz, thanks for reminding me about 3D sup/sub streams limitations for Full-SBS/TB :). Now I do remember reading about it before.
However, I still think that these files should be generated and made available for 'other' use even if not being muxed in the final MKV due to their incompatibilities.
The main reason why I do the full-SBS is to have one best quality copy for both 3D and 2D. For watching I only use software players (my computer) and a projector. When having 2 full frames I can enjoy watching 2D in its original full format and best quality rather than having it stretched from its squeezed half. In case of a 3D I have to adjust the aspect ratio to "squeeze" the full-SBS to half-SBS anyway in order for my projector to properly display the 3D. Therefore, when I make the picture appear as half-SBS I can perfectly use the 3D sub/sup subtitles meant for the half-SBS and they are loaded by the player automatically if they are made available as an external file. I have also created the .ass 3D subs but in fact I cannot even use full-SBS .ass because they don't get 'squeezed' by the player and so again I have to create half-SBS .ass 3D subtitles for my use.
So for incompatibility reasons I wouldn't even want to mux the 3D half-SBS sub/sups in the final mkv but I would need these files to be available externally.
This also regards the files for 3D planes, which are necessary to convert 2d SRT into 3d ASS, and the XML picture subtitles which are very helpful in verifying 3D-planes compatibility.
As regards the warning dialogue for Full-SBS/T&B it could inform that if 3D subtitles were selected by the user only half-SBS/TB subs/sups will be generated and they won't be muxed for incompatibility reasons. Then it would be in line with what the user selects on the "Select streams" tab.
Also, THANK YOU VERY MUCH :thanks: for making the .SRT to 3D .ASS converting tool. Some italic subs may look jagged but it is an excellent tool to have! Many thanks for that!
r0lZ
28th September 2016, 14:32
Hum, well, I understand your reasons, but your way to display the Full-SBS is very specific and not used by many users. I'm not sure that adding the 3D subtitles as Half-SBS outside the container makes much sense, except for you. Also, it is possible and easy to convert then to Half-SBS yourself. All you have to do is to note the 3D-Plane to use (It is displayed in tabs 1 and 2), then extract the 3D-Planes from the original MVC video stream (with Subtitle Tools -> Extract 3D-Plane from MVC), and convert the original 2D subtitles to 3D (with the first option in the same menu). Normally, that's straightforward and easy. At least, it's much easier than converting 2D SRT to 3D ASS.
I may add an option to generate the Half-3D subtitles anyway for Full-SBS and Full-T&B, and mux them in the final video (even if your player needs them outside) because, indeed, they can be useful if the player resizes the video itself AND if the subtitles are displayed AFTER that operation, but I will need some time. Currently, I'm busy on other things. In the meantime, you can convert the subtitles to whatever you want yourself.
The fact that you cannot use Full-SBS ASS is probably due to a bad configuration of your player. Personally, I use PotPlayer to verify the 3D movies on my PC, and it has an option to display the subtitles before or after the conversion to 3D. It's not exactly the same thing for you, but it's similar. The player must display the 3D subtitles before the conversion (because they are split later, with the video), and the 2D subtitles after the conversion (because otherwise the 2D subtitles are split in two halves). A similar option may (should?) exist for your player. If you can display the Full-3D ASS subtitles over the ORIGINAL video, and either resize the video with the player after that, or let the TV resize the video, the subtitles should be OK. Note also that it is perfectly possible to generate Half-SBS ASS subtitles with BD3D2MK3D.
Thanks for the thanks for the ASS-3D conversion tool! Note that I don't use the 3D-ASS subtitles myself, and I have not tested much that function. But I have noticed that the first subtitle was missing after converting a SRT encoded in UTF8 or UTF16 format. I have tried to fix that bug, but I'm still not sure it works fine in all cases. So, if you use that function, please verify if the first subtitle is correct and not missing, and let me know if the bug is still not fixed.
konikpolny
28th September 2016, 19:04
I may add an option to generate the Half-3D subtitles anyway for Full-SBS and Full-T&B, and mux them in the final video (even if your player needs them outside) because, indeed, they can be useful if the player resizes the video itself AND if the subtitles are displayed AFTER that operation
I would be grateful if you could, even if added as a muxing option, and I didn't mean to say that my player needs the subtitles outside. I use either MPC-HC or PotPlayer. What I meant was that software players automatically load external subtitles and so I don't even have to bother muxing possibly incompatibile or not fully compatible subtitles. It is my own preferrence. I would have muxed them if they were fully compatible. Still they are useful and I definitely want to have them. Also, my personal opinion is that a lot of users may want to keep these subs files for future in case they want to mux/use them later or share with somebody else. After all the program generates a lot of files all of which only one final video file is to stay in the end. Why not let users decide what files they want and which files to delete.
All you have to do is to note the 3D-Plane to use
Yes I know, but the full-SBS/T&B projects as for now don't generate the 3D planes files either. Nor the XML/PNG files, which as I said are the only acceptable input files in the "Verify the 3D-planes compatibility" Subtitle tool.
please verify if the first subtitle is correct and not missing, and let me know if the bug is still not fixed
My 3D .ASS subtitles which I converted from the OCR'ed UTF-8 SRT seems OK and contain the 1st subtitle. I will let you know if I notice anything unusual.
The fact that you cannot use Full-SBS ASS is probably due to a bad configuration of your player.
I have spent quite a long time with PotPlayer and couldn't really figure out what would be the best configuration in case of full-SBS MKVs, as well as my full-SBS ASS subtitles. If I change the subtitles output to be before the resizing to 3D I sometimes end up with 4 pairs of (8) 'squeezed' subtitles! :) As regards the video I need to change the Aspect Ratio to make it a half-SBS as my projector only supports half-SBS/T&B. The expected effect whatever it is is some kind of mysterious combination of settings for 3D video and the subtitles together. Maybe someone could suggest the best configuration especially with regards of full-SBS 3D-ASS?
r0lZ
29th September 2016, 09:28
BD3D2MK3D will treat the subtitle file like normal subtitles and mux it, exactly like for Half-SBS. Of course, you are free to rename and keep the subtitle file also outside the MKV container, but BD3D2MK3D will not do it automatically.
With 3D subtitles, you must disable the 3D option for the subtitles in PotPlayer (3D Subtitles (Stereoscopic) -> Do Not Use (Recommenced)), because otherwise it duplicates what it thinks are 2D subs, and you get 4 subtitles! Anyway, I agree that the config of PotPlayer regarding the 3D subtitles is hard to master. To display the subtitles before or after the resize, I think that you should play with the Display Subtitles on Video or on Overlay (Alt-i) and the 3D Subtitles -> Subtitle Output After or Before Resizing options. For 3D-ASS, the problem is probably more complex, because ASS is a text based format, and PotPlayer has a lot of other options to let you position the subtitles where you want them (for example over the image or over the black border). You should select the option that does not modify the position encoded in the ASS file.
Personally, I don't encode in Full-SBS, so I don't need to modify the aspect ratio, and I don't know how the subtitles are modified by that option, but it should be possible to display the subtitles correctly. When I'll have some time, I will try to encode a short clip with subtitles and maybe I'll find a solution. But be patient...
Palych
8th October 2016, 10:19
Hello, r0lZ! Hello, everyone!
I write here first time. I need your help! When I try to start this program (BD3D2MK3D v0.78) on my notebook, I get this error. What I do wrong? Look at my screenshots, please.
The problem was and on my PC, when I started the program first time, after installation other Windows 7 64-bit, the problem is over.
r0lZ
8th October 2016, 10:30
Welcome to the Doom9 forums, Palych.
Unfortunately, your screenshots are not approved yet, so I can't reply right now. To avoid the delay due to the attachments approval, it is better to post your screenshots on an image hosting site like PostImage (https://postimage.org/), and post the links here.
Anyway, I will come back when your images will be visible or approved...
Palych
8th October 2016, 11:06
These are links:
https://s16.postimg.org/d1jaki8dx/log.jpg
https://s21.postimg.org/9vpbab0br/screeh_avs_2.jpg
https://s13.postimg.org/nny4kmgmv/screen_enc.jpg
r0lZ
8th October 2016, 12:08
OK, according to the error, it's DGMVCSource that fails to open the input files or can't get the Intel decoder to work.
I note also that the number of frames in the "__ENCODE_3D_MOVIE.avs" and in the "__ENCODE_3D.cmd" scripts is very low: only 3480 frames. It's approximately 2 minutes and 25 seconds of video ! So, either you encode only a very short clip (and certainly not the "How to train your dragon 2" movie), or you have edited manually the script to do a short test, or something went wrong when the project has been created. In the later case, I suspect a disk full problem. Are you sure you have enough disc space? You can probably see the real cause of the error in the BD3D2MK3D.log file, in the "*** Demuxing the streams..." section, near the beginning of the file. If you are not sure, post the content of that file here (between CODE marks, not as an image).
If the number of frames is correct and the 00162.track_4113.264 and 00162.track_4114.mvc files are present in the project folder, then maybe there is a problem with the Intel decoder. If it's the case, try to edit the avisynth script "__ENCODE_3D_MOVIE.avs" and change this line:
interleaved = DGMVCSource("00162.track_4113.264", "00162.track_4114.mvc", view = 0, frames = 3480, hw = 0)
Change the "hw = 0" at the end of the line with "hw = 1". That will disable the hardware acceleration during the decoding of the video (if your CPU supports it). Then launch again "__ENCODE_3D_LAUNCHER.cmd" and see if it works fine. If it's OK, that means that the Intel decoder tries to use the hardware acceleration but fails. Usually, it's due to outdated Intel CPU drivers. Check if there is an update of your CPU drivers. Otherwise, you may have to select the option "Settings -> MVC Decoder -> Hardware Acceleration -> Disabled (Use if Auto crashes)". That will permanently disable the hardware acceleration. You may also want to try to use FRIMSource instead of DGMVCSource (in the same "MVC Decoder" menu), although I doubt that it will work better.
Please let me know if you can get it to work, and how. Thanks.
Palych
8th October 2016, 13:41
Thanks!!!!! Everything is working!!!! Changed the "hw = 1". Yes, I didn't update drivers too long. It's my mistake. Next time I'll be careful! Now, I know why on my PC was such error.
Yours sincerely Palych!
PS:The number of frames is correct, it's small "ssif" from BR.
r0lZ
8th October 2016, 13:51
OK, thanks for letting me know.
If you can't update your drivers or if the problem persists, don't forget to change the Hardware Acceleration setting in BD3D2MK3D. Disabling it is not very important, as the speed gain is minimal. And your next projects will work correctly without having to edit the avisynth script.
Have a nice 3D experience!
frank
15th October 2016, 18:30
My latest experiences:
Potplayer (1.6.63638) now analyses mkv video (frame-packing) and can automatically switch to 3D regardless of the extension hlr, htab, hou...
EDIT:
Sorry, I was wrong because of big GUI issues.
The german GUI (maybe others too) of Potplayer has a lot of translation issues, line mismatches. So use the english.ini for proper GUI text and setup.
Switching only works with MVC-3D mkv generated by MakeMKV.
Potplayer (1.6.63638) now playes mkv-3D (MVC) muxed by MakeMKV using the Intel MVC 3D software decoder.
PowerDVD 16 can play 3D video from mkv generated by MakeMKV or BD3D2MK3D.
But the morons until now mismatch left and right view on passive display.
The remaining problem are 3D subtitles.
r0lZ
15th October 2016, 19:23
Very good news indeed.
I'm not sure the 3D subtitles is still a problem. Potplayer can display them correctly. It cannot automatically switch to the right configuration (based on what?) and configuring them properly manually is a bit tedious and not very intuitive, but it's possible. And when Potplayer is properly configured, it displays the 3D subtitles correctly on 3D movies, and the 2D subtitles are still correct when playing a 2D movie. IMO, it's (almost) perfect.
The major remaining problem is that most TVs and hardware players are not really 3D friendly, and often they cannot display the subtitles in BD SUP and even DVD VobSub format at all. It is a pity to have to connect a PC to the TV to play a 3D movie with 3D subtitles properly.
r0lZ
17th October 2016, 09:42
Potplayer (1.6.63638) now analyses mkv video (frame-packing) and can automatically switch to 3D regardless of the extension hlr, htab, hou...
That doesn't work here. When I play a 3D SBS movie with the stereoscopy tag in the MKV header and the frame-packing setting in the h264 header correctly set, but without the "3D-lrq" or "3D-HSBS" extension, PotPlayer shows the two images side by side and doesn't switch to 3D automatically. Even with "3D" in the file name, it plays the movie in 2D. The "Auto determine whether to enable 3D video mode" and the "Auto detect 3D input format" settings of PotPlayer are enabled. (Note that there is still a link to this page (https://www.tridef.com/user-guide/3d-file-formats) next to the Auto detect option, but disabling that option doesn't change its behaviour.) It seems that PotPlayer continues to ignore the stereoscopy and frame-packing flags. Or have I missed another setting somewhere?
r0lZ
22nd October 2016, 18:03
I've also discovered that the PotPlayer option "Video -> 3D Video Mode -> Use built-in H264 MVC video codecs" doesn't work properly. The decoded images have serious glitches, similar to the problems of the early Sony MVC decoder, but more frequent and affecting a larger area. It is better to leave that option off (the default).
konikpolny
24th October 2016, 17:48
Hi r0lZ,
I have 4 observations about 3D-ASS subtitles:
1)
I noticed that BD3D2MK3D adds a yellowish SecondaryColor with values=&H0380F0F0 to the converted 3D-ASS subtitles. However, the SecondaryColor is not available to set in the conversion tool, and although not being used directly it does seem to affect how the subtitles are displayed. I noticed that with the yellowish SecondaryColor the subtitles have a thinner and less contrasting outline, and more jagged inclined lines (as in 'A') or with italics. For my use I make the SecondaryColor to be just black (&H00000000). I think it would be better if BD3D2MK3D made it black by default or it allowed for user to select their own preferred SecondaryColor.
2)
The second thing is merely an observation that the ASS version created with the {\pos(x,y)} option makes most of the subtitles (although not all of them) more sticking out by about 1 or 2 points when compared to the ones created with Margins. This still seems perfectly fine to me. I am inclined to use the Margins version anyway.
3)
I also noticed that you still have values for margins for individual subtitles even when \pos(x,y) version is created as in example below. Any specific reason for that? Why not have the 0000s?
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:02:31.78,0:02:34.31,3D,,3,1923,3,,{\pos(966,972)}This is just an example
Dialogue: 0,0:02:31.78,0:02:34.31,3D,,1923,3,3,,{\pos(2874,972)}This is just an example
4)
Lastly my humble suggestion - to call the 'Style' something like "3D" (as in example above) rather than "Default". That would be shorter (as this is repeated for every single sub) and more meaningful :)
r0lZ
25th October 2016, 07:52
1)
I noticed that BD3D2MK3D adds a yellowish SecondaryColor with values=&H0380F0F0 to the converted 3D-ASS subtitles. However, the SecondaryColor is not available to set in the conversion tool, and although not being used directly it does seem to affect how the subtitles are displayed. I noticed that with the yellowish SecondaryColor the subtitles have a thinner and less contrasting outline, and more jagged inclined lines (as in 'A') or with italics. For my use I make the SecondaryColor to be just black (&H00000000). I think it would be better if BD3D2MK3D made it black by default or it allowed for user to select their own preferred SecondaryColor.
Hum, it's strange. The secondary color should not influence the subtitles.
But I don't remember why I have chosen that color. Probably because I've found it in an example. Anyway, I have changed it to &H00000000.
BTW, the code of the SRT to ASS 3D conversion tool can easily be modified. Just edit the file toolset\SRTtoASS3D.tcl. (You can't change the primary and back colors easily, because they are set with the GUI, but the two other colors can be modified if you wish.)
2)
The second thing is merely an observation that the ASS version created with the {\pos(x,y)} option makes most of the subtitles (although not all of them) more sticking out by about 1 or 2 points when compared to the ones created with Margins. This still seems perfectly fine to me. I am inclined to use the Margins version anyway.
I will have a look. AFAIK the position should not be different. Perhaps it's due to the margins you have noticed in point 3.
3)
I also noticed that you still have values for margins for individual subtitles even when \pos(x,y) version is created as in example below. Any specific reason for that? Why not have the 0000s?
Well, yes, there is a reason. Suppose that the user selects a big font size in the GUI and that there is a long sentence to display at a very important depth. In that case, it may happen that the subtitle is pushed partially out of the screen by the 3D offset. The margins are useful in that case to avoid to stick the subtitles to the border of the screen, or, in SBS mode, to go beyond the middle of the screen and therefore appear partially on the view for the other eye! IMO, it is very important to keep the margins, but they can probably be slightly reduced. Currently, the formula to compute the margin is:
set minmargin [expr abs($depth) + $outline + $shadow + 6]
It should be possible to remove the + 6 if you wish, but IMO that should not change the display, except perhaps in extreme cases, as explained above.
4)
Lastly my humble suggestion - to call the 'Style' something like "3D" (as in example above) rather than "Default". That would be shorter (as this is repeated for every single sub) and more meaningful :)
Oh, well, Default is used by all ASS editors, so I kept that convention. I can change it to 3D, but IMO the gain is minimal.
[EDIT] I did it anyway.
r0lZ
25th October 2016, 11:44
I have verified point 2 and you're right. The \pos(x,y) version is always correct, but the right view of the margin version is off by one pixel in a specific case. The bug is due to a discrepancy in the way my code rounds the values when the X coordinates are divided by 2 (for Half-SBS). It happens therefore only in Half-SBS mode and when the 3D depth value is odd.
To test the problem, I have created a single SRT subtitle, and converted it without a 3D-Plane, but with the additional depth set to 30 (the maximum). For technical reasons, the additional depth is always divided by two, so the real additional depth is 15, an odd number. In Half-SBS, the subtitle of the left view must therefore be placed at the middle of the left view + half the 3D offset (rounded to the inferior integer): 1920/4+7 = 487. Similarly, the subtitle of the right view must be shifted to the left by half the 3D offset, but this time rounded to the upper integer: 1920/4*3-8 = 1432. That values are correct in the /pos version. For the margin version, the left view is correct. The margins are 28 and 974, and this simple calculation gives the correct result: (1920-28-974)/2+28 = 487. But for the right view, the same margins are used (but of course inverted): 974 and 28. The final position is therefore (1920-974-28)/2+960-28 = 1433, as you can see in the example below. It should be 1432.
Dialogue: 0,0:00:05.00,0:00:35.00,3D,,28,974,40,,!
Dialogue: 0,0:00:05.00,0:00:35.00,3D,,974,28,40,,!
Dialogue: 0,0:00:35.01,0:01:10.00,3D,,8,968,8,,{\pos(487,1040)}!
Dialogue: 0,0:00:35.01,0:01:10.00,3D,,968,8,8,,{\pos(1432,1040)}!
The right margin values should be 973,29 instead of 974,28 in red above.
I will fix that bug immediately, although it should not be noticeable in normal circumstances. [EDIT: Done.]
I am inclined to use the Margins version anyway.
To avoid the bug, you should use the \pos version instead!
konikpolny
25th October 2016, 12:58
Thanks for the changes and info.
As regards the issue with SecondaryColour I should add that I observed this in MPC-HC, and might only be noticeable there, due to some intrinsic way for rendering subtitles. I haven't tried PotPlayer but it's very likely that it doesn't influence the appearance there at all.
r0lZ
25th October 2016, 13:15
OK, anyway, I have already changed the Secondary Color. The only point that I haven't changed so far is the margin in \pos mode. I don't think it is necessary to modify that.
If you want to check the fixes immediately, you can download the modified SRTtoASS3D.tcl here (http://download.videohelp.com/r0lZ/BD3D2AVS/SRTtoASS3D.tcl) and overwrite the file in the toolset folder.
konikpolny
25th October 2016, 13:52
Thanks for the SRTtoASS3D.tcl update.
I think it's ok to keep the small margin in the \pos version as the reasons are legitimate.
siyangfei
3rd November 2016, 08:37
did any VapourSynth support? avs is slower than vs,when use E5 CPU to encode,i try to use FRIMsource from VapourSynth conditions by the way of call avs filters,and it worked,but still have some problems,because it cant seek and i cant encode a sample. did someone can offer DGMVC support?
r0lZ
3rd November 2016, 10:50
Welcome to the Doom9 forums, siyangfei !
Currently, I have no plan to implement support for VapourSynth, simply because I 'don't think it will be really faster. Most (if not all) the time necessary to decode the video streams is spent by the MVC decoder, and it will not be faster because it runs under VS instead of AviSynth. It would be much more useful to optimize the available MVC decoders, and that's not my job. (And, BTW, FRIMSource might be a bit faster than DGMVCSource. Try it with BD3D2MK3D.)
BTW, currently, no MVC decoder can seek. To implement that, the decoder should create an index file (or, more precisely, two index files, for the two video streams) before beginning to decode the video itself (like ffmpeg or other non-MVC decoders do), and again, since I'm not the author of the MVC decoders, it's not my job.
Note that it is possible to encode only the beginning of the movie easily with BD3D2MK3D, if you really want to encode a sample. It is sufficient to edit the number of frames in __ENCODE_3D.cmd. Or you can of course encode the whole movie and then extract a certain segment with the MkvToolnix GUI.
odyssey
10th November 2016, 16:50
Hi r0lZ
Finally got the chance to try and replace subs with different language. Did so primarily by adjusting a retail sub to match one of the present subs. It works great and looks fantastic (with the right font). Thanks for your amazing work on this! I see that you even added a lot of more features to this. Haven't tried all of them yet, though.
On another note (perhaps slightly off topic), I tried trimming and adding clips together, to replace a translated (non 3D) title, with the original one. I tried both DGMVCsource and FRIMsource, and both of them are crashing :( Using VirtualDub, FRIMsource looked more promising, as it actually did the trim, whereas DGMVCsource seems to insist on starting on frame 0 all the time.
Any ideas why they act up like this?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.