Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > DVD2AVI / DGIndex

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd December 2009, 17:42   #1  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,783
DG NV Tools usage in StaxRip

There is a increasing amount of request regarding DG NV Tools usage in StaxRip
so I try to improve the integration. By default the source filter for AviSynth is empty
in StaxRip and since it's empty StaxRip generates a source filter that can open
the source file. If there is a source filter and StaxRip believes the source filter
is not compatible it will overwrite it. If there is a bug in StaxRip then it might be
possible to workaround it to make StaxRip believe the source filter it expects
exists by using a comment. Better would however to tell me about problems
so I can upload a hotfix.

For dga and dgv files StaxRip expects the source filter to be either
avcsource() or dgsource() and if it's not it generates avcsource() or dgsource()
depending on the plugin it finds and if it don't find a plugin it aborts.

For dgm files StaxRip expects dgmultisource() and if it's not it generates
dgmultisource() or aborts in case DGMultiDecodeNV.dll is not in the plugin dir.

What should always work is simply open a avs file instead of a dga, dgv, dgm file,
in this case StaxRip don't make any assumptions, verifications or modifications
trying to be smart, it should just work and not complain. The latest version improves
support for AVS file opening in that it allows to define the source PAR or DAR easily
with a menu in the main dialog since it's hardy possible to auto detect this for all scripts.
AVS file opening was the main motivation for adding this new menu, since for most
other files auto detection is reliable. The other motivation was supporting work-flows
MeGUI users are used to or want to use.

The handling for the next version will use the code below,
maybe somebody can tell me if there is a error in the code.

Code:
Case "dga", "dgv"
    If Not srcscript.Contains("avcsource(") AndAlso _
        Not srcscript.Contains("dgsource(") Then

        If File.Exists(Paths.AviSynthPluginsDir + "DGDecodeNV.dll") Then
            p.AvsDoc.SetFilter("Source", "DGSource", "DGSource(""%source_file%"")")
        ElseIf File.Exists(Paths.AviSynthPluginsDir + "DGAVCDecode.dll") Then
            p.AvsDoc.SetFilter("Source", "AVCSource", "AVCSource(""%source_file%"")")
        Else
            MsgWarn("No compatible AviSynth plugin in plugin directory found.")
            Throw New AbortException
        End If

        AviSynthListView.Load()
    End If
Case "dgm"
    If Not srcscript.Contains("dgmultisource(") Then
        If File.Exists(Paths.AviSynthPluginsDir + "DGMultiDecodeNV.dll") Then
            p.AvsDoc.SetFilter("Source", "DGMultiSource", "DGMultiSource(""%source_file%"")")
        Else
            MsgWarn("DGMultiDecodeNV.dll must be in plugin directory to open dgm files.")
            Throw New AbortException
        End If

        AviSynthListView.Load()
    End If
SharpDevelop's has a handy online code converter so I can post C# code:

Code:
case "dga":
case "dgv":
	if (!srcscript.Contains("avcsource(") && !srcscript.Contains("dgsource(")) {
		if (File.Exists(Paths.AviSynthPluginsDir + "DGDecodeNV.dll")) {
			p.AvsDoc.SetFilter("Source", "DGSource", "DGSource(\"%source_file%\")");
		} else if (File.Exists(Paths.AviSynthPluginsDir + "DGAVCDecode.dll")) {
			p.AvsDoc.SetFilter("Source", "AVCSource", "AVCSource(\"%source_file%\")");
		} else {
			MsgWarn("No compatible AviSynth plugin in plugin directory found.");
			throw new AbortException();
		}

		AviSynthListView.Load();
	}
	break;
case "dgm":
	if (!srcscript.Contains("dgmultisource(")) {
		if (File.Exists(Paths.AviSynthPluginsDir + "DGMultiDecodeNV.dll")) {
			p.AvsDoc.SetFilter("Source", "DGMultiSource", "DGMultiSource(\"%source_file%\")");
		} else {
			MsgWarn("DGMultiDecodeNV.dll must be in plugin directory to open dgm files.");
			throw new AbortException();
		}

		AviSynthListView.Load();
	}
	break;
Integration for the index application is a bit more tricky since StaxRip don't know where it is located,
if this was found in the registry then integration would be possible. The integration for included index
applications looks as follows:

