Selur's Little Message Board
HDR encoding - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: HDR encoding (/thread-83.html)

Pages: 1 2 3 4 5 6 7 8


RE: HDR encoding - videoh - 16.10.2017

(16.09.2017, 14:38)mparade Wrote: Just to inform you using Staxrip and DGDecNV with HDR10 input: I have completed my first HDR encode using DGDecNV, but unfortunately I saw some artifacts during decoding the output:

http://www.mammutmail.com/hu/download/bdf08e075867514436013154b6fea0dd

I don't know yet if it is only a decoding problem now or if it is involved in the encode itself already due to some "problem" with decoding the original HDR content through DGDecNV.

Edit: It seems these artifacts are encoded into the output (the source material can be decoded without them).

The artifacts were due to a CUVID bug. This is fixed in the latest nVidia driver 387.92.

Today I plan to do some debugging to try to see why Vapoursynth is having a problem with DGSource(fulldepth=True)


RE: HDR encoding - videoh - 16.10.2017

I've found out why Vapoursynth doesn't like CS_YUV420P16 returned by DGSource(fulldepth=True). Following is the code in avisynth_compat.cpp. It's pretty obvious that Vapoursynth simply does not accept CS_YUV420P16 from Avisynth+. It should be easy to add support. Maybe someone can ask Myrsloik about this. Based on my experience he won't want to hear anything from me, although really I have no grudge against Vapoursynth.

Interestingly, the vs_normalizeRational() call is a bit surprising, considering how not so long ago Myrsloik refused to do that and insisted all filters must do it themselves.

static void VS_CC avisynthFilterInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) {
    WrappedClip *clip = (WrappedClip *) * instanceData;

    if (!clip->preFetchClips.empty())
        clip->fakeEnv->uglyNode = clip->preFetchClips.front();

    const VideoInfo &viAvs = clip->clip->GetVideoInfo();
    ::VSVideoInfo vi;
    vi.height = viAvs.height;
    vi.width = viAvs.width;
    vi.numFrames = viAvs.num_frames;
    vi.fpsNum = viAvs.fps_numerator;
    vi.fpsDen = viAvs.fps_denominator;
    vs_normalizeRational(&vi.fpsNum, &vi.fpsDen);

    if (viAvs.IsYV12())
        vi.format = vsapi->getFormatPreset(pfYUV420P8, core);
    else if (viAvs.IsYV24())
        vi.format = vsapi->getFormatPreset(pfYUV444P8, core);
    else if (viAvs.IsYV16())
        vi.format = vsapi->getFormatPreset(pfYUV422P8, core);
    else if (viAvs.IsYV411())
        vi.format = vsapi->getFormatPreset(pfYUV411P8, core);
    else if (viAvs.IsColorSpace(VideoInfo::CS_YUV9))
        vi.format = vsapi->getFormatPreset(pfYUV410P8, core);
    else if (viAvs.IsY8())
        vi.format = vsapi->getFormatPreset(pfGray8, core);
    else if (viAvs.IsYUY2())
        vi.format = vsapi->getFormatPreset(pfCompatYUY2, core);
    else if (viAvs.IsRGB32())
        vi.format = vsapi->getFormatPreset(pfCompatBGR32, core);
    else
        vsapi->setError(out, "Avisynth Compat: Only YV12, YUY2 and RGB32 supported");

    vi.flags = 0;
    vsapi->setVideoInfo(&vi, 1, node);
}

It seems we just have to add two lines to the if-else:

else if (viAvs.IsColorSpace(VideoInfo::CS_YUV420P16))
   vi.format = vsapi->getFormatPreset(pfYUV420P16, core);



RE: HDR encoding - Selur - 17.10.2017

Yup, contacting Myrsloik is your best Bet.

Cu Selur