Log in

View Full Version : BlankClip not true black - Sub Blacks


speedyrazor
16th June 2016, 12:27
Hi, I am using the below script to create a PAL SD down-convert from an HD Source and adding 1 second of black on the front.
It has been reported back to me that the 1 sec black on the front of the video (which the BlankClip is creating) is not true black (sub black).
What can I do to rectify this, and why is this happening please?

import vapoursynth as vs
core = vs.get_core(threads=4)
ret = core.lsmas.LibavSMASHSource(source=r"QuicktimeProresHQ-HD.mov")
ret = core.std.AssumeFPS(ret, fpsnum=25, fpsden=1)
ret = core.fmtc.resample (clip=ret, w=720, h=576, css="444", kernel="spline36")
ret = core.fmtc.matrix (clip=ret, mats="709", matd="601")
ret = core.fmtc.resample (clip=ret, css="422")
ret = core.fmtc.bitdepth (clip=ret, bits=10)
b1 = core.std.BlankClip(ret, length=25)
retFinal = b1 + ret
retFinal.set_output()

feisty2
16th June 2016, 12:40
uint8_t: core.std.Expr(ret, ["0", "128", "128"])
uint16_t: core.std.Expr(ret, ["0", "32768", "32768"])
float: core.std.Expr(ret, "0.0")

Myrsloik
16th June 2016, 12:47
Hint:
std.BlankClip(..., color=[0, 512, 512])

speedyrazor
16th June 2016, 13:57
Trying al of the above examples produces either a greenish, pinkish, or the same black using no color setting.
For my above example what would I need to add to produce correct blacks?

jackoneill
16th June 2016, 14:41
Trying al of the above examples produces either a greenish, pinkish, or the same black using no color setting.
For my above example what would I need to add to produce correct blacks?

First you should probably explain what "correct black" is.

splinter98
16th June 2016, 15:46
My guess is that your source is limited YUV and std.BlankClip is giving you a full range black.

If that is the case and you want black at limited scale try:

std.BlankClip(..., color=[64, 502, 502])

or change the bitdepth line to:


ret = core.fmtc.bitdepth (clip=ret, bits=10, fulls=0, fulld=1)


or reverse the values of fulls/fulld and convert the core.stdBlankClip to limited range first before splicing.

speedyrazor
16th June 2016, 15:56
My guess is that your source is limited YUV and std.BlankClip is giving you a full range black.

If that is the case and you want black at limited scale try:

std.BlankClip(..., color=[64, 502, 502])

or change the bitdepth line to:


ret = core.fmtc.bitdepth (clip=ret, bits=10, fulls=0, fulld=1)


or reverse the values of fulls/fulld and convert the core.stdBlankClip to limited range first before splicing.

Thanks for the examples, I will give them a try.