Code:
Dim dgi As New CmdlPreparer
dgi.Name = "Demux audio and index MPEG-2 using DGIndex"
dgi.InputExtensions = "mpg mpeg vob mpv m2v m2t ts pva dat".Split(" "c)
dgi.VideoOutputExtensions = New String() {"d2v"}
dgi.InputFormatsBlacklist = New String() {"AVC"}
dgi.CommandLines.Value = """%application:DGIndex%"" -i %source_files% -ia 2 -fo 0 -yr 1 -tn 1 -om 2 -drc 2 -dsd 0 -dsa 0 -o ""%working_dir%\%source_name%"" -minimize -exit"

Dim dga As New CmdlPreparer
dga.Name = "Demux and index AVC using DGAVCIndex"
dga.InputExtensions = "m2ts m2t avc 264 h264".Split(" "c)
dga.InputFormatsBlacklist = "MPEG-TS MPEG-PS VC-1".Split(" "c)
dga.VideoOutputExtensions = New String() {"dga"}
dga.InputFormats = New String() {"AVC"}
dga.CommandLines.Value = """%application:DGAVCIndex%"" -i ""%source_file%"" -o ""%working_dir%\%source_name%.dga"" -a -h -e"
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More

Last edited by stax76; 3rd December 2009 at 18:22.
stax76 is offline   Reply With Quote
Old 3rd December 2009, 19:45   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Why not use DGMultiSource() for all types?
Guest is offline   Reply With Quote
Old 3rd December 2009, 20:17   #3  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,783
I don't have much knowledge about the relation between DGSource and DGMultiSource.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 3rd December 2009, 23:07   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
DGSource() needs the CUVID server and DGMultiSource() does not.

If you use DGMultiSource() for DGM there's no reason not to use it for DGA and DGV. It saves you having to manage the CUVID server.
Guest is offline   Reply With Quote
Old 4th December 2009, 10:55   #5  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,783
How does this look then (besides from being basic code ;-) ?:

Code:
Case "dga"
    Using f = File.OpenText(p.SourceFile)
        If f.ReadLine().StartsWith("DGAVCIndexFile") Then
            p.AvsDoc.SetFilter("Source", "AVCSource", "AVCSource(""%source_file%"")")
        Else
            p.AvsDoc.SetFilter("Source", "DGMultiSource", "DGMultiSource(""%source_file%"")")
        End If
    End Using
Case "dgv", "dgm"
    p.AvsDoc.SetFilter("Source", "DGMultiSource", "DGMultiSource(""%source_file%"")")
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 4th December 2009, 14:22   #6  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Looks OK but does that assume the source filter invocation is the first line in the script?
Guest is offline   Reply With Quote
Old 4th December 2009, 19:31   #7  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,783
In the next version it assumes the user didn't choose a source filter manually but uses the default source filter 'Automatic', the code for this filter is a empty string so this code executes only when the source filter is a empty string. It assumes plugin auto loading. It's possible to choose a source filter manually before opening a source file, the latest version has a larger selection of predefined source filters including NV Tools filters. StaxRip is customizable so it's possible to add custom filters and these can use manual plugin loading, maybe this was what you were interested. Next version the StaxRip setup allows to disable copying the included plugins to the plugin dir, StaxRip will notice when a plugin does not exist in the auto loading plugin dir and insert LoadPlugin() calls for every included plugin for every generated script. Your NV tools aren't included so if somebody wants to use manual loading for your plugin he has to to customize StaxRip for it. People who insist on manual loading usually prefer flat script code anyway, StaxRip allows to open avs scripts as source file.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More

Last edited by stax76; 4th December 2009 at 19:34.
stax76 is offline   Reply With Quote
Old 14th December 2009, 07:36   #8  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,783
@neuron2

Maybe you can test the latest StaxRip build as I have a report DGMultiSource only working when used without resize arguments. You would double click on the source filter, enter the code below and then open the index file.

DGMultiSource("%source_file%",resize_w=720, resize_h=400)

latest build

http://forum.doom9.org/showthread.ph...03#post1352603

This build would automatically use DGMultiSource for a NV index file but without resize parameters. The source filter collection to manually set a specific source filter contains DGMultiSource but as well without resize arguments.

Like MeGUI StaxRip opens scripts multiple times in sequence, for instance opening a source file will open 3 scripts:

VTS_01_1.avs
VTS_01_1_Source.avs
VTS_01_1_AutoCrop.avs

One to extract information from the source containing just the source filter.
One to extract information from the complete output script.
One to autocrop.

That's by far not everything, using the resize slider does for instance open the output script three times in a row, since the resize slider triggers calculation functions for things like aspect ratio, these functions use parameters extracted from the scripts like frame size and frame count. StaxRip caches these parameters but using the resize slider changes the script and whenever it changes it gets loaded to update the parameters. I hope this isn't a issue otherwise I would have to investigate if I could eliminate loading a few scripts but it would likely be difficult since I'm generally concerned about the application being responsive avoiding slow things like file IO if possible. StaxRip makes only very basic VFW calls btw so if a script causes the application to crash it's usually a plugin doing things like memory corruption.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 14th December 2009, 13:39   #9  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
StaxRip crashes for me even without the resize parameters.

