View Full Version : DGDecIM: Frame-accurate Avisynth source filter for QuickSync
Pages :
[
1]
2
3
4
5
6
7
8
9
10
11
Guest
14th February 2014, 20:23
I've made enough progress on supporting the Intel Media SDK in DGDec to start a new thread. I plan to have DGDec support both nVidia and Intel decode engines but for the purposes of this thread I will call it DGDecIM.
The chick has poked its head through the eggshell but still has to wriggle its whole body out. What I have done is this: I made a DGI for an AVC stream (panama.264 famous in another thread) using DGIndexNV in the normal way. Then I modified DGDecodeNV to support the Intel decode engine using the same DGI file. Random access is working fine and I get over 200fps for a 1080p stream with 8% CPU usage in QuickSync mode. Pretty fine! The implementation uses what I called a potential simplified design in the DGMVCSource thread, so that one thread and consequent synchronization (with large Windows scheduling delays) is eliminated, significantly increasing the decode frame rate.
Before releasing a beta, I still need to add VC1 and MPEG2 and generally check robustness and end of stream handling. Also, I can consider adding support for Intel HW cropping/resizing, deinterlacing, IVTC, etc., and add MVC support. But things are looking good!
-----
Current version:
http://neuron2.net/misc/dgdecim_b20.zip
-----
NOTES ON POSTING IN THIS THREAD:
Rules 3 and 11 (rules (http://forum.doom9.org/forum-rules.htm)) are enforced broadly in this thread and posters are asked to make sure all posts have useful technical content and/or report defects. Requests about status of developments, expressions of approval or disapproval thereabout, chit-chat, and other random nontechnical posts are eschewed and may be deleted. I believe this policy results in a more useful and readable thread. Thank you for your understanding and cooperation.
Posts reporting defects should provide a source stream, the Avisynth script, and instructions for demonstrating the defect with that same source stream and script.
mastrboy
15th February 2014, 14:56
It has begun :)
Will it be licensed as DGIndexNV is? and if so, would existing DGIndexNV users be able to reuse their licenses or would it require a new one?
Guest
15th February 2014, 18:15
I haven't decided about that stuff yet.
Guest
16th February 2014, 01:13
Status update: I have implemented the EOS stream handling and it is working fine. I have added support for MPEG2 and VC1. Unfortunately, the current HW support for VC1 is broken (http://software.intel.com/en-us/forums/topic/494916) and a fix is expected possibly at the end of February. The VC1 support works fine in SW mode (which is way slower of course) so I will release a beta that forces SW mode for VC1 input. I want to do a little more testing and then I'll give you guys a beta, possibly as early as tomorrow.
Guest
16th February 2014, 17:08
Here is beta 1:
http://neuron2.net/misc/dgdecodeim_b1.zip
As mentioned earlier, this requires you to use DGIndexNV to create your index file. I am working on an indexer that can be used without Nvidia.
Please read the Notes.txt document for usage information.
Your feedback will be appreciated.
EDIT: In some initial tests, QuickSync appears about 20-25% faster than CUVID.
Stereodude
16th February 2014, 19:39
1080i MPEG2 Intel engine:Number of frames: 10001
Length (hhh:mm:ss.ms): 000:05:33.700
Frame width: 1920
Frame height: 1080
Framerate: 29.970 (30000/1001)
Colorspace: YV12
Frames processed: 10001 (0 - 10000)
FPS (min | max | average): 79.22 | 320.96 | 191.33
CPU usage (average): 11%
Thread count: 31
Physical Memory usage (peak): 565 MB
Virtual Memory usage (peak): 715 MB
Time (elapsed): 000:00:52.272
1080i MPEG2 Nvidia engine:Number of frames: 10001
Length (hhh:mm:ss.ms): 000:05:33.700
Frame width: 1920
Frame height: 1080
Framerate: 29.970 (30000/1001)
Colorspace: YV12
Frames processed: 10001 (0 - 10000)
FPS (min | max | average): 68.01 | 261.23 | 141.07
CPU usage (average): 13%
Thread count: 6
Physical Memory usage (peak): 526 MB
Virtual Memory usage (peak): 625 MB
Time (elapsed): 000:01:10.896
Guest
16th February 2014, 19:50
Thanks, interesting! That's about 35% faster with 2% less CPU using QuickSync.
Now, if Intel can fix the VC1 HW support, we will be golden.
Stereodude
16th February 2014, 19:56
1080p H264 (Blu-Ray) Intel engine:Number of frames: 10000
Length (hhh:mm:ss.ms): 000:06:57.083
Frame width: 1920
Frame height: 1080
Framerate: 23.976 (24000/1001)
Colorspace: YV12
Frames processed: 10000 (0 - 9999)
FPS (min | max | average): 50.13 | 338.37 | 170.68
CPU usage (average): 4%
Thread count: 31
Physical Memory usage (peak): 571 MB
Virtual Memory usage (peak): 691 MB
Time (elapsed): 000:00:58.591
1080p H264 (Blu-Ray) Nvidia engine:Number of frames: 10000
Length (hhh:mm:ss.ms): 000:06:57.083
Frame width: 1920
Frame height: 1080
Framerate: 23.976 (24000/1001)
Colorspace: YV12
Frames processed: 10000 (0 - 9999)
FPS (min | max | average): 50.31 | 172.54 | 89.84
CPU usage (average): 3%
Thread count: 4
Physical Memory usage (peak): 475 MB
Virtual Memory usage (peak): 556 MB
Time (elapsed): 000:01:51.307
Guest
16th February 2014, 20:11
Wow! :scared:
Don't bother posting VC1 as HW acceleration is not yet implemented for Intel.
Stereodude
16th February 2014, 20:54
I have a troublesome 1080i MPEG-2 TS sample (http://www.sendspace.com/file/n3holw) for you.
AVS script:LoadPlugin("C:\HDTV Tools\DGDecIM\DGDecodeIM.dll")
DGSource("test_clip2.dgi",engine=0)
My findings:
The Intel engine will lock VD up when trying to step backward through the clip. To see this open the script in VD, jump to frame 125 (CTRL+G), and then press and hold down the left arrow on the keyboard.
The Nvidia engine doesn't lock up, but won't decode the clip correctly when stepping backward either (DGDecNV does the same thing also). To see this change the engine in the script, open the script in VD, jump to frame 125 (CTRL+G), and then step backward to frame 103 (or earlier).
DGMPGDec has no problem stepping backward with the clip.
The Intel engine and Nvidia engine don't return the same video. You can see this with the following script. Play/step to frame 24&25 and you'll see they're offset 1 frame from each other, yet both return 242 frames. FWIW, the Nvidia engine matches DGMPGDec with this test.LoadPlugin("C:\HDTV Tools\DGDecIM\DGDecodeIM.dll")
source1=DGSource("test_clip2.dgi",engine=0)
source2=DGSource("test_clip2.dgi",engine=1)
stackvertical(source1,source2)
Sharc
16th February 2014, 20:55
ok, I have prepared the .dgi with DGIndexNV.
How do I use DGDecodeIM now? DGsource(.....dgi, engine=1)? Can you perhaps post an example for a basic script?
Edit: I just got it....
Stereodude
16th February 2014, 20:56
Wow! :scared:I suppose I should mention I'm using a i7-4770k w/ HD 4600 integrated graphics and a GeForce GT440 (VP5).
Sharc
16th February 2014, 21:27
Here a problematic VC-1 interlaced source (http://www.mediafire.com/download/66cjz888bfha6xz/vc-1_hulk.m2ts).
SW decoding (engine=1); NVIDIA GForce 9600GS.
Reel.Deel
16th February 2014, 21:28
Hi neuron2,
Tried various Blu-ray/DVD sources and they all work with the Nvidia engine, but with the Intel engine VirtualDub instantly just hangs and no error message.
In AVSMeter I get the following message:
AVSMeter 1.7.6 (AVS 2.6, x86) by Groucho2004
Analysing script, please wait...
Return on error: error code -3, pipeline_decode.cpp 316
Don't know if this is any help but my CPU is a i7-4930k (http://ark.intel.com/products/77780) (no integrated graphics).
Guest
16th February 2014, 21:28
ok, I have prepared the .dgi with DGIndexNV.
How do I use DGDecodeIM now? DGsource(.....dgi, engine=1)? Can you perhaps post an example for a basic script?
Edit: I just got it.... Just for others then:
loadplugin("dgdecodeim.dll")
dgsource("file.dgi") #uses Intel
dgsource("file.dgi", engine=0) # uses Intel
dgsource("file.dgi", engine=1) #uses CUVID
Guest
16th February 2014, 21:34
Here a problematic VC-1 interlaced source (http://www.mediafire.com/download/66cjz888bfha6xz/vc-1_hulk.m2ts).
SW decoding (engine=1); NVIDIA GForce 9600GS. In what way is it problematic? Does it work in plain DGDecNV?
Guest
16th February 2014, 21:35
Hi neuron2,
Tried various Blu-ray/DVD sources and they all work with the Nvidia engine, but with the Intel engine VirtualDub instantly just hangs and no error message.
In AVSMeter I get the following message:
Don't know if this is any help but my CPU is a i7-4930k (http://ark.intel.com/products/77780) (no integrated graphics). I'll release a new beta this evening with some more tracing to see what is happening. I simply do not know if the Intel Media SDK will work in SW mode without integrated graphics. Further tracing will reveal the answer.
Stereodude
16th February 2014, 21:35
Don't know if this is any help but my CPU is a i7-4930k (http://ark.intel.com/products/77780) (no integrated graphics).If you don't have an iGPU do you have the QuickSync engine?
Sharc
16th February 2014, 21:42
In what way is it problematic? Does it work in plain DGDecNV?
It produces jerky playback and blended frames.
It works in plain DGDecNV, however there are few duplicated frames (hard telecined?) which cause some jerkyness, but no blended frames in DGDecNV.
Guest
16th February 2014, 21:43
If you don't have an iGPU do you have the QuickSync engine? Intel supports SW decoding also, so intuitively you wouldn't need an iGPU for that. Unless...even the SW support requires the appropriate Intel driver, which would not be installed on a system without an iGPU. We can do some tracing to see what is really true.
Guest
16th February 2014, 21:44
It produces jerky playback and blended frames.
It works in plain DGDecNV, however there are few duplicated frames (hard telecined?) which cause some jerkyness, but no blended frames in DGDecNV. DGDecodeNV() and DGDecodeIM(engine=1) should act the same. I will investigate it.
rack04
16th February 2014, 22:01
Intel supports SW decoding also, so intuitively you wouldn't need an iGPU for that. Unless...even the SW support requires the appropriate Intel driver, which would not be installed on a system without an iGPU. We can do some tracing to see what is really true.
What driver are you referring to? I just tried engine=0 and I get the same crash. I assume there is something that needs to be installed.
Guest
17th February 2014, 00:25
I'm talking about the Intel graphics driver. If you have an iGPU in your processor and you run Nvidia as your primary, you can still access QuickSync, but you have to enable the Intel GPU in the bios and then install the Intel driver as secondary. Then you will have both QuickSync and CUVID. I am still investigating what the situation is for Intel Media SDK in SW mode on a processor without an iGPU.
Guest
17th February 2014, 00:40
Don't know if this is any help but my CPU is a i7-4930k (http://ark.intel.com/products/77780) (no integrated graphics). Can you try installing the Intel Media SDK 2014 and let me know if that changes anything? There is this thing called a "mfx dispatcher" that calls the HW or the SW DLL. It seems the dispatcher is in the SDK. I'm just learning about this stuff along with you guys. ;)
http://software.intel.com/en-us/vcsource/tools/media-sdk
Also, can you try opening an AVC file with dgmvcsource() using SW mode (hw=1)?
Reel.Deel
17th February 2014, 01:00
Can you try installing the Intel Media SDK 2014 and let me know if that changes anything?
Is there another place where I can download this without registration?
Also, can you try opening an AVC file with dgmvcsource() using SW mode (hw=1)?
Tried the latest version with hw=1 and it works. Used the sample that was included in the earlier betas.
Guest
17th February 2014, 01:13
Is there another place where I can download this without registration? It's not a big deal. If you want to be on the bleeding edge, you sometimes need to do the needful. :D
Nevertheless, you're right, it seems a bit much to require end users to install an SDK.
Tried the latest version with hw=1 and it works. Used the sample that was included in the earlier betas. That changes things in a very positive way. ;) I will release a beta later today or tomorrow that allows you to force SW mode, and should get things working for you.
Thank you for the important test results! :thanks:
kypec
17th February 2014, 08:38
Also, can you try opening an AVC file with dgmvcsource() using SW mode (hw=1)?
That switch definition seems quite counter-intuitive, isn't it? :confused:
I'd expect that forcing software mode should be activated by either hw=0 or sw=1...
Guest
17th February 2014, 16:08
That switch definition seems quite counter-intuitive, isn't it? :confused:
I'd expect that forcing software mode should be activated by either hw=0 or sw=1... The documentation explains that "hw" is an integer offering various choices and not a boolean. "hw" is renamed as "engine" for DGDecIM, and if you understand it that way I'm sure the confusion will dissolve away.
Guest
17th February 2014, 18:06
Here is beta 2 with expanded engine options. You can force SW for Intel, for example.
http://neuron2.net/misc/dgdecodeim_b2.zip
@Reel.Deel
This should fix your issue. I expect it to work either with Intel auto or Intel SW in your system. Please advise your results.
EDIT: Please use beta 3 and make sure you have libmfxsw32.dll co-located with dgdecodeim.dll.
rack04
17th February 2014, 18:16
I assume I can test this software by using a computer with Nvidia card to index using DGDecNV and then transfer that index file to a laptop without a Nvidia card to test using iGPU?
Guest
17th February 2014, 18:24
I assume I can test this software by using a computer with Nvidia card to index using DGDecNV and then transfer that index file to a laptop without a Nvidia card to test using iGPU? That will work as long as the paths in the DGI file are correct after moving to the laptop. You can edit the DGI file as needed or deselect 'use full paths' when you make the index file.
This will be moot soon as I am working on the stand-alone indexer.
Stereodude
17th February 2014, 19:19
Here is beta 2 with expanded engine options. You can force SW for Intel, for example.
http://neuron2.net/misc/dgdecodeim_b2.zipengine=2 instantly crashes VirtualDub when I try it on the files I previously tested with. 0, 1 and 3 work okay.
Guest
17th February 2014, 19:26
OK, thanks, checking...
Guest
17th February 2014, 19:27
engine=2 works fine for me. Do you have the libmfxsw32.dll in the same place as dgdecodeim.dll?
I have added the libmfxsw32.dll to the ZIP and revised the Notes to mention it. If this turns out to be the reason for your crash I will fix up the error checking to be a little more helpful. :)
Guest
17th February 2014, 19:37
OK, my bad...
I have to add the code to find libmfxsw32 as it is in DGMVCSource. For now, put it in the system dir and I will release a fixed beta.
Thanks for pointing this out.
Stereodude
17th February 2014, 19:41
engine=2 works fine for me. Do you have the libmfxsw32.dll in the same place as dgdecodeim.dll?
I have added the libmfxsw32.dll to the ZIP and revised the Notes to mention it. If this turns out to be the reason for your crash I will fix up the error checking to be a little more helpful. :)I didn't have it. I wasn't aware that there was any requirement for an extra file. I have subsequently added it into C:\HDTV Tools\DGDecIM\ where DGDecodeIM.dll is, but the crash is the same.
Here's the crashinfo from VD (http://www.sendspace.com/file/1cz8bi).
Stereodude
17th February 2014, 19:44
I have to add the code to find libmfxsw32 as it is in DGMVCSource. For now, put it in the system dir and I will release a fixed beta.So, that's C:\Windows\SysWOW64 on a x64 system... Works now.
Guest
17th February 2014, 19:48
Here is beta 3 with the correct dll loading code. Now the libmfxsw32.dll can be put with dgdecodeim.dll and you don't need to put it in the system directory.
http://neuron2.net/misc/dgdecodeim_b3.zip
Thanks again for your test results.
Stereodude
17th February 2014, 19:50
For whatever it's worth, the Intel SW engine has all the same problems (lockup stepping backward and returning at least part of the the video offset by 1 frame) as the HW engine that I detailed in this post (http://forum.doom9.org/showthread.php?p=1668691#post1668691).
Guest
17th February 2014, 19:52
I have a troublesome 1080i MPEG-2 TS sample (http://www.sendspace.com/file/n3holw) for you. Thanks. I'll look into it.
Stereodude
17th February 2014, 19:54
Here is beta 3 with the correct dll loading code. Now the libmfxsw32.dll can be put with dgdecodeim.dll and you don't need to put it in the system directory.
http://neuron2.net/misc/dgdecodeim_b3.zipI can confirm it works without libmfxsw32.dll in the system directory.
Guest
17th February 2014, 19:56
I can confirm it works without libmfxsw32.dll in the system directory. Thank you.
CarlPig
17th February 2014, 22:24
I can't get it to work, because i got this error: error=0x7e
Guest
17th February 2014, 23:26
I can't get it to work, because i got this error: error=0x7e What did you do and where did you see that error? What is the input file information, your script, etc?
CarlPig
18th February 2014, 00:11
1. Created the dgi file on one of my 2 pc's with DGIndexNV 2046 and NVIDIA Geforce GTX 560 TI.
2. Created a avs file to the dgi file and it worked on that pc.
3. Moved all 3 files, a mkv file with mpeg2 codec, the dgi file and the avs file to my other pc with QuickSync.
4. Extracted the beta 3 to DGIndexNV folder.
5. Corrected the dgi file and avs file with the new paths for the mkv file and replaced DGDecodeNV.dll with DGDecodeIM.dll ind the avs file.
6. Installed Intel Media SDK 2014
7. Replaced fieldop=0 with engine=1
Note: engine=0 gives the same error.
http://cloudho.st/i/2h5KfT7D.png
Script:
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgindexnv\DGDecodeIM.dll")
DGSource("C:\Video\New folder\KS1975.dgi", engine=1)
Guest
18th February 2014, 01:33
Do you have libmfxsw32.dll in the same directory as dgdecodeim.dll?
Please show a screenshot of windows explorer open to C:\Program Files (x86)\MeGUI\tools\dgindexnv.
Your Avisynth installation may be missing some run-time DLLs. Are other scripts running OK? DGMVCSource?
Reel.Deel
18th February 2014, 02:39
@Reel.Deel
This should fix your issue. I expect it to work either with Intel auto or Intel SW in your system. Please advise your results.
EDIT: Please use beta 3 and make sure you have libmfxsw32.dll co-located with dgdecodeim.dll.
Thanks for the quick update, I just quickly tried with engine=0 and engine=2 and both work. Unfortunately the speed it's not very good. With AVSMeter I get 34fps with Intel SW and 150fps with Nvidia.
Is there any room for improvement in this area or is it all up to Intel?
CarlPig
18th February 2014, 08:15
Do you have libmfxsw32.dll in the same directory as dgdecodeim.dll?
Please show a screenshot of windows explorer open to C:\Program Files (x86)\MeGUI\tools\dgindexnv.
Your Avisynth installation may be missing some run-time DLLs. Are other scripts running OK? DGMVCSource?
My DGIndexNV Dir: http://cloudho.st/i/TfRMPV7D.png
DGMVCSource comes with this error message when i use a mkv: http://cloudho.st/i/I4XLQV7D.png
But if i demux the h264 stream out of the mkv file and open it with DGMVCSource it works.
This works:
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgmvcdecode\dgmvcdecode.dll")
DGMVCSource("C:\Video\New folder\station.2-001.h264","",view=0,frames=1000,hw=1)
But this one do not work, it gives that error i have linked to a little further up in this post:
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgmvcdecode\dgmvcdecode.dll")
DGMVCSource("C:\Video\New folder\station.2-001.mkv","",view=0,frames=1000,hw=1
Note: I have installed the newest chipset, graphics driver and Intel Media SDK 2014
My mainboard is a ASUS Z87-K
My CPU is a i5-4670 with integrated graphics
ryszardzonk
18th February 2014, 14:22
My digital platform have recently upgraded to new http://www.ericsson.com/ourportfolio/products/avp-4000-family system and I am kinda forced to upgrade from the ancient DGIndex/DGAVCIndex as more and more streams appeared in new format and was about to go with DiAVC + DGAVCDecDI (as I have no Nvidia card), but I read this DGDecIM appeared :)
My question is would DGDecIM work on any Intel CPU (using sw for non Quicksync platform) and if yes than what do I need to get it to work besides purchasing license for DGDecNV which I am about to do shortly ;)
Guest
18th February 2014, 15:10
Thanks for the quick update, I just quickly tried with engine=0 and engine=2 and both work. Unfortunately the speed it's not very good. With AVSMeter I get 34fps with Intel SW and 150fps with Nvidia.
Is there any room for improvement in this area or is it all up to Intel? It's all up to Intel. Anyway, the point of this development is to get QuickSync support. The SW support is a bonus.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.