Log in

View Full Version : Bug: MPEG2SOURCE_OPTS not used in FINAL_Q analysis


kumi
19th October 2007, 07:47
Hello. I'm having trouble using ColorMatrix with DVD-Rebuilder as I have it currently configured.

My rebuilder.ini has these options:
MPEG2SOURCE_OPTS=info=3
REDIST_USE_FINAL_Q=1
HC_FOR_REDIST=1
Redistribute=1
AVSFilter01=C:P:ColorMatrix(hints=true,dest=0,clamp=false,threads=0)
AVSFilter02=C:I:ColorMatrix(hints=true,dest=0,clamp=false,threads=0,interlaced=true)


A sample segment .AVS, which plays correctly, looks like this:
#------------------
# AVS File Created by DVD Rebuilder
# VOBID:13, CELLID:01
#------------------
LoadPlugin("C:\Program Files\DVD-RB PRO 1.26.5\DGDecode.dll")
mpeg2source("D:\DVDRB WORKING\TEMP\D2VAVS\V01.D2V",idct=7, info=3)
ColorMatrix(hints=true,dest=0,clamp=false,threads=0,interlaced=true)
trim(122791,132261)
ConvertToYUY2(interlaced=true)
AudioDub(BlankClip())


But-- Uh oh... V01_Q_ANALYSIS.AVS looks like this:
#------------------
# AVS File Created by DVD Rebuilder
# VOBID:03, CELLID:01
#------------------
LoadPlugin("C:\Program Files\DVD-RB PRO 1.26.5\DGDecode.dll")
mpeg2source("D:\DVDRB WORKING\TEMP\D2VAVS\V01.D2V")
ColorMatrix(hints=true,dest=0,clamp=false,threads=0,interlaced=true)
SelectRangeEvery(1500,15)
ConvertToYV12()
AudioDub(BlankClip())


HCEnc can't encode this: the error is
ERROR, ColorMatrix: no hints detected in stream with hints=true!

jdobbs
19th October 2007, 23:54
Since DVD-RB already looks for and uses the colormatrix() as necessary (the "C:" prefix) -- there is really no reason to use "hints" with colormatrix(). I would suggest you remove it.

But I will look and see why it isn't adding the "info=3" in the analysis file. I assume you have:

MPEG2SOURCE_OPTS=info=3

in your INI file -- as it is showing in one of your examples.

kumi
20th October 2007, 00:38
Since DVD-RB already looks for and uses the colormatrix() as necessary (the "C:" prefix) -- there is really no reason to use "hints" with colormatrix(). I would suggest you remove it.
I think you are assuming that DVDs come in only two flavors: Rec.601 and Rec.709. But I personally own at least a few DVDs with SMPTE 240M coefficients, and I think I have one with FCC coefficients around, somewhere.


Perhaps you would suggest I use:
C:ColorMatrix(mode="Rec.601->Rec.709")
or
C:ColorMatrix(source=2, dest=0) (same thing)

But that will result in an incorrect conversion, when the DVD has FCC or SMPTE 240M coefficients.


This script is more elegant (slower), since it handles any source coefficient:
C:ColorMatrix(hints=true,dest=0)


P.S.: I'm assuming that the C: prefix is triggered on any non-Rec.709 coefficient. Correct me if I'm wrong on this.





I assume you have MPEG2SOURCE_OPTS=info=3 in your INI file
Yep, I do. Thanks for listening :)

jdobbs
20th October 2007, 02:29
SMPTE 240M is almost exactly the same as Rec.709 (close enough that it is normally considered identical) -- and FCC is almost exactly the same as Rec.601 (close enough that it is normally considered identical). DVD-RB treats them as such.

I would challenge anyone to tell the difference... a silly thing to say on Doom9, of course, because someone will always say "I can."

The C: would be triggered by FCC, ITU-R BT.470-2, or SMPTE 170M.

IMPORTANT NOTE -- here's a quote from the ColorMatrix() documentation:

"For ColorMatrix we assume I709 = S240 and I470=FCC=S170, because the error will be very small."

So it isn't being considered by ColorMatrix() anyway...

kumi
20th October 2007, 02:38
Oh... OK, I did not know that. In that case you're probably right: I don't need hints :)

Thanks jdobbs.

jdobbs
20th October 2007, 05:28
It's not needed, but then on the other hand... there is obviously a bug that needs to be fixed -- or the analysis AVS would have had "info=3" in it... I appreciate the report and I'll get it fixed for the next release.

:)

Could you send me the .D2V file so I can look at it? Pls send to dvd-rb@dvd-rb.com. My fear is that it is a mixture of Rec.601 and Rec.709... which of course would make it impossible to sample for analysis using ColorMatrix(). Then I'd have to really get creative.