I didn't install Avisynth 2.5.8 though.

Last edited by Guest; 14th December 2009 at 13:51.
Guest is offline   Reply With Quote
Old 21st December 2009, 22:51   #10  |  Link
MuLTiTaSK
Registered User
 
MuLTiTaSK's Avatar
 
Join Date: Nov 2006
Posts: 668
i'am having problems getting DG NV Tools working with StaxRip but i'am determined trust me

btw both of you guys should team up and create an OS together i'll buy it i'am big fan of both of you guys best devs in the video community if you ask me OK lets get this working

i'am using the same sample i send you stax76

i use DG NV Tools make project create .avs using DGMultiSource import into StaxRip encode to x264 beauty no problems

make StaxRip use DG NV Tools i keep getting errors
when trying to import .dgi file that i made my .avs with i get this error



i have DGMultiSource setup as source filter in StaxRip, added dgi as source type in StaxRip settings, created DG NV Tools demuxing profile in project options



when i try to load the .m2ts i created .dgi project with in StaxRip so it can use DG NV Tools i get this error


StaxRip gives me this after the error
Code:
DGMultiSource: Invalid index file!
(J:\files\00068_Source.avs, line 1)
this is StaxRip DGAVCIndex demux profile working with no problems


applications used:
DG NV tools 2.0.0 beta 7
StaxRip 1.1.2.4 preview 5

Last edited by MuLTiTaSK; 21st December 2009 at 23:12.
MuLTiTaSK is offline   Reply With Quote
Old 21st December 2009, 23:35   #11  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,783
I'm working on it.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 21st December 2009, 23:44   #12  |  Link
MuLTiTaSK
Registered User
 
MuLTiTaSK's Avatar
 
Join Date: Nov 2006
Posts: 668
thats all i had to hear merry christmas frankie boy
MuLTiTaSK is offline   Reply With Quote
Old 21st December 2009, 23:46   #13  |  Link
MuLTiTaSK
Registered User
 
MuLTiTaSK's Avatar
 
Join Date: Nov 2006
Posts: 668
@stax76

export demux profiles would be awesome for sharing with others
MuLTiTaSK is offline   Reply With Quote
Old 21st December 2009, 23:49   #14  |  Link
MuLTiTaSK
Registered User
 
MuLTiTaSK's Avatar
 
Join Date: Nov 2006
Posts: 668
@DG

merry christmas and a happy new year buddy dont code to much try to relax and enjoy the holidays
MuLTiTaSK is offline   Reply With Quote
Old 21st December 2009, 23:53   #15  |  Link
MuLTiTaSK
Registered User
 
MuLTiTaSK's Avatar
 
Join Date: Nov 2006
Posts: 668
@stax76

besides me donating to you cause your awesome would you like me to send you a extra nvidia card i have laying around?
MuLTiTaSK is offline   Reply With Quote
Old 26th December 2009, 12:59   #16  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,783
Thanks for the offer but I need my ATI card because of it's analog TV out, Nvidia never worked for me in this regard. Posting the command line and formats as text would be helpful so I can copy/paste as I'm adding this to the default setup.
__________________
mpv.net - StaxRip - MediaInfo.NET - Get-MediaInfo - More
stax76 is offline   Reply With Quote
Old 26th December 2009, 16:55   #17  |  Link
MuLTiTaSK
Registered User
 
MuLTiTaSK's Avatar
 
Join Date: Nov 2006
Posts: 668
Quote:
Originally Posted by stax76 View Post
Thanks for the offer but I need my ATI card because of it's analog TV out, Nvidia never worked for me in this regard. Posting the command line and formats as text would be helpful so I can copy/paste as I'm adding this to the default setup.
ATI drivers always gave me problems NV cuda lets me use DG NV Tools

Code:
Demux audio and index AVC (H.264), VC1, and MPEG-2 using DGIndexNV

264, h264, avc, m2v, mpv, vc1, mkv, vob, mpg, mpeg, m2t, m2ts, mts, tp, ts, trp

"%application:DGIndexNV%" -i %source_files% -f 0 -y 1 -o "%working_dir%\%source_name%" -a -h -e
MuLTiTaSK is offline   Reply With Quote
Old 26th December 2009, 17:05   #18  |  Link
MuLTiTaSK
Registered User
 
MuLTiTaSK's Avatar
 
Join Date: Nov 2006
Posts: 668
@stax76

