[RESOLVED] Failed to create video decoder (2)

Support forum for DGDecNV
Post Reply
DAE avatar
djc5166
Posts: 15
Joined: Sat Jan 09, 2016 12:24 pm

[RESOLVED] Failed to create video decoder (2)

Post by djc5166 »

On opening some of my AVS scripts with baka encoder -> HEVC_10bit I usually get the error "Failed to create video decoder (2)"

Video encoding continues after this error like nothing happened, and the resulting file looks ok. Not sure if this has to do with DGDecodeNV or not, but I assumed so with the 'video decoder' error.

I'm using ColorMatrix, AnimeIVTC, and mcdaa3 in my scripts.

Scripts seem to open fine in other programs, AvsPmod, VirtualDub, etc. But sometimes scrolling around the video too fast also causes program freezes/crashes

Any help is appreciated, curious what error (2) is, I can only find references to error (100).
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Failed to create video decoder (2)

Post by admin »

2 is CUDA_ERROR_OUT_OF_MEMORY. Can you show your script and your INI file? What is your card and how much memory does it have?

You can use the GPU_Z sensors tab to check memory usage on the card. Start your transcode process and then monitor the memory usage. Does the baka encoder or anything else in your script other than DGSourceNV() use the GPU?

For the crashing on timeline navigation in VirtualDub, try it with a minimal script (just DGSourceNV) and see what happens. If it still happens then I will want to get a sample from you to try to recreate that.

I'm surprised that things still work after this error. I have some ideas about it and will investigate. The decoder is destroyed and recreated in certain circumstances. For example, if the stream changes from 1088 to 1080 or vice versa. Is your stream a single thing or was it created by combining things from different sources?
DAE avatar
djc5166
Posts: 15
Joined: Sat Jan 09, 2016 12:24 pm

Re: Failed to create video decoder (2)

Post by djc5166 »

I suspect it has to do with multiple calls to AnimeIVTC(), but idk why DGSource would care about that. I'm not sure if the AnimeIVTC scripts use the GPU, CPU usage was pretty high (60-90% on 5930k @4Ghz).

I have 2x TitanX's in SLI (12GB of VRAM each). I surely hope this is enough memory :shock:
Does DGDecodeNV support this much memory? Do cards in SLI pose a problem?

It seems to have to do with my animeIVTC calls with mode=3 (Double Hard Telecine). This mode seems to use an insane amount of resources, but again, I'm not sure if it touches the GPU at all. I'm not super knowledgeable about what all these things are doing yet, so I may be using it incorrectly. I used mode=3 where I saw interlaced overlays on telecined backgrounds - Parts of the end credits and end previews.

Calling DGSource on its own in a script doesn't seem to cause any issues, it seems to be only when the operations are very resource intensive.

My stream is made up of two sources. Does DGSource only work correctly called once?

Commenting out the code and encoding each piece on its own seems to work better (v1 - v2 - c2) - since this ends up being only one call to AnimeIVTC, and one call to DGSource.

I'll take a look later at my VRAM usages.

These are all R2 bleach DVDs
ED1.avs (I recreated the credits here, any form of IVTC/deinterlacing them left them super ugly)

Code: Select all

image = "1.png"
image2 = "2.png"

DGSource("VTS_01_1.dgi")
ColorMatrix(hints=true, threads=0, interlaced=true)

input = Trim(2765, 4549).AnimeIVTC(mode=3, ediandnn=3, aa=4,
                                                    \ omode=1, credconv="mocomp", overlap=6, pel=4, bbob=4, nnedi3pel=true, cbob=4, degrain=3,
                                                    \ precision=6)
input = input.LanczosResize(640, 480, 8, 0, -8, 0)

credits = CreditScroll(input, image, startFrame=30, numSecs=56.63)
input = overlay(input, credits, mask=ShowAlpha(credits))

credits = CreditFade(input, image2, startFrame=1270, numSecs=0.8, startA=0.0, endA=1.0)
input = overlay(input, credits, mask=ShowAlpha(credits))

input = input.FadeOut(27, fps=input.framerate) 
return input
E1.avs

Code: Select all

c2= Import("C:\Users\djc5166\Desktop\Bleach\Credits 1\ED1.avs")

DGSource("VTS_01_1.dgi")
ColorMatrix(hints=true, threads=0, interlaced=true)

v1 = trim(0, 38826).AnimeIVTC(mode=1, ediandnn=3, aa=4,
                                            \ omode=1, credconv="mocomp", overlap=4, pel=4, bbob=4, nnedi3pel=true, cbob=4, degrain=3,
                                            \ precision=6).LanczosResize(640, 480, 8, 0, -8, 0)
v2 = trim(40610, 41060).AnimeIVTC(mode=3, ediandnn=3, aa=4,
                                                    \ omode=1, credconv="mocomp", overlap=6, pel=4, bbob=4, nnedi3pel=true, cbob=4, degrain=3,
                                                    \ precision=6).LanczosResize(640, 480, 8, 0, -8, 0)
                                                  
v1++c2++v2
CreditFunctions.avsi

Code: Select all

function CreditScroll(clip src, string file, int "startFrame", float "numSecs", int "vidWidth", int "vidHeight")
{
    fps = src.FrameRate()
    numSecs = default(numSecs, 10.0)
    numFrames = int(numSecs * fps)

    vidWidth = default(vidWidth, src.Width())
    vidHeight = default(vidHeight, src.Height())
    startFrame = default(startFrame, 0)

    credits = ImageSource(file, end=startFrame+numFrames-1, fps=fps, pixel_type="RGB32")

    return Animate(startFrame, startFrame+numFrames-1, "LanczosResize", 
                                                                                 \ credits, vidWidth, vidHeight, 0.0,                    -vidHeight, vidWidth, vidHeight,
                                                                                 \ credits, vidWidth, vidHeight, 0.0, credits.height+vidHeight, vidWidth, vidHeight)
}

