View Full Version : HCenc - maximize quality for DVD
fib0by
25th February 2008, 04:18
I am transcoding DV files to DVD. I want to maximize the quality of the video track. I don't care about file size or transcoding time - as long as a 1 hour DV tape fits on a DVD5 disc, and as long as it finishes transcoding overnight, it's fine with me.
I assume that I need to use the CQ mode, not the 2 pass mode with average bitrate, right? Average bitrate is for hitting a certain file size, but it may not produce the best quality always, is that correct?
Also, I am currently using:
*MAXBITRATE 9500
*PROFILE best
*ASPECT 16:9
*AUTOGOP 18
*CQ_MAXBITRATE 5.000
*DC_PREC 10
*DVSOURCE
*NOSCD
*CLOSEDGOPS
*MATRIX mpeg
*LUMGAIN 1
*PRIORITY normal
*WAIT 0
Is 9500 kbps too high? I tried 9800 first, but the multiplexer complained. But I wonder if 9500 is still too high, in case the encoder accidentally overshoots in single-pass mode. I don't want to produce DVDs that are non-standard.
Finally, how do I know I'm using the correct CQ? Can I look at the bitrate and tell? E.g., with CQ=5, I get these average bitrates on the files captured from a tape:
8743600 bits/sec
8054800 bits/sec
8442000 bits/sec
8726000 bits/sec
8812800 bits/sec
8249200 bits/sec
8241600 bits/sec
7692400 bits/sec
8999600 bits/sec
8420000 bits/sec
8799600 bits/sec
8698400 bits/sec
7902400 bits/sec
3328400 bits/sec
3811200 bits/sec
4853200 bits/sec
while the max bitrates for the same files are:
9494800 bits/sec
9494800 bits/sec
9482000 bits/sec
9475600 bits/sec
9472800 bits/sec
9472400 bits/sec
9498800 bits/sec
9374000 bits/sec
9477200 bits/sec
9498400 bits/sec
9388800 bits/sec
9467200 bits/sec
9426000 bits/sec
6250000 bits/sec
5815200 bits/sec
9017600 bits/sec
manono
25th February 2008, 12:35
Hi-
But I wonder if 9500 is still too high...
Maybe, maybe not. It depends on the audio. If it's PCM WAV audio, then it's definitely too high and you had better set 8500 (or even 8000) as the max. Or reencode the audio to AC3. The video+audio+subs(if any)+overhead must be no higher than 10080.
G_M_C
25th February 2008, 16:13
look at this page:
http://dvd-hq.info/Calculator.html
I allways use it for bitratecalculation, it's very handy :)
Anyway, you can use 2-pass just fine. I use it all the time, it produces fine results. I only choose a different encoding-matrix, based on the avg. bitrate the calculator ends up with.
For instance: I used this one last time i ended up with a very high avg. bitrate. (6000 or higher);
8 10 11 12 12 13 14 15
10 11 12 13 13 15 15 16
11 12 12 14 15 15 16 17
12 13 14 15 15 16 17 18
12 13 15 15 16 17 18 19
13 15 15 16 17 18 19 19
14 15 16 17 18 19 19 20
15 16 17 18 19 19 20 20
8 8 8 9 9 9 9 10
8 8 9 9 9 9 10 10
8 9 9 9 9 10 10 10
9 9 9 9 10 10 10 10
9 9 9 10 10 10 10 11
9 9 10 10 10 10 11 11
9 10 10 10 10 11 11 11
10 10 10 10 11 11 11 11
I've also put the "lumgain" parameter on 1.
fib0by
25th February 2008, 17:41
Maybe, maybe not. It depends on the audio. If it's PCM WAV audio, then it's definitely too high and you had better set 8500 (or even 8000) as the max. Or reencode the audio to AC3. The video+audio+subs(if any)+overhead must be no higher than 10080.
Well, I do use AC3. But I was not worried about the mathematical relation between the two. I was more worried about the encoder accidentally generating a higher bitrate than it's supposed to. I'm not sure if an encoder in 1-pass mode can be really trusted to not overshoot.
But I guess it depends on the encoder - that's why I put "HCenc" in the title.
Boulder
26th February 2008, 08:37
If you author using MuxMan, it will clearly tell you if there are any violations. On my DV->DVD encodes, I do a 2-pass encode in HC using the same maximum and average bitrate (8500kbps) and bias set to 100, LUMGAIN 3 and a high bitrate matrix. In your case, I'd also use the automatic scene change detection and open GOPs.
fib0by
26th February 2008, 08:55
If you author using MuxMan, it will clearly tell you if there are any violations. On my DV->DVD encodes, I do a 2-pass encode in HC using the same maximum and average bitrate (8500kbps) and bias set to 100, LUMGAIN 3 and a high bitrate matrix. In your case, I'd also use the automatic scene change detection and open GOPs.
It's a bit complicated.
I'm running HCenc under WINE on Linux. It works quite well. I'm using a Linux-based muxer (mplex - part of the mjpegtools (http://mjpeg.sourceforge.net/) package) which tells me the max and average bitrate. I guess I'm just paranoid and don't want to trust the muxer. I was looking rather for real-life examples when HCenc went beyond the max bitrate - or rather how often does that happen?
Automatic scene detection is not needed, due to the way the capture works, each scene is captured as a separate DV file, which also gets processed separately. I stitch everything together at the end.
I'm not sure how much I lose due to closed GOPs. I'd rather make it slightly easier to make cuts later.
Those are very aggressive settings that you're using! I assume your goal is the same - maximize image quality no matter what.
What matrix are you using?
Boulder
26th February 2008, 09:03
The matrix I use depends on the general amount of motion in the video, if it's shot as handheld, I use a lower bitrate matrix such as this one:08 08 08 09 11 13 14 17
08 08 09 11 13 13 14 17
08 08 11 12 13 14 17 94
09 11 13 13 14 17 17 94
11 11 13 13 14 17 94 94
13 13 14 16 17 20 94 94
13 13 14 17 94 94 94 94
13 14 17 94 94 94 94 94
12 12 13 14 15 16 22 26
12 13 14 15 16 22 26 32
13 14 15 16 22 26 32 41
14 15 16 22 26 32 41 53
15 16 22 26 32 41 53 94
16 22 26 32 41 53 70 94
22 26 32 41 53 70 94 94
26 32 41 53 94 94 94 94
If the video is rather steady, I use this one:
08 08 09 09 10 10 11 11
08 09 09 10 10 11 11 12
09 09 10 10 11 11 12 12
09 10 10 11 11 12 13 13
10 10 11 11 12 13 13 14
10 11 11 12 13 13 14 15
11 11 12 13 13 14 15 15
11 12 12 13 14 15 15 16
08 08 09 09 10 10 11 11
08 09 09 10 10 11 11 12
09 09 10 10 11 11 12 12
09 10 10 11 11 12 13 13
10 10 11 11 12 13 13 14
10 11 11 12 13 13 14 15
11 11 12 13 13 14 15 15
11 12 12 13 14 15 15 16
Why do you need to cut it later - do you archive for viewing or for doing the cutting later?
Nick
26th February 2008, 15:54
To be honest, I'm not convinced a CQ/OPV approach is necessary if you're only looking to get one hour of video on a DVD-5. Bitrate is not in short supply, so I would second Boulder's 2-pass approach.
Slightly OT but worth a mention nonetheless is that MuxMan has far superior muxing and authoring engines compared to the mjpegtools package. Whilst I see the merit in using native Linux applications where available Muxman, and Sir Didymus's commandline wrapper BatchMux, also work very well out of Wine.
Once you get a template HC.ini and matrix that suits, it should be fairly easy to rustle up a Bash script to batch-encode them.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.