Log in

View Full Version : BD3D2MK3D v1.17: Convert 3D BDs or MKV to 3D SBS, T&B or Frame-sequential MKV


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24] 25 26 27 28 29 30 31 32 33 34 35 36

geheim
17th January 2017, 16:01
Note also that BD3D2MK3D offers also another way to be sure that the subtitles do not enter in the objects. When a movie is shot in Cinemascope format, it has large horizontal black borders. In the last tab, you can move the picture up in the screen, and if the bottom border is large enough, the subtitles will appear in that border, beneath the picture. That's not perfect, but it's less unpleasant than subtitles entering the objects. Anyway, it's not a solution when the video is not re-encoded.


I didn't know that, thanks for the info! Could be useful sometimes, many subtitles will be much nicer on the black bars!


Hum, strange. Are you sure that the offset sequences are correctly referenced in the MPLS files? It is not sufficient to attach them to the MVC stream. It is also necessary to link the subtitle stream and the OFS together. You can verify if the links are correct with BD3D2MK3D, or with TSMuxeR (at least when it doesn't have the bug described in a previous post (http://forum.doom9.org/showthread.php?p=1793361#post1793361)).


I can try that again in the next time. It was some time ago that I last tried .ofs with Scenarist and can't really remember if perhaps I did something wrong. I'll Report back once I could look into it again!


But is it really interesting? What will be the benefit of replacing a 3D-Plane in an original MVC stream (supposed to contain already good 3D-Planes) with a constant depth? Without a full 3D-Subtitles editor, that doesn't make much sense.
Adding totally new SEI messages in the MVC stream is also a big challenge. I don't even know if it's the job of the MVC encoder, of the muxer or even of a dedicated application.



Well if we succeed in replacing SEI Messages we would first of all know if there are in deed some checksums applied etc. If just replacing the values works there are None ;) This means we could insert constant depth values in movies which come without subtitle depth.
And then we could also look into inserting the SEI Messages to FRIM Encodes, which could be very useful, because every re-encode now has the Problem of missing depth for the subtitles...
So I think we could learn a bit from this.

r0lZ
21st January 2017, 10:42
So I think we could learn a bit from this.I agree, and I did the test.

I've just replaced all depth values in a short clip with constant values. The original BD has 32-planes, all of them being undefined (containing the value 0x80, meaning "not defined" for all frames of all 3D-Planes). I've replaced plane #0 with constant depth 1, plane #1 with depth 2, and so on up to depth 32. Then I've remuxed the BD with TsMuxeR and assigned planes #5 and #31 to the two subtitle streams. The final ISO can be read without problem with any software player, but that's not surprising, since they don't use the MVC stream. So, I burned the ISO, and my Samsung 3D BD player has played the movie in 3D without problem, and the two subtitle streams are at the right depth. :-)

So, it seems that it is at least possible to replace the existing depth values with other ones without problem. Adding new 3D-Planes to a remuxed MVC is another problem, and I can't and don't want to do that. Perhaps Videofan3D for FRIM? Or Roman if he decides to continue to develop TsMuxeR? Anyway, it's not something to integrate in BD3D2MK3D, that does just the opposite.

geheim
22nd January 2017, 15:03
I agree, and I did the test.

I've just replaced all depth values in a short clip with constant values. The original BD has 32-planes, all of them being undefined (containing the value 0x80, meaning "not defined" for all frames of all 3D-Planes). I've replaced plane #0 with constant depth 1, plane #1 with depth 2, and so on up to depth 32. Then I've remuxed the BD with TsMuxeR and assigned planes #5 and #31 to the two subtitle streams. The final ISO can be read without problem with any software player, but that's not surprising, since they don't use the MVC stream. So, I burned the ISO, and my Samsung 3D BD player has played the movie in 3D without problem, and the two subtitle streams are at the right depth. :-)


So, it seems that it is at least possible to replace the existing depth values with other ones without problem. Adding new 3D-Planes to a remuxed MVC is another problem, and I can't and don't want to do that. Perhaps Videofan3D for FRIM? Or Roman if he decides to continue to develop TsMuxeR? Anyway, it's not something to integrate in BD3D2MK3D, that does just the opposite.


Awesome that you got it working! So how did you do it?? Was it enough to just replace the depth values?? Or was there any checksums etc. which you needed to modify as well??

So, we can definitely add depth to original mvc encoded files, if they have plain subtitles but the correct sei Header, that's something!
Regarding frim encodes: Is the SEI message always stored at the same Offset inside the mvc stream?? Perhaps we could just copy the Header and SEI info from another original mvc file and inject it into a frim-encoded mvc file??

Anyways, I understand that you don't want to look into that issue. Perhaps @videofan3D could take a look into it as we now know that modifying sei message values is definitely possible?? It should be possible to let FRIM insert them correctly as well (or Keep the original depth values intact)! This would be awesome, because it's really the last Thing we cannot do with free Tools regarding 3D Encoding or backups.

Thanks r0lZ for your tests!!