function CreditFade(clip src, string file, int "startFrame", float "numSecs", int "vidWidth", int "vidHeight", float "startA", float "endA")
{
    fps = src.FrameRate()
    numSecs = default(numSecs, 10.0)
    numFrames = int(numSecs * fps)
    
    vidWidth = default(vidWidth, src.Width())
    vidHeight = default(vidHeight, src.Height())
    startFrame = default(startFrame, 0)
    
    credits = ImageSource(file, end=startFrame+numFrames-1, fps=fps, pixel_type="RGB32")
    
    out = Animate(startFrame, startFrame+numFrames-1,
                       \ "RGBAdjust", 
                       \ credits, 1, 1, 1, startA, 0, 0, 0, 0, 1, 1, 1, 1, 
                       \ credits, 1, 1, 1,   endA, 0, 0, 0, 0, 1, 1, 1, 1)
                       
    return out
}
dgindex.ini

Code: Select all

Version=DGIndexNV 2051
Window_Position=1550,483
Info_Window_Position=1209,663
Process_Priority=2
Playback_Speed=3
AVS_Template_Folder=
AVS_Template_File=template.avs
AVS_Enable_Template=1
AVS_Overwrite=0
Full_Path_In_Files=1
MRUList[0]=C:\Users\djc5166\Desktop\Bleach\BLEACH_DISC_01\VTS_01_1.VOB
MRUList[1]=C:\Users\djc5166\Desktop\Bleach\Credits 1\VTS_01_1.VOB
MRUList[2]=F:\VIDEO_TS\VTS_02_1.VOB
MRUList[3]=H:\VIDEO_TS\VTS_01_1.VOB
Enable_Info_Log=1
Loop_Playback=0
AVC_Extension=264
MPG_Extension=m2v
VC1_Extension=vc1
HEVC_Extension=265
Deinterlace=0
UsePF=0
AlwaysCrop=1
UseD3D=0
Snapped=0
ResponseOnAudioMismatch=0
Enable_Audio_Demux=0
CUDA_Device=255
Decode_Modes=0,0,0,0
Full_Info=1
Bare_Demux=0
Disable_Encrypted_Audio_Warning=0
Fine_Cropping=0
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Failed to create video decoder (2)

Post by admin »

Waiting for your memory usage info...
DAE avatar
djc5166
Posts: 15
Joined: Sat Jan 09, 2016 12:24 pm

Re: Failed to create video decoder (2)

Post by djc5166 »

Memory usage is about 870-890mb on both cards. About the same regardless of whatever load DGDecode is putting on them vs idle. I see the clocks jump up when I start to encode, or just play the stream, but memory usage is basically unchanged.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Failed to create video decoder (2)

Post by admin »

To be honest, I don't know if that error refers only to GPU memory.

Multiple instances of DGSource() in your script is OK, *subject to resource limitations*. Instead of using two instances why don't you load both streams in DGIndexNV or concatenate them?
DAE avatar
djc5166
Posts: 15
Joined: Sat Jan 09, 2016 12:24 pm

Re: Failed to create video decoder (2)

Post by djc5166 »

You mean concatenate them in DGIndexNV? I can try that.
DAE avatar
djc5166
Posts: 15
Joined: Sat Jan 09, 2016 12:24 pm

Re: Failed to create video decoder (2)

Post by djc5166 »

This seems to work, I'm doing the exact same thing from a single project.dgi now and it is crash-free so far :D. So strange...
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Failed to create video decoder (2)

Post by admin »

It's not so strange because multiple instances of DGSource() will require more resources compared to a single instance. Always use a single source call where possible, especially for heavy-duty scripts.

You could concatenate the streams before loading into DGIndexNV (using DOS COPY /B) but there's really no point because DGIndexNV does it in effect.
DAE avatar
djc5166
Posts: 15
Joined: Sat Jan 09, 2016 12:24 pm

Re: Failed to create video decoder (2)

Post by djc5166 »

I see, good to know, I will do that from now on. Thanks for the support as always :D.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Failed to create video decoder (2)

Post by admin »

My pleasure and thank you for your interest in my tools.
DAE avatar
kirarium
Posts: 1
Joined: Fri Jun 24, 2016 12:01 am

Re: [RESOLVED] Failed to create video decoder (2)

Post by kirarium »

GPU decoder : Failed to create video decoder [2]

I investigated about this issue
PC-Spec
windows10_x64 (Home)
GeForce GTX480

NVIDIA Driver
~359.06 (1.12.2015) There are no errors
361.43 (21.12.2015) ~ 368.39 (7.6.2016) is errors

I'm sorry not to be able to speak English
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Failed to create video decoder (2)

Post by admin »

nVidia tends to drop proper support for older cards in later driver versions. It's understandable. All you can do is upgrade your hardware or use the latest driver that works.
DAE avatar
Nick007
Posts: 38
Joined: Wed Sep 29, 2010 12:20 pm

Re: [RESOLVED] Failed to create video decoder (2)

Post by Nick007 »

So GTX 570 is old? :o The card is just few generations old, handles most games, even the new ones. Too bad, no point buying new one when I don't play games often and don't have problem to play few years old games (problem is to find the time...).
Windows 10 presents problems because one cannot easily prevent driver from being updated (I think I found solution by blocking installation of driver based on hardware id, hope it works).
Post Reply