This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

HDR encoding
#72
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);
Reply


Messages In This Thread
HDR encoding - by mparade - 28.08.2017, 14:44
RE: HDR encoding - by Selur - 28.08.2017, 16:18
RE: HDR encoding - by mparade - 28.08.2017, 18:10
RE: HDR encoding - by Selur - 28.08.2017, 18:16
RE: HDR encoding - by mparade - 28.08.2017, 18:22
RE: HDR encoding - by Selur - 28.08.2017, 19:12
RE: HDR encoding - by mparade - 28.08.2017, 20:55
RE: HDR encoding - by Selur - 28.08.2017, 21:08
RE: HDR encoding - by mparade - 28.08.2017, 21:19
RE: HDR encoding - by mparade - 29.08.2017, 00:52
RE: HDR encoding - by Selur - 29.08.2017, 05:40
RE: HDR encoding - by mparade - 29.08.2017, 08:27
RE: HDR encoding - by Selur - 29.08.2017, 09:39
RE: HDR encoding - by mparade - 29.08.2017, 10:56
RE: HDR encoding - by Selur - 29.08.2017, 11:08
RE: HDR encoding - by mparade - 29.08.2017, 12:53
RE: HDR encoding - by Selur - 29.08.2017, 13:07
RE: HDR encoding - by mparade - 06.09.2017, 12:34
RE: HDR encoding - by Selur - 06.09.2017, 16:13
RE: HDR encoding - by mparade - 06.09.2017, 17:37
RE: HDR encoding - by Selur - 06.09.2017, 18:27
RE: HDR encoding - by mparade - 06.09.2017, 19:24
RE: HDR encoding - by Selur - 06.09.2017, 19:32
RE: HDR encoding - by mparade - 06.09.2017, 21:21
RE: HDR encoding - by Selur - 07.09.2017, 05:59
RE: HDR encoding - by mparade - 07.09.2017, 08:27
RE: HDR encoding - by Selur - 07.09.2017, 18:55
RE: HDR encoding - by mparade - 08.09.2017, 15:28
RE: HDR encoding - by Selur - 08.09.2017, 16:07
RE: HDR encoding - by Selur - 08.09.2017, 18:00
RE: HDR encoding - by mparade - 08.09.2017, 18:57
RE: HDR encoding - by mparade - 08.09.2017, 19:14
RE: HDR encoding - by Selur - 08.09.2017, 19:10
RE: HDR encoding - by Selur - 08.09.2017, 22:37
RE: HDR encoding - by mparade - 09.09.2017, 11:28
RE: HDR encoding - by Selur - 09.09.2017, 12:47
RE: HDR encoding - by mparade - 09.09.2017, 14:53
RE: HDR encoding - by Selur - 09.09.2017, 15:03
RE: HDR encoding - by mparade - 09.09.2017, 15:05
RE: HDR encoding - by Selur - 09.09.2017, 15:14
RE: HDR encoding - by mparade - 09.09.2017, 15:32
RE: HDR encoding - by Selur - 09.09.2017, 15:39
RE: HDR encoding - by Selur - 09.09.2017, 15:40
RE: HDR encoding - by mparade - 09.09.2017, 15:48
RE: HDR encoding - by Selur - 09.09.2017, 15:50
RE: HDR encoding - by mparade - 09.09.2017, 16:08
RE: HDR encoding - by Selur - 09.09.2017, 16:16
RE: HDR encoding - by mparade - 09.09.2017, 16:26
RE: HDR encoding - by Selur - 09.09.2017, 16:35
RE: HDR encoding - by mparade - 09.09.2017, 16:45
RE: HDR encoding - by mparade - 09.09.2017, 19:17
RE: HDR encoding - by Selur - 09.09.2017, 19:38
RE: HDR encoding - by mparade - 09.09.2017, 20:12
RE: HDR encoding - by Selur - 09.09.2017, 20:36
RE: HDR encoding - by Selur - 09.09.2017, 20:44
RE: HDR encoding - by mparade - 09.09.2017, 20:47
RE: HDR encoding - by Selur - 09.09.2017, 21:27
RE: HDR encoding - by mparade - 10.09.2017, 14:56
RE: HDR encoding - by Selur - 10.09.2017, 14:59
RE: HDR encoding - by mparade - 10.09.2017, 15:03
RE: HDR encoding - by Selur - 10.09.2017, 16:02
RE: HDR encoding - by mparade - 10.09.2017, 16:16
RE: HDR encoding - by Selur - 10.09.2017, 16:26
RE: HDR encoding - by mparade - 12.09.2017, 20:14
RE: HDR encoding - by Selur - 12.09.2017, 20:36
RE: HDR encoding - by mparade - 13.09.2017, 21:54
RE: HDR encoding - by Selur - 14.09.2017, 05:19
RE: HDR encoding - by mparade - 14.09.2017, 08:24
RE: HDR encoding - by mparade - 16.09.2017, 14:38
RE: HDR encoding - by videoh - 16.10.2017, 16:29
RE: HDR encoding - by Selur - 16.09.2017, 20:45
RE: HDR encoding - by videoh - 16.10.2017, 22:22
RE: HDR encoding - by Selur - 17.10.2017, 01:04

Forum Jump:


Users browsing this thread: 2 Guest(s)