r0lZ
22nd January 2017, 16:06
I've just replaced the depth values, without touching anything else. I have no idea of what should be changed to add new 3D-Planes instead of simply overwriting existing planes, but I know that there must be one SEI message with the 3D-Planes per GOP (hence the different number of frames in many message). IMO, the difficulty is not the SEI message itself or its header (and the content of the 3D-Plane header within the SEI message is more or less known). It is certainly possible to build new messages from scratch, but IMO it is more difficult to know where they have to be inserted in the original MVC stream, and how the MVC stream must be modified if necessary. And that's beyond my knowledge.

Unfortunately, it is impossible to keep the original depth values intact, as you suggest, because the MVC stream is re-encoded by the Intel encoder, and it doesn't have an option to add or copy the 3D-Planes, If it's possible, FRIM will have to analyse the bitstream it receives from the Intel encoder, and add the messages when appropriate. Or just do a second pass to add them afterwards. I really don't know.

Anyway, I did that test just out of curiosity, and in the hope that someone else will be interested in developing something really usable, but as I wrote above, it's not useful for BD3D2MK3D, so that will not be me.

BTW, normally, Scenarist should be able to build a BD with the 3D-Planes. I don't know if it does it correctly, and you wrote that the OFS files saved by BD3D2MK3D are not taken into account, but Scenarist may perhaps be used to add the 3D-Planes to the MVC stream only, and tsMuxeR may still be used for the mux and to build the ISO. That should work. Anyway, currently, it's probably the only solution available to add the 3D-Planes to a re-encoded MVC.

Triple-M
22nd February 2017, 07:49
Hi,

i have not used your program for a while and now i have used it again but the image is too narrow or squeezed. The movie has not the full height, no matter what player i use (Infuse, MrMC or Plex on my AppleTV 4). I don't know what it is or where the problem is. I tried the Fullsize-Option instead of Halfsize-Option but then the image/video is even narrower.

r0lZ
22nd February 2017, 11:38
Hum, I really don't know what could be the cause of the problem, but for Full-SBS or T&B, you should try to play with Settings -> Full-SBS/T&B aspect ratio. However, that options only affect the aspect ratio in "full" mode and should have no impact when using half-SBS or half-T&B. But try it anyway, as it is well known that the correct aspect ratio settings to use are not clearly defined for SBS or T&B and the selected aspect ratio may not be correctly supported by your player or hardware.

For Half-SBS/T&B, the aspect ratio cannot be changed via the GUI because, until now, the settings used by BD3D2MK3D have always worked perfectly with all players and hardware. But you can try to change them manually in the project files before launching the encoding. The following settings may have an impact on the final aspect ratio:

In __ENCODE_3D.cmd:
--sar 1:1
Try with 2:1 or 1:2 for Half-SBS or T&B. You can also try to simply remove this setting from the __ENCODE_3D.cmd file. Without the explicit sample aspect ratio, maybe your player will assume the correct value automatically.
(This setting affects the h264 elementary video stream. That means that you have to re-encode the whole movie if you want to test another value. I suggest to do your tests with a short clip.)

In __MUX_3D_OPTIONS.txt:
--aspect-ratio
0:16/9
IMO, this one should not be changed, but who knows? Try 0:32/9 and 0:16/18.
(This setting is only stored in the MKV header, and therefore you can simply launch __MUX_3D.cmd after having modified it to regenerate the final MKV without having to re-encode the movie. It is also possible to modify that value directly in the MKV with mkvtoolnix (https://mkvtoolnix.download/index.html).)

If you can find a setting that works fine for you, please let me know and I'll add an option to control the required settings in the GUI.

What is the option you have selected for the 3D format? Half-SBS or half-T&B? And can you confirm that the image is squashed by a factor of two (in other words, can you confirm that the image is twice as high or large than it should be? If it's the case, that may mean that indeed, one of the settings above must be changed, although IMO it is the responsibility of the player to handle correctly the aspect ratio of the 3D movies. (It's also why a 3D movie MUST ALWAYS be encoded in full 16:9, without cropping the black borders, as many TVs assume that a 3D movie must always be played full-screen, regardless of the aspect ratios stored in the file. It seems that it's not the case of your AppleTV.)

Triple-M
22nd February 2017, 19:51
I tried to watch the 3D Movie (the mkv, not the Bluray) on my Panasonic 4K UHD Player and there the Movie looks normal. Under the Player MrMC in my Apple TV i can change the Pixel Ratio in the options from 1.00 to 0.50 and then the Movie Looks normal. Sorry i'm no Profi and i don't know what to do.

r0lZ
23rd February 2017, 13:23
So, you have a solution for your Apple TV if you use the MrMC player, and you don't need a modification of BD3D2MK3D. Right?

The problem is that there is no established standard for the aspect ratios of the SBS and T&B frame packings. It is possible to consider that the specified aspect ratio gives the display aspect ratio (DAR) of the original image or the DAR of the target image, and it's very different. In Full-SBS, for example, the original DAR is 32:9, because there are 2 images side by side (3840x1080 pixels), but when the movie is played, the original image is split in two 16:9 views (1920x1080 pixels each). In Full-SBS, the sample aspect ratio (SAR) is 1:1 for the original and target images. In the other hand, for the Half-SBS mode, the DAR of the original and target images are 16:9, but it's different for the SAR, since the image must be stretched horizontally. Unfortunately, due to the lack of a well established standard, the player is free to consider that the DAR and/or SAR are specified for the original or target image, and there is no good solution for BD3D2MK3D. It's why there is an option in BD3D2MK3D, but currently only for the two Full modes because I have never needed to specify different aspect ratios in Half-SBS or Half-T&B. Since your MrMC player allows you to overwrite the SAR manually with a pixel aspect ratio (PAR), it is open to the two solutions, but you should encode the best SAR and DAR anyway. But take care! As you know now, it's not because a specific combination of SAR and DAR values works fine with a specific player that it will work correctly with all players.

BTW, I forgot to explain that you can also remove completely the "--sar 1:1" option in __ENCODE_3D.cmd. If I remember correctly, old versions of BD3D2MK3D did not specify that parameter at all, and that may be what you need to let the player deduce the SAR from the specified PAR in the MKV header. If the problem of the wrong aspect ratio has appeared recently and is not due to a change in your hardware or software, that may be the best solution. Try it! But I don't know if the SAR is forced by x264 or x265 to 1:1 anyway when it is not specified explicitly, and therefore I don't know if removing that argument will have a real effect.

Note also that most players will take only one of the two specified aspect ratios into account. If, say, the 1:1 SAR works fine with a specific player, you may have to check the different possibilities of the DAR with the other players. You have to experiment to find the best solution for your player(s). And remember that I can modify BD3D2MK3D if you need different parameters for the SAR and/or DAR in Half-SBS or Half-T&B modes.

Triple-M
23rd February 2017, 13:32
Between the first use of your software an today, i changed the TV from Sony to Panasonic. Perhaps thats the "Problem"?

r0lZ
23rd February 2017, 13:37
Perhaps, indeed. I don't know if the Panasonic TVs handle the aspect ratios of the 3D movies differently than the vast majority of the players, but that may be the case. Or is it a setting to change that behaviour in the Panasonic TV?

Triple-M
23rd February 2017, 13:43
I don't know what you mean, there is only 3D on/off and Side-by-Side or Top-Bottem as Option. The UHD Player from Panasonic plays the Movie also correct and normal.

r0lZ
23rd February 2017, 14:03
Well, you told me this:
Under the Player MrMC in my Apple TV i can change the Pixel Ratio in the options from 1.00 to 0.50 and then the Movie Looks normal.
Perhaps there is a similar option in the settings of your Panasonic TV. Or something to tell it to always display the 3D movies in full screen (16:9)? That's what my Samsung TV does anyway.

The 3D button on the remote is only used to switch the 3D mode on or off, or to select the correct SBS or T&B mode of movies that are encoded without the right information. (That button should be useless with 3D movies encoded with BD3D2MK3D, because the info is encoded in the MKV file, and should be recognised by a good 3D TV.) Anyway, recognising that a movie is in 3D is not sufficient to display it with the correct aspect ratio. It's why there is perhaps another option somewhere, although I have never seen that in hardware players or 3D TVs. Since your TV seems to be different than the vast majority of the players, it may have that option, but of course, I can't be sure.

Triple-M
23rd February 2017, 14:14
Ok i look but i thing there is nothing. My TV doesn't recognize that a 3D Movie is playing. The Sony does so but the Panasonic not. I have tried 3D or SBS in the filename but the TV doesn't recognize this and switch to 3D. Only when i play a 3D BluRay in the UHD-Player the TV switch to 3D Mode.

Triple-M
23rd February 2017, 20:44
There is no Option in the TV. I tried a little bit more and under the Plex Client the movie is normal hight if i deactivate the subtitle. If i activate the subtitle again, the movie squeezes. Is this a bug in Plex oder a problem with the file i encoded?

r0lZ
23rd February 2017, 21:26
It seems that it's a bug in Plex. Or do you combine full-SBS with half-SBS subtitles?

Triple-M
24th February 2017, 08:26
No i use only half-SBS.

r0lZ
24th February 2017, 09:25
Then it's certainly a Plex bug.

r0lZ
28th February 2017, 10:42
This version contains mainly a relatively important bug fix, and some improvements.
v0.99 (February 28, 2017)
- Bug fix: The filter of the MPLS files to show crashed when comparing the number of 3D-Planes of two MPLS if one of them has no 3D-Plane.
- Added Settings -> MVC Decoder -> Hardware acceleration -> Online list of Intel CPUs supporting QuickSync (hardware acceleration for MVC decoding)
- Improved the paste operations (Control-V) in tab 3: Title & tags, when there are several lines in the clipboard.
- The BD3D2MK3D.log file is now included as an attachment in the final MKV file.
- Tools -> Chapters File Converter can now also load basic files with one timecode per line (tsMuxeR format)
- Updated the Mkvtoolnix exes to the latest version (v9.9.0)
- Updated the x265 exes to the latest version (v2.3+7 or v2.3+9)

Enjoy!

Download: BD3D2MK3D.7z (http://download.videohelp.com/r0lZ/BD3D2AVS/BD3D2MK3D.7z)

r0lZ
4th March 2017, 11:19
Sorry, I've introduced a bug in the last version. This is the fix.
v0.100 (March 3, 2017)
- Bug introduced in v0.99: Error when pasting in some fields of the Title & Tags tab.

Download: BD3D2MK3D.7z (http://download.videohelp.com/r0lZ/BD3D2AVS/BD3D2MK3D.7z)

Araldwenn
10th April 2017, 11:46
Hi,

I'd like to simply convert an MVC bluray to FullSBS, without re-encoding it (well, in fact, I want it to be lossless).
Is BD3D2MK3D the right tool, ans if yes, how should I set it in order to do that ?

robl45
10th April 2017, 12:21
Hi,

I'd like to simply convert an MVC bluray to FullSBS, without re-encoding it (well, in fact, I want it to be lossless).
Is BD3D2MK3D the right tool, ans if yes, how should I tweak it in order to do that ?

I gotta ask why you would want to convert to the least compatible format Of all?

r0lZ
10th April 2017, 13:34
Good question, robl45!

And I add that you cannot make a full-SBS without re-encoding, because the native BD3D format is AVC+MVC (two video streams encoded differently), and the format of Full-SBS is a single stream (with the two views side by side) encoded in pure AVC (or another format such as HEVC). Therefore, no, BD3D2MK3D cannot do that, but what you want cannot be done, with BD3D2MK3D or any other tool.

You can however re-encode with any CRF value, including CRF 0, meaning lossless. But the output file will be MUCH larger than the original BD, and you will probably be unable to store the final MKV on a standard HDD! Is it really what you want?

Note also that with a reasonable CRF value (say around 20), you will probably be unable to see the difference with the original (unless you use comparison tools to highlight the differences). Why do you want to waste disc space for a supposed high quality that your eyes are unable to see?

If you really want to keep the original video streams without re-encoding them, try MakeMKV. It can store the AVC and MVC streams in a single MKV, but only one or two software players are currently able to play the generated video in 3D. And of course, it's not Full-SBS. IMO, that solution is roughly equivalent to doing a backup of the original movie, but without a real possibility to watch it.

Araldwenn
10th April 2017, 13:59
That's the problem. There's no free video player that allows me to read mvc videos (stereoscopic player does it very well, but it's not free). I actually use sView, which works perfectly with full SBS videos, but doesn't work with those made with MakeMKV.
Well, then, I haven't encoded any movie for a long time, and I used to make a 2 pass encoding.
I see there is many other options to choose (CRF, CQ, 2 pass, ABR). Which one should I use to have the best quality with a decent file size, I mean something about 15/20 Gb ?

robl45
10th April 2017, 14:48
Kodi has version that plays mvc as well as mad vr with lav filters through mpc. I been using the latter for months now

That's the problem. There's no free video player that allows me to read mvc videos (stereoscopic player does it very well, but it's not free). I actually use sView, which works perfectly with full SBS videos, but doesn't work with those made with MakeMKV.
Well, then, I haven't encoded any movie for a long time, and I used to make a 2 pass encoding.
I see there is many other options to choose (CRF, CQ, 2 pass, ABR). Which one should I use to have the best quality with a decent file size, I mean something about 15/20 Gb ?

r0lZ
10th April 2017, 15:49
I see there is many other options to choose (CRF, CQ, 2 pass, ABR). Which one should I use to have the best quality with a decent file size, I mean something about 15/20 Gb ?Personally, I prefer CRF, that gives ALWAYS a better result than 2-pass for the same global bitrate. But with CRF, it is not easy to predict (even approximately) the resulting file size, because it compresses much more the "easy" movies such as the Pixar films in computer graphics than the "difficult" ones like the live action films of the 80's, or the old 3D movies of the 50's with much noise. That's normal, because CRF adapts automatically its compression to the image, something that doesn't do 2-pass or, of course, ABR (= 1-pass). CRF is also better than CQ because it compresses more the blurred part of the images with fast action (motion blur), because it is impossible for the human eye to distinguish the loss of quality in moving images (unless you press the pause button, of course). It has therefore more bitrate to spend for the slow or static images, where small defects are more visible. CRF is therefore the more intelligent way to encode a video, and I don't understand why peoples continue to use 2-pass. (2-pass should be used ONLY when the final file size must be precisely controlled, like when you encode to put the movie on a DVD.)

The CRF value to use is another question. IMO, the default value of 23 is a good compromise between quality and disc space, but I prefer to use 20 for movies where the image quality matters much (like Sin City 2). However, even with CRF 20, you will never obtain a 20GB file. That's way too high IMO. Don't forget that the huge file sizes of the commercial BDs are so high simply for commercial reasons. A movie (with 1 AC3 audio stream) can be perfectly encoded with 4 to 8 GB, depending of the "difficulty" to encode it and its length. More than 10 GB is IMO total nonsense. You cannot see the difference with the same movie encoded at 8 or even 6 GB. Try it. Encode two movies with, say, CRF 20 and CRF 12, and ask a friend to show you both of them in random order. I'm sure you will not see what is what.

Anyway, you are free to use any CRF value. It is often explained that subtracting 3 to the CRF value has roughly the effect of doubling the size of the video stream. It's not really accurate, but take that in mind when you will try different values. (So, for example, CRF 10 may produce a video stream about 10 times larger than CRF 20, for an almost imperceptible visual improvement. But similarly, using CRF 26 may produce a really bad quality.)

Trust your eyes ONLY, and don't try to encode at a specific bitrate.

And, to reply to your initial question, if you re-encode in Full-SBS, then BD3D2MK3D is the tool to use! ;-)

Araldwenn
10th April 2017, 16:52
Thanks a lot for your clear answer :thanks:

And what about presets and tune ? Do they have a big impact on encoding ? I've got a decent CPU (i7 3930k @4.6 Ghz).

r0lZ
11th April 2017, 08:42
I don't use the tune (except sometimes PSNR or SSIM, when I want to measure the quality of the encoding). IMO, they are useless and often misleading. But I'm not an expert in encoding. Perhaps some of them are really useful in specific circumstances.

The presets have a big incidence on the quality and file size (and on the time necessary for the encoding). It is not easy to understand exactly what they do, because they change a lot of internal settings, and without knowing what settings are modified and how, and without knowing the specific advantages of each of these settings, selecting a different preset is mainly a blind operation. But it is clear that globally, choosing a slower preset compresses more for a quality approximately equivalent. But with the slower, very slow or placebo presets, I have noticed that my TV has some trouble when it decodes some sequences, and the playback may become somewhat jerky. For that reason, I prefer to use the slow preset. Placebo is also extremely slow, even with a powerful CPU! (If you encode in h265, all presets are also much slower!)

Note also that changing the preset may (and will) modify the level (if you don't force it). My TV doesn't support a level greater than 4.2, and if I use a slow preset, I need also to force the level to 4.1 or 4.2. Of course, if the level is restricted, the settings of the preset are modified and you cannot take advantage of its full power. It's another reason to not use a too slow preset. (Level 4.1 is the level used on the blu-ray discs, and is therefore well supported by the vast majority of the hardware players. Levels 5.0 and greater are for the ultra-HD resolutions and full-SBS or full-T&B. Of course, if you encode in Full-SBS, you will need at least level 5.0, and therefore you can use a very slow preset. But be sure that your hardware supports it!)

You can also specify specific settings in the "additional options" field, to modify the default settings of the selected preset and build your own preset. But that requires much knowledge, and if you are really interested in experimenting with the x264 options, I suggest to join the x264 encoding forum. Personally, I trust the authors of the x264 encoder, and I use the presets without trying to modify them much.

Sharc
11th April 2017, 09:51
.... But with the slower, very slow or placebo presets, I have noticed that my TV has some trouble when it decodes some sequences, and the playback may become somewhat jerky. For that reason, I prefer to use the slow preset....
Just a sidenote: In my experience it is good practice to add --bluray-compat to the x264 commandline. It may overwrite some of the more stringent settings of the --preset selection with more relaxed settings, but it definitely reduces the risk of playback issues.

r0lZ
11th April 2017, 10:43
Yes, I agree, although I don't use that option. And, of course, it is not compatible with Full-SBS, that cannot be encoded in level 4.1 and therefore cannot be BD compatible.

BTW, BD3D2MK3D has the option "BD compatible" that just enforces that --bluray-compat option (and disables some other incompatible options). Of course, that option is not available if you encode with x265, because HEVC is not BD compatible anyway.

tebasuna51
11th April 2017, 12:30
About x264 Presets, etc.

I don't use the tune... Perhaps some of them are really useful in specific circumstances.

--tune film
Equivalent to --deblock -1:-1 --psy-rd 1.0:0.15
Can improve the quality with a little more bitrate needed.
Recommended for dark movies or with flat colours.

The presets... globally, choosing a slower preset compresses more for a quality approximately equivalent.

That is true. Here is a table with the more important parameters changed by presets:
defect
Param./Preset medium slow slower veryslow placebo
-------------- -------- -------- -------- -------- -------
bframes 3 - - 8 16
ref 3 5 8 16 16
b-adapt 1 (fast) - 2 (optim) 2 2
direct spatial auto auto auto auto
me hex - umh umh tesa
merange 16 - - 24 24
subme 7 8 9 10 10
trellis 1 (on MB) 2 (on all) 2 2 2
rc-lookahead 40 50 60 60 60
partitions def.(113) - all (133) all all
no-fast-pskip - - - - yes
slow-firstpass no - - - yes

The two first (B-frames and Ref-frames) are important in order to player compatibility. See the Level after.

The rest improve the source analysis and reduce bitrate (not much) for the same quality CRF selected. The cost is increasing the encoder time.

But with the slower, very slow or placebo presets, I have noticed that my TV has some trouble when it decodes some sequences, ... My TV doesn't support a level greater than 4.2

Even some TV's or cheap standalone players are only certified for DivX Plus with Level 4.0 and max B-frames 3 like big limitations.

In order to understand the problem read the Levels and Decoded picture buffering parts in https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC

You can see than in 4.0, 4.1 or 4.2 the max Ref-frames for a full 1920x1080 image is 4. For a cropped image 1920x800 you can use maybe 5 Ref-frames but not more.

Then the Slow Preset is in the limit about this, and is recommended the parameter --level 4.1 (or 4.0 or 4.2 at your choice) to limit x264 about vbv_bufsize (also limit vbv_maxrate but is not a problem normally with CRF 20).

If you want use a *slow* preset don't forget limit B and Ref frames or use the --level parameter.

tebasuna51
11th April 2017, 12:52
Yes, I agree, although I don't use that option. And, of course, it is not compatible with Full-SBS, that cannot be encoded in level 4.1 and therefore cannot be BD compatible.

What is the problem for --level 4.1?

AFAIK the parameters needed to use the h264 to burn a BD are:
--weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 24 --b-pyramid strict --slices 4 --aud

Where:
--weightp 0 --nal-hrd vbr --keyint 24 --b-pyramid strict --slices 4 --aud

are not needed for standard mkv players.

Sharc
11th April 2017, 13:25
What is the problem for --level 4.1?

AFAIK the width of full-SBS (2x1920) exceeds level 4.1 specification.

tebasuna51
11th April 2017, 13:32
Ok. I don't see the 'full' (2x1920)

r0lZ
11th April 2017, 13:46
If you want use a *slow* preset don't forget limit B and Ref frames or use the --level parameter.
The problem with the --level parameter (in clear builds of x264) is that it does ABSOLUTELY NOTHING, except flagging the stream with the specified level. It doesn't reduce the bitrate or the buffer size. IMO, it's a huge bug in the design of x264, but some users or programmers wanted to be able to flag the video stream with an inexact level! Really bizarre (or can I say stupid?) decision! Especially because the documentation and the output of the --full-help argument doesn't specify that, and is therefore totally misleading.

So, if you want to really change the level, you have to specify the --level AND the corresponding --vbv-bufsize and --vbv-maxrate parameters, and of course you must know the values for these parameters. It is NOT sufficient to specify the level alone. There are builds made by smart peoples with that bug fixed, but they are not always easy to find, and sometimes outdated. But if you use BD3D2MK3D, you don't have to worry, because it specifies the required parameters automatically if you force a specific level.

r0lZ
11th April 2017, 13:48
What is the problem for --level 4.1?In Full-SBS or Full-T&B, the image is twice as large as the standard HD image, and requires larger buffers. Therefore, level 4.1 is not sufficient, due to the limitation of the buffer size.

[EDIT] Sorry, I've replied before I've read the reply by Sharc. He is right.

frank
18th April 2017, 16:35
If you convert a chapter.xml (mkvtoolnix) into ogm then you get after decimal point a mismatch of 0 in some cases.

Example for chapter 02:
<ChapterTimeStart>00:00:10.040000000</ChapterTimeStart>

result is
CHAPTER02=00:00:10.004

and not
CHAPTER02=00:00:10.040

BTW: Please correct the version number in your first post to v0.100.

r0lZ
19th April 2017, 09:38
Right, as always! Thanks, Frank!
Here is the fix, as well as a few other little fixes.

With this version, I have decided to abandon the 0.XXX series, and go officially to v1.0. IMO, BD3D2MK3D is now stable enough (although there will probably be still some hidden bugs to fix), and I don't think I'll add important new features.

v1.0 (April 19, 2017)
- The 2D Playlists window is now closed when the main job starts
- Fixed the bug when pasting in Actors field of the Title & Tags tab: An additional \n was added
- Small improvements in the Title & Tags tab.
- Bug in Chapters file converter: The decimal part of the time code was sometimes wrong when converting from a Matroska XML chapter file. Thanks Frank!
- Updated ImageMagick's convert.exe to the latest version (v7.0.5-4)
- Updated the Mkvtoolnix exes to the latest version (v10.0.0)
- Updated libdcadec.dll (part of eac3to) to the latest version (v0.2.0)
- Updated the x265 exes to the latest version (v2.3+32)

As always, you can download BD3D2MK3D here: BD3D2MK3D.7z (http://download.videohelp.com/r0lZ/BD3D2AVS/BD3D2MK3D.7z)

frank
20th April 2017, 04:17
Well done. Many thanks! :)

Don't forget updating version number...

r0lZ
20th April 2017, 08:29
Don't forget updating version number...Done. :rolleyes:

o0okaro0o
8th June 2017, 19:46
Hi, I was wondering if you could port BD3D2MK3D to x64 or at least the dlls loadhelper.dll, DGMVCDecode.dll and libmfxsw32.dll so we could use it in an x64 environment.
Thanks for your time.

r0lZ
9th June 2017, 09:23
Welcome to the Doom9 forums, o0okaro0o!

Well, it is already possible to use x264 or x265 64-bit during the encoding process, thanks to avs2yuv.exe. See the "Use 64-bit x264/x265..." option in the last tab to enable that feature. (It should be enabled by default if BD3D2MK3D has correctly detected your 64-bit CPU.)

The fact that BD3D2MK3D itself is a 32-bit app is not a brake. BD3D2MK3D is used only to demux the original streams and prepare a few files, and that doesn't require much CPU power. The speed of the disc is the only real brake during the preparation of the project. (I agree however that it should be possible to speed up the encoding of the subtitles to 3D and the conversion of the audio streams to AC3 or AAC with 64-bit version of the tools used during that conversions, but honestly, I don't think that the time spent during that conversions is really important.)

It is true that it is not possible to use avisynth 64-bit to convert the original MVC video stream to SBS, T&B or FS. It's mainly because the two MVC decoders that BD3D2MK3D can use are 32-bit avisynth filters and I haven't programmed them myself. But it's also because after having made some tests, I don't think that it will be possible to really speed up the decoding process with avisynth 64-bit. Note also that all 64-bit versions of avisynth are still somewhat unstable (and unofficial), and honestly I don't want to have to add workarounds for the problems that will certainly occur. The 32-bit avisynth works perfectly and is fast enough, given the fact that it's mainly the x264 or x265 encoder that requires much CPU power.

If you really want to decode faster, be sure to use a computer with an Intel CPU supporting QuickSync (https://ark.intel.com/Search/FeatureFilter?productType=processors&QuickSyncVideo=true) and install the latest Intel drivers. And of course, tick the "Use 64-bit x264" option in the last tab. But you will be probably disappointed. The speed gain is marginal.

Note also that the libmfxsw32.dll included with BD3D2MK3D is used only if you don't have an Intel CPU with QuickSync or if the Intel drivers are not properly installed. When QuickSync is available, it's the libmfxsw32.dll included with the Intel drivers that is used, and that version uses the full power of the CPU and QuickSync. It is not the responsibility of BD3D2MK3D to install or distribute the hardware dependent version of libmfxsw32.dll.

Sorry, but I will not modify BD3D2MK3D to use avisynth 64-bit or other 64-bit external tools for a very minimal speed increase but with a great risk of instability. And anyway, currently, it's not possible, since the avisynth filters needed and a lot of external tools are 32-bit only.

o0okaro0o
9th June 2017, 10:34
thanks r0lZ fo asnwering.
I just wanted to import the __ENCODE_3D_MOVIE.avs into megui to do the encoding from there but since I use the x64 and avisynth x64, I cannot import it because the dlls are x86 only.
I was just wondering if it was possible but donŽt worry, IŽll carry on doing like I used to.
Thanks for your time and your great work.

tebasuna51
9th June 2017, 10:50
In my test recoding video I obtain a speed gain of 14% when I use a full chain 64 bits over a chain 32 bits.
Of course when I have all plugins needed in the 2 versions.

Most of this gain (9%) is due to the encoder, than is already a selection in BD3D2MK3D.

Then only a 5% of speed gain may be possible if we have all the components at 64 bits, but here is not possible like r0lZ say.

r0lZ
9th June 2017, 11:10
I just wanted to import the __ENCODE_3D_MOVIE.avs into megui to do the encoding from there but since I use the x64 and avisynth x64, I cannot import it because the dlls are x86 only.
I'm not familiar with megui, but perhaps there is an option to use the 32-bit avisynth?

And anyway, I wonder what is the advantage of using megui to encode the avs script. You may have more x264/x265 options available than in BD3D2MK3D, but remember that you can add your own options in the Additional options field of the last tab of BD3D2MK3D.

Thanks for your thanks! ;-)

@tebasuna51: Thanks for your benchmark results. That confirms my approximative measurements.

frank
21st June 2017, 14:04
For users with NVIDIA graphics here some news:
You really can speed-up the encoding process with ffmpeg.exe and hardware encoding! Quality is now very good.

- Copy latest ffmpeg.exe (v3.3.1 32bit Zeranoe) into B3D2MK3D's toolset folder.
- Edit the generated __ENCODE_3D:
...
ffmpeg.exe -loglevel info -i "__ENCODE_3D_MOVIE.avs" ^
-c:v h264_nvenc -profile:v high -level 4.0 ^
-maxrate 15M -bufsize 15M -b:v 15M -cq 25 ^
-g 48 -bf 3 -rc vbr -rc-lookahead 20 -spatial-aq 1 -bluray-compat 1 ^
-color_primaries bt709 -colorspace bt709 -color_trc bt709 ^
-c:a copy -frames:v nnnnn ^
-metadata Title="movietitle 3D" ^
"00xxx_3D.264" -y
The NVIDIA hw encoder cannot place the frame-packing info into the stream. But the mkv muxer makes the stereo-mode entry and it works in 3D.
You will get about 100 fps!!! (Previously only 24 fps)
Have fun!
_____________
Dell XPS 15 9560, i7-7700HQ, GFX630, GTX1050, Toshiba NVMe SSD 256GB, Win10 Pro

r0lZ
21st June 2017, 14:12
Thanks for the info. Maybe I'll implement that in a future version, but honestly, I'm not sure.

tomilein
27th June 2017, 08:39
Hello, i use BD3D2MK3D -V1.0 for a 3d BluRay and the Programm works great.

I have one Question.

I will cutting and joining the 3D Movie, how i do that?

What I have to change or add in the__ENCODE_3D_MOVIE.avs?

Cutframes are (339, 161707) + (165006, 166805).

Opening credits, final credits i will cut this.

But after the final Credits come another 3 minutes of the 3D Movie.

I will merge the 3 Minutes to the main film without final credits.

Thanks and sorry for my bad Englisch.

r0lZ
27th June 2017, 10:21
It is difficult, if not impossible, to cut the movie before encoding it, because the MVC decoders do not support seeking. You MUST therefore encode everything. (The only thing that you can easily do is limit the total number of frames, and therefore cut the end of the movie, but you cannot easily cut something in the middle during the encoding to 3D-SBS or T&B.) Furthermore, you have to cut the audio, subtitles and chapters too, so cutting the video is not sufficient.

IMO, the easiest way to cut the movie at more or less precise points is the split feature of MkvMerge. Here is the explanation of the method. Since you know already the frame numbers where the movie must be cut, I will not explain how to find them.


Begin by creating a BD3D2MK3D project for your movie. Do not encode it immediately.

Here, you should determine exactly the frame numbers and time codes of the parts you want to cut. You know them already.

Edit the file "chapters_3D.qpfile" (in the project directory) with notepad. That file contains the frame numbers of the beginnings of all chapters. Verify if the frame numbers of your cut points are in that file, and if it's not the case, add them at the right places, followed by a space and the letter i in upper case. (The frame numbers must be in increasing order, one per line!) This will force x264 to create an I-frame at the specified frames. Since you can cut the video only at i-frames, it's important for precise cut points. But as I wrote above, you can omit this part, and hope that the final cut points will be approximately where you want them, if you don't know the exact frame numbers.

You can now encode the 3D movie normally by launching __ENCODE_3D_LAUNCHER.cmd as usual. The whole movie will be encoded, and the complete MKV will be created.

When the final 3D MKV has been created, open it in the MkvToolnix GUI (https://mkvtoolnix.download/downloads.html#windows). Go to the Multiplexer -> Output tab, and enable Splitting by selecting the split mode "After specific timecodes". In the Timecodes field, adds the timecodes of your cut points, separated by comas. You need the time codes here, not the frame numbers! But you can compute them easily by dividing the frame numbers by 24/1.001. There are several syntax for the time codes, but usually I prefer to specify them as a number of ms. In your case, you can use: 14139ms,6744529ms,6882125ms,6957158ms . Leave the Maximum number of files to "Unlimited".

Then, remux the MKV by clicking the "Start multiplexing" button. Several MKV files will be created.

When it's finished, play each file to verify if the cut points are at the right positions, and delete the parts you don't need (the credits). If some cut points are not perfect, you can try to change slightly the time codes and go back to step 5, but if you have not specified the I frames of the cut points in the qpfile, you may not be able to cut exactly where you want.

Finally, relaunch MkvToolnixGUI, and drag and drop the first part of the movie on its window. Then, drag and drop the second part, and when prompted, select the option "append to an existing source frame". Do this for all parts that must be present in the final MKV.

When all parts you want to keep have been added that way, change the output file name, and launch the multiplexing. The final file will be created, with only the parts you want.

That seems complex, but in fact, it's really simple, and IMO it's the best way to do what you want. There may be other methods (such as using commercial programs like VideoReDo (http://www.videoredo.com/en/index.htm)) but they are not free or not as precise as the method I've explained here.

Good luck!

tebasuna51
27th June 2017, 11:55
5. When the final 3D MKV has been created, open it in the MkvToolnix GUI. Go to the Multiplexer -> Output tab, and enable Splitting by selecting the split mode "After specific timecodes". In the Timecodes field, adds the timecodes of your cut points, separated by comas. You need the time codes here, not the frame numbers! But you can compute them easily by dividing the frame numbers by 24/1.001. There are several syntax for the time codes, but usually I prefer to specify them as a number of ms. In your case, you can use: 14139ms,6744529ms,6882125ms,6957158ms . Leave the Maximum number of files to "Unlimited".

There are also the split mode "By parts based in timecodes" and, with the following sintax, you obtain a single output file already joined:

14139ms-6744571ms,+6882125ms-6957200ms

If your desired cut is in avs Trim() format the last frame is also included, and the ms cut must include it.

r0lZ
27th June 2017, 13:07
I didn't know that possibility. It's great! Thanks!