Code:
DGDecNV 2.0.0 beta 8
--------------------

This beta adds multiple file open support, program stream support for
MPEG2, pulldown support for all video types, GPU cropping/resizing, and several important bug fixes.
Notably, when used with the Nvidia driver below, some issues with the
PureVideo deinterlacer are resolved. DTS audio support is added for program streams.
Support is added for pure interlaced VC1 (field interlace).

Most importantly, this beta combines support for all three video types (AVC, MPEG2, and VC1)
into one index executable: DGIndexNV.exe. Note that I have not yet revised the
documentation to account for this merger, so the three previous user manuals are
still included.

You must install version 191.07 or later of the Nvidia driver. Also,
do not use any special version of nvcuvid.dll as previously shipped
with the NV tools. Use the one that is installed by Nvidia.

Warnings:
---------

1. Activation of a screensaver or standby mode may interfere with
proper operation of the NV tools. They should be disabled during
use of the NV tools.

2. The NV tools currently support only a single instance, so for example
you cannot have two calls to DGSource() in your Avisynth script. But see below.

3. Some Nvidia mobile drivers have not been updated to 191.07 driver version,
so D3D operation may be needed. This can be enabled in the indexers by setting UseD3D=1
in the INI file. For the CUVIDServer create a file called CUVIDServer.ini in the
same directory as CUVIDServer.exe and put this line in it:

UseD3D=1

But always use non-D3D operation if your adapter supports it. Try it first with
UseD3D=0 and if things are OK, keep it that way.

4. Some users of Win 7 have reported that the Save Project operation runs unusually slowly.
If you run into this, either minimize DGIndexNV during the Save Project operation, or kill
the Info window.

Multiple Instance Support:
--------------------------

This beta includes a new experimental DLL called DGMultiDecodeNV.dll. It works like DGDecodeNV.dll
but supports multiple instances. Do not run the CUVIDServer when using this DLL.
Note that the compatibility issues are still being assessed. I know that:

* It works fine with x264.exe CLI in single or multipass modes.

* It works fine with HCEnc 0.23 but fails with 0.24.

* It fails with earlier MEGUI builds and I would guess that it also fails with more
recent ones.

I will be curious to hear reports of its compatibility with StaxRip, RipBot, Handbrake, etc.

To use it, load DGMultiDecodeNV.dll and invoke DGMultiSource() instead of DGSource().

(C) Copyright 2009-2010, Donald A. Graft, All Rights Reserved
MuLTiTaSK is offline   Reply With Quote
Old 26th December 2009, 17:15   #19  |  Link
MuLTiTaSK
Registered User
 
MuLTiTaSK's Avatar
 
Join Date: Nov 2006
Posts: 668
Code:
DGMultiSource()
DGMultiSource(str "dga", int deinterlace, bool use_top_field, int resize_w, int resize_h) 

dgi: "[PATH\]project.dgi"
DGIndexNV Project File.
Required parameter!
Note 1: PATH\ can be omitted if "project.dgi" is in the same directory as your AviSynth (*.avs)	script.

deinterlace: 0/1/2 (default: 0)
Nvidia PureVideo Deinterlacer
0: no deinterlacing
1: single rate deinterlacing
2: double rate deinterlacing (bobbing)

Note that double rate deinterlacing requires Windows XP SP3!

Also note that setting deinterlace to 1 or 2 forces the field operation to be "Ignore Pulldown", regardless of the project setting.

use_top_field: true/false (default: true)
Use the top field for single rate deinterlacing.
When this parameter is true, the top field is used for single rate deinterlacing; when false the bottom field is used. When deinterlace=0 or deinterlace=2, this parameter is ignored.

use_pf: true/false (default: false)
Use the progressive_frame indication from NVCUVID. If deinterlace=1 or deinterlace=2, and use_pf=true, then only frames marked as interlaced by NVCUVID will be deinterlaced. If deinterlace=1 or deinterlace=2, and use_pf=false, then all frames will be deinterlaced.

resize_w, resize_h: integer (default: 0)
Use the GPU to resize the video. The resizing is applied after deinterlacing. If either resize_w or resize_h is 0, no resizing is performed. If you need to crop before resizing, use the cropping filter in DGIndexNV.
MuLTiTaSK is offline   Reply With Quote
Old 26th December 2009, 17:26   #20  |  Link
MuLTiTaSK
Registered User
 
MuLTiTaSK's Avatar
 
Join Date: Nov 2006
Posts: 668
DGAVCIndexNVManual Command-Line Interface

no DGIndexNVManual yet but same switces apply

Last edited by MuLTiTaSK; 26th December 2009 at 17:32.
MuLTiTaSK is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.