====== BD3D2MK3D - 3D: Create, compress, and customize mkv video file ======
This guide takes you through creating 3D mkv files, which can be played by Kodi, and 3D TVs. I guess they can be played with nearly every media player, and on nearly any 3D capable TV, as long as they support SBS (side-by-side) and TAB (top-and-bottom) 3D movies. As I take you through the chapters below, I will show you how to rip the movie, how to convert and compress the resulting mkv into a 3D mkv, and how to add additional subtitle and audio tracks. Many 3D movies are not released with full localization, so you might want to add those as additional tracks.
I have tested comercially available software, such as ByteCopy or EaseFAB. They are not very expensive, however, very limited in influencing how the 3D mkv is created. As an example, I need to have a resulting mkv with 2 audio tracks and 2 subtitle tracks, and wasn't able to do this. And a hard-coded subtitle definitely is not what I want. Since I use MakeMKV since years to rip my DVDs and (2D) BDs, I started to search for a solution with the same flexibility. The tools of my choice are MakeMKV, BD3D2MK3D, Avisynth, and 3Dsubtitler.
BD3D2MK3D is an excellent tool to create 3D SBS or TAB 3D movies, created by r0|Z. The [[https://forum.doom9.org/showthread.php?t=170828|Forum Thread]] contains detailed information. You must disable the Windows screen saver, as this affects the function of the graphics card, which will then affect the creation of the 3D mkv file.
===== Installation =====
* Install [[https://www.videohelp.com/software/BD3D2MK3D|BD3D2MK3D]] 1.6 by moving it any custom folder
* Install [[http://avisynth.nl/index.php/Main_Page|AviSynth]] 2.6.0
* Install [[http://www.cinexhd2.com/cinde-the-cinavia-detector/|CinDe]] 0.95, then set the path to the exe file in **Help -> Cinavia detection -> Set the path to CinDe.exe**
===== Create 3D mkv =====
==== Preparation ====
BD3D2MK3D is capable to read non-encrypted Bluray Disks, but I find it more feasible to first read all BDs with [[media:makemkv|MakeMKV]], and deal with the copy protection there, as most discs are encrypted anyway.
- Run MakeMKV and read the 3D Bluray Disc.
- Tick "Mpeg4-MVC-3D" in the selection of streams before ripping the disc.
- The resulting mkv file contains 2 video tracks, one for each eye, an avc and mvc stream. Such files cannot be played directly on your Kodi media player, some 3D TVs, or many other media players.
==== Step 1 ====
- Start the tool, then open the file with **File --> Open MakeMKV's 3D MKV**.
- Go to tab “2: Select streams” and select, which audio and subtitle tracks you want to have included in the 3D mkv file.
- Go to tab "3: Title & tags" and give the output file a name.
- Go to tab "5: Options and Go!", set Stereoscopy to "Half - Side by Side" or "Half - Top & Bottom", set the "Project (temp) folder", then hit "Do it!". Leave all other settings at default, they will generate a well compressed 3D mkv with good quality.
- The tracks you selected will get extracted now, and the subtitles prepared in 3D to get transcoded into the 3D mkv file later.
==== Step 2 ====
- Start the command file "%%__%%ENCODE_3D_LAUNCHER.cmd". Keep the output filename proposed by BD3D2MK3D (e.g. "Avatar (2009) 3D-TAB 1080p.mkv"), which will be recongized by Kodi or tinyMediaManager as a 3D mkv file.
- It will take a while until the video is transcoded.
You should disable the screensaver and stop all other programs during transcoding (Step 2).
===== Audio =====
Audio tracks which are included in the input mkv can be selected and will be transcoded into the output 3D mkv. To add additional languages (e.g. additional audio tracks), do the following:
- First, you must rip an mkv file with an additional audio track, which later will be added to the target mkv file. This can be audio taken from a 2D BD, or from a DVD, but obviously must be of the same length and from the same version of the movie.
- Start "TsMuxer GUI" from the Tools menu of BD3D2MK3D and add (select) the mkv file with the additional audio track. Unselect all other tracks, select "Demux" and the output folder, and click "Start demuxing".
- Rename and copy the resulting output file (e.g. Avatar_720p.thai.ac3) to the project folder and add the audio track in file "%%__%%MUX_3D_OPTIONS.txt":--track-name
0:Thai (AC3 5.1 48KHz)
--language
0:tha
--default-track
0:no
--sync
0:0
--compression
0:none
--audio-tracks
0
Avatar_720p.thai.ac3
===== Subtitles =====
Subtitles which are included in the input mkv can be selected and will be transcoded into the output 3D mkv. The following guide shows the detailed steps necessary to include additional subtitles into the 3D mkv file. r0|Z's thread [[https://forum.doom9.org/showthread.php?p=1742601#post1742601|How to convert 2D SRT subtitles or SUP from another BD to 3D]] contains some background information and additional hints.
- First, you must rip your selected 3D BD as mkv file with an additional subtitle track, which later will be replaced with the one we are about to create. This is because 3D movies assign subtitle tracks to 3D-planes, and if the sub file does not match the preset plane, the subtitle will not show. Choose a subtitle track with a language you don't need, but which is as close as possible to the desired subtitle language, in length of text. The language does not need to be similar, but the length of text and therefore, the dimensions of the png graphical representation of the text. As an example, let's say I want English and Thai subtitles, but my movie only has English, Korean, and Chinese. I would then rip the movie with English and Korean subtitles, the latter to be replaced with Thai subtitles.
- You then have 2 choices. Either obtain the SRT subtitle file of the desired language (Thai, in my example), and verify that it is consistent with the version of the movie. The first main indication is that the length of the movie and subtitle entries match. If you cannot positively verify, then follow the steps and include the subtitle file, after which you watch the movie and a few positions from beginning to end, and verify that the subtitle positions match. [[https://ytssubtitles.com/avatar/tt0499549/123860|YTS Subtitles]] is a good source for SRT subtitles.
- Convert the SRT file with [[http://www.nikse.dk/subtitleedit/|Subtitle Edit]]. You must set Default file encoding and the Default frame rate in **Options --> Settings** before importing a SRT file. For Thai, for example, you set the Default file encoding to "10021: Thai (Mac)", then import the file. Click **File --> Export --> VobSub** and enter the Image settings before hitting **Export all lines...**. You must set Video res first.
- Alternatively, extract the additional subtitle track from a 2D BD or DVD, and verify that it is consistent with the version of the movie. Start "TsMuxer GUI" from the Tools menu of BD3D2MK3D and add (select) the mkv file with the additional subtitle track. Unselect all other tracks, select "Demux" and the output folder, and click "Start demuxing".
- Select "Convert Subtitles to 3D (with 3D-Plane/OFS)" in the Subtitle tools menu of BD3D2MK3D. Find the 3D-Plane file for the subtitle to be replaced and select it in the conversion tool. The 3D-Plane file will be created after completing the first step in creating the 3D mkv (see "Create 3D mkv" above). Some mkv's already contain the necessary information, but if it does not, then you need to load the 3D BD with BD3D2MK3D, and check which plane is used for the subtitle to be replaced in tab "2: Select streams".
- Choose the input VobSub IDX/SUB files created with Subtitle Edit, and whether you process subtitles for an SBS or TAB 3D movie. Do not forget to check that the "Source fps" is equal to the one of the movie file, then click "Convert subtitles to 3D...", which will create a sub and an idx file. Copy those to the project folder created by BD3D2MK3D.
- Finally, replace the subtitle information in file "%%__%%MUX_3D_OPTIONS.txt":--track-name
0:Thai 3D (VobSub)
--language
0:tha
--default-track
0:no
--forced-track
0:no
--sync
0:0
--compression
0:none
Avatar_720p.3D.idx
- If you want to add more than one track with subtitles for the same language, use the some 3D Plane for all tracks with the same language. You need only one track from another language to be substituted in the 3D file created by MakeMKV, the other tracks can be added.
- You may re-order the subtitle track information in "%%__%%MUX_3D_OPTIONS.txt" to have the subtitles ordered they way you want in the output mkv.
- Start the command file "%%__%%ENCODE_3D_LAUNCHER.cmd". Keep the output filename proposed by BD3D2MK3D (e.g. "Avatar (2009) 3D-TAB 1080p.mkv"), which will be recongized by Kodi or tinyMediaManager as a 3D mkv file.
===== Subtitles from DVD =====
- Run BD3D2MK3D, then select Subtitle tools -> Open Subtitle stream in BDSup2Sub
- Select Convert resolution to 1080p, leave all other options unselected, click OK
- Set output format to SUP(BD) and File -> Export
- Run BD3D2MK3D, then select Subtitle tools -> Convert Subtitles to 3D with 3D-planes
- Select exported sup file, Output file format: BD SUP (PGS), select output stereoscopy format, 3D-plane file, and click "Convert subtitles to 3D..."
- Copy generated files and folders to 3D movie root and modify __MUX_3D_OPTIONS.json
- Run __ENCODE_3D_LAUNCHER.cmd and check the sync of audio and subtitles
- If necessary, extract the tracks which are not in sync with gMKVExtractGUI.exe, then set necessary delay in ms and multiplex with mkvtoolnix-gui.exe
===== Links =====
* [[https://forum.doom9.org/showthread.php?t=170828|BD3D2MK3D Forum Thread]]
* [[https://forum.doom9.org/showthread.php?p=1742601#post1742601|How to convert 2D SRT subtitles or SUP from another BD to 3D]]
* [[https://www.videohelp.com/software/BD3D2MK3D|BD3D2MK3D Download]]
* [[https://www.videohelp.com/software/Avisynth|Avisynth]]
* [[http://www.afterdawn.com/guides/archive/extract_ac3_or_dts_audio_from_mkv_files.cfm|Extract AC3 or DTS audio from MKV files]]
* [[http://3dvision-blog.com/5520-mkv-file-container-support-for-stereo-3d-video-and-the-mk3d-files/|MKV File Container Support for Stereo 3D Video and the MK3D Files]]
* [[https://sourceforge.net/projects/mkvextractgui-2/?source=typ_redirect|MKVExtractGUI-2]]
* [[https://mkvtoolnix.download/doc/mkvpropedit.html|Modify properties of existing Matroska files without a complete remux]]
==== Subtitles ====
* [[https://www.opensubtitles.org/en/search/subs|OpenSubtitles]]
* [[https://ytssubtitles.com/avatar/tt0499549/123860|YTS Subtitles]]
* [[https://isubtitles.in/g-i-joe-retaliation/thai-subtitles/1022948|isubtitles]]
* [[http://www.thaisubtitle.com/manage/list.php?name=G|Thai Subtitle]]
* [[http://submovie.info/subtitles|Subscene]]
==== Replies to requests ====
* [[https://emby.media/community/index.php?/topic/46865-how-do-you-rip-and-watch-3d-blu-ray-movies/|How do you rip and watch 3D Blu Ray movies]]