Encoding to mkv files with BD Rebuilder

vbimport

#1

Starting with a discussion in the Intel P67/SandyBridge thread, I thought I might explore BD Rebuilder’s abilities to convert blu ray into compressed .mkv files. The Sandybridge processors have incredible speed and we are just beginning to see their potential in video encoding, but I thought my AMD 6 core machine could probably do a decent job. I was not expecting the results I got however.

Normally I compress large blu ray movies to fit 25gb Blu ray disks and use the BD 25 High speed option. It still takes 4 to 6 hrs in general to do this task, and varies according to the size of the original, the original codecs used, amount of action, etc. Each movie is slightly different of course.

In the discussion, Dee mentioned using Ripbot264 and encoding to a mkv of slightly less than 10gb. It took 3hrs 12 minutes in her new SandyBridge machine. As a very rough comparison, I tried to match her input and output sizes using BD Rebuilder. Different movie, so not anywhere near an apples to apples comparison, but this is just an informal test.

So, using a 28.64gb main movie input, (within a mounted ISO), I set BD Rebuilder to make a 1080p .mkv file using CRF encoding and the default quality setting of 20. Encoding was finished in 1hr 45 minutes. :eek: By the way, Dee later matched this speed with her machine using the same input settings in BD Rebuilder.

The results were very good, and it is hard to choose between it and the original. Output size was 9.44gb. I took a couple of screen shots which can be seen here:

MKV w/CRF encoding

Original

I then tried a 2 pass encode to mkv with BD Rebuilder, trying for a similar output size. It came out as 9.6gb, using 11000 kbps. Encoding time was almost exactly 3hrs.

MKV w/Two pass encoding

These encoding times are quite good compared to what I’ve experienced using Handbrake. I haven’t tried Ripbot264 on this machine. The CRF encode seems just as good as the 2 pass. CRF encoding is generally unpredictable in size, but if you can live with that, the speed increase here may be worth it.


#2

Thanks for running these tests :bow:

I’m very interested :iagree:


#3

Interesting stuff Kerry.

There’s a slight softening or smoothing of the grain in the CRF version.

CRF is unpredictable though as sometimes the sample taken by BD Rebuilder isn’t representative of the entire movie.

Or in other words sometimes the re-encoding is done with less than ideal parameters.

The two pass version is superb as even the grain has been preserved and it’s pretty much identical to the original.

If it’s that hard to tell from stills I reckon when you watch the two pass version it’ll appear identical to the original.

[B]Wombler[/B]


#4

Here is the latest entry. I tried to encode the same movie to a 1080p .mkv format, this time using Handbrake. This is a 2 pass encode, using 11000 kbps, just as in BD Rebuilder. I tried to set it up as closely as I could to the previous encoding.

[Two Pass Handbrake encode](http://upload.cdfreaks.com/Kerry56/Handbrake encoded.png)

Using Handbrake took 5hrs and 47 minutes. I don’t see any advantage in the output. It was also 9.6gb in size if anyone is interested.


#5

For anyone looking in who understands the commands sent to X264, here they are for the 2 pass encodes:

First Handbrake: cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=9 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=2 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=0 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=11000 / ratetol=1.0 / qcomp=0.60 / qpmin=3 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00

Now BD Rebuilder: cabac=1 / ref=1 / deblock=0:0:0 / analyse=0:0 / me=dia / subme=0 / psy=1 / psy_rd=0.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=9 / sliced_threads=0 / slices=4 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=0 / b_bias=0 / direct=1 / weightb=0 / open_gop=2 / weightp=1 / keyint=24 /
keyint_min=1 / scenecut=0 / intra_refresh=0 / rc_lookahead=0 / rc=2pass / mbtree=0 / bitrate=11000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=35000 / vbv_bufsize=30000 /
nal_hrd=vbr / ip_ratio=1.10 / pb_ratio=1.10 / aq=0

Some of these are interesting choices:
BD Rebuilder using diamond motion estimation instead of the default (and superior) hexagonal.
No subpixel estimation by Rebuilder
Different handling of B frames by the two programs
Very different settings for keyframe intervals.
Handbrake uses rc_lookahead, which slows it down a bit.
Handbrake uses Adaptive Quantization mode, BDR doesn’t

Putting most of this together, Handbrake is shooting for a higher quality output, and is taking much longer to do it. The problem of course, is that watching the actual video doesn’t show much, if any difference between them. :slight_smile:


#6

Wow that is so so close I had to spend a while looking at the different stills.

Both the BD Rebuilder two pass version and the Handbrake version are really close to the original.

Of the two though, the BD Rebuilder two pass is very very slightly softer than the Handbrake version and the Handbrake version is very very slightly closer to the original but there’s so so little in this that it would be impossible to notice during playback.

I had to flick backwards and forwards continuously between the stills before I could notice any difference in them at all.

[B]Wombler[/B]


#7

Your CPU is spending quite a bit of it’s CPU time decoding the BluRay video which is essentially wasted CPU time when a nVidia graphics card can be used to assist the decoding and free up quite a bit of CPU time. That means a fairly significant speed up. But you would need a nVidia Gfx card and DGDecodeNV and it’s not all point and click as it takes some manual setup.

If you play the BluRay on your PC without graphics card assisted decoding, how much CPU time does the media player use? The encoding using GPU decoding assistance would likely to have approx that kind of speed up. But make sure that your Gfx card isn’t already assisting with decoding when playing back as it’s fairly common and it will distort the CPU requirement for BluRay decoding. GPU assisting Playing back and assisted decoding when encoding are very different things.

AVISynth 2.6 is much more optimized than the more common v2.5.8 and shows significant speed ups when encoding. Those appz are almost certain to use AVISynth when encoding, Handbrake does and I think that BD Rebuilder will also use it as most such freeware uses AVISynth even if you don’t see it.

But v2.6 is an alpha build so does have some bugs in it. It can be tested by downloading the Avisynth.dll and replacing the v2.5.8 build temporarily in Windows\System32 to allow testing the speed. Might be worth a shot. :wink:


#8

Not a good idea to replace AviSynth for BD Rebuilder. Too many bug reports come in from using the “wrong” version. The author really discourages this.

And I have an ATI card…no gpu encoding for me. I don’t know of anyone who recommends Avivo.


#9

Apologies if I missed it, but what quality setting did you use for your 2 pass test in BD Rebuilder?


#10

Good question Stereodude. I believe that was on the Good quality setting, which is obviously the least demanding setting and results in the lowest quality output. Not that I can see much difference in it and the original. Going to the default High Quality setting is resulting in encoding times very similar to Handbrake.

Looking at the encoding settings in the CRF vs the fast 2 pass encode, the only differences are rc=2pass vs rc=crf (and the corresponding settings for using crf or 11000kbps bitrate). I am trying a High Quality encode now and I suspect many of the x264 commands will be similar to Handbrake’s default.

Handbrake has the advantage of letting you adjust these in the Advanced encoder settings. BD Rebuilder lets you fly blind as far as I can tell. But the results have been quite good no matter which program I’ve used with the x264 encoder. A movie with more action might show more differences, since the low quality settings seem to sacrifice motion estimation quite a lot.


#11

[QUOTE=Wombler;2571126]Of the two though, the BD Rebuilder two pass is very very slightly softer than the Handbrake version and the Handbrake version is very very slightly closer to the original but there’s so so little in this that it would be impossible to notice during playback.[/QUOTE]I didn’t think the difference between the BD Rebuilder 2-pass and the Handbreak version was that slight, but to each his own.

I like to mathematically subtract the compressed version from the original, do a high pass filter on the result and then enhance the contrast to see how they differ. :iagree:


#12

[QUOTE=Kerry56;2570828]The Sandybridge processors have incredible speed and we are just beginning to see their potential in video encoding, but I thought my AMD 6 core machine could probably do a decent job. I was not expecting the results I got however.[/QUOTE]How fast are you running your 6 core AMD machine?

How many FPS do you get using the [I]Highest[/I] quality option for pass 1 and pass 2?

Here’s the details on the movie I used (was already a movie only BD via ClownBD)

  • AR: 2.35:1
  • Input BD size: 29.71 GB
  • Approximate total content: [01:59:36.842]
  • Target BD size: 22.95 GB
  • Windows Version: 5.1 [2600]
  • MOVIE-ONLY mode enabled
  • Quality: Highest (Very Slow), Two Pass
  • Audio Settings: AC3=0 DTS=0 HD=1 Kbs=640
  • Source Video: MPEG-4 (AVC), 1920x1080
  • Rate/Length: 23.976fps, 172,072 frames
  • Bitrate: 21,267 Kbs

My results:

[B]Q6600 @ 3.0gHz:[/B]
Pass 1: 30.71 FPS
Pass 2: 5.81 FPS

[B]i7-2600k @ 3.5gHz:[/B] (Stock clock is 3.4gHz, but default Turbo operation pushes speeds to 3.5gHz with 4 cores loaded.)
Pass 1: 36.81 FPS
Pass 2: 10.51 FPS

[B]i7-2600k @ 4.5gHz:[/B]
Pass 1: 43.47 FPS
Pass 2: 13.40 FPS


#13

[QUOTE=Stereodude;2572197]I didn’t think the difference between the BD Rebuilder 2-pass and the Handbreak version was that slight, but to each his own.

I like to mathematically subtract the compressed version from the original, do a high pass filter on the result and then enhance the contrast to see how they differ. :iagree:[/QUOTE]

That’s artificial enhancement though.

If you can’t see it with your eye then to all intents and purposes it has no effect on your viewing experience. :wink:

[B]Wombler[/B]


#14

@Stereodude
I’ve never done a Highest Quality encoding job with BD Rebuilder. I tried to do one this afternoon, but didn’t see your kbps rate until too late, so it wasn’t a comparable test. Using 11000 kbps, I was getting 15.35 fps on the first pass and 10.40 on the second. When I noticed the difference in encoding parameters, I shut it down before it finished. It was taking a very long time though. First pass took 3hrs 16 minutes.

This is with a 1055 AMD 6 core cpu clocked at 3.2ghz.


#15

[QUOTE=Kerry56;2572461]@Stereodude
I’ve never done a Highest Quality encoding job with BD Rebuilder.[/quote]Oh. I figure if I’m going to encode something I might as well get the best possible output for the bitrate. Hence I’ve been using the Highest Quality setting.

I tried to do one this afternoon, but didn’t see your kbps rate until too late, so it wasn’t a comparable test. Using 11000 kbps, I was getting 15.35 fps on the first pass and 10.40 on the second. When I noticed the difference in encoding parameters, I shut it down before it finished. It was taking a very long time though. First pass took 3hrs 16 minutes.
Interesting… Your first pass seems slow compared to the speed of the 2nd pass.

FWIW, my FPS ratings are not the ones listed by BD Rebuilder, but ones I got by dividing the number of frames by the time for each pass (though they basically agree).


#16

[QUOTE=Stereodude;2572464]Oh. I figure if I’m going to encode something I might as well get the best possible output for the bitrate. Hence I’ve been using the Highest Quality setting.
Interesting… Your first pass seems slow compared to the speed of the 2nd pass.

FWIW, my FPS ratings are not the ones listed by BD Rebuilder, but ones I got by dividing the number of frames by the time for each pass (though they basically agree).[/QUOTE]

There’s a lot of extra analysis that goes on in the first pass and the second pass is always therefore quicker.

[B]Wombler[/B]


#17

[QUOTE=Wombler;2572502]There’s a lot of extra analysis that goes on in the first pass and the second pass is always therefore quicker.[/QUOTE]FWIW, on both of My PCs the 2nd pass takes at least 3.5x as long as the first.


#18

[QUOTE=Stereodude;2572525]FWIW, on both of My PCs the 2nd pass takes at least 3.5x as long as the first.[/QUOTE]

That’s weird.

What are the specs for your PC?

[B]Wombler[/B]


#19

[QUOTE=Wombler;2572617]That’s weird.

What are the specs for your PC?[/QUOTE]
One is a Q6600 @ 3.0gHz

  • [13:49:10] Reencoding: VID_00000, Pass 1 of 2
  • [15:22:33] Reencoding: VID_00000, Pass 2 of 2
  • [23:35:45] Video Encode complete

The other is a i7-2600K @ >4.0gHz

  • [17:22:02] Reencoding: VID_00000, Pass 1 of 2
  • [18:28:00] Reencoding: VID_00000, Pass 2 of 2
  • [22:02:00] Video Encode complete

Same movie. Quality is set to “Highest (Very Slow)”


#20

Have to say, I agree with Stereodude on this. With a two pass encode, the first pass is essentially an analysis of the material. The second pass is where the actual encoding work is done, and the second pass always goes slower. That’s my experience.