View Full Version : DGDecIM: Frame-accurate Avisynth source filter for QuickSync
Pages :
1
[
2]
3
4
5
6
7
8
9
10
11
Guest
18th February 2014, 15:12
But if i demux the h264 stream out of the mkv file and open it with DGMVCSource it works.
OK, thanks, I know what the problem is and will fix it for the next beta. MKV input is broken for MPEG2 and VC1 (AVC is OK) with Intel Media SDK. Please test only with elementary streams from MPEG2 or VC1 MKVs until then.
It's interesting because this bug has been there in DGDecNV all along but the NV decoder doesn't mind seeing double start code prefixes. :)
Guest
18th February 2014, 15:15
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 ;) It should work but I haven't decided about licensing yet. Most likely I will cover it under the DGDecNV license as you suggested. Remember, though, this is still under development, I haven't formally announced anything or made a release for general availability. And during this early development period you will need Nvidia HW to run DGIndexNV to generate your index files.
CarlPig
18th February 2014, 16:04
OK, thanks, I know what the problem is and will fix it for the next beta. Please test only with elementary streams until then.
Ok good to know.
Guest
18th February 2014, 21:59
Ok good to know. Just to clarify, only MPEG2 and VC1 MKV files are affected.
Guest
19th February 2014, 22:54
Here is beta 4:
http://neuron2.net/misc/dgdecim_b4.zip
The problem with MPEG2 and VC1 in MKV containers is fixed.
A quick-and-dirty indexer for non-Nvidia systems is included. It requires the standard license so your existing licenses will work. Those people without Nvidia systems can get a license and then be able to operate on a non-Nvidia system. Please be aware that we are still in early development but things are pretty much working.
CarlPig
20th February 2014, 01:18
I need a license to my non-Nvidia system, because i only have a license to my Nvidia system.
Guest
20th February 2014, 01:40
Ah, I forgot about that! :scared: How to get the machine ID? Standby...
Guest
20th February 2014, 01:55
Re-download beta 4. Now if you type 'dgindexim' without parameters in a DOS window you will see the machine ID.
Guest
20th February 2014, 02:00
Sorry, re-download as I made a quick bug fix in the machine ID printing (to show as uppercase).
CarlPig
20th February 2014, 02:05
Ok i will re-download and trying it.
CarlPig
20th February 2014, 02:46
Now i get the machine ID, i can get it when i type dgindexim in DOS or double clicking on the indexer.
I have indexed a MKV with MPEG2 and get the dgi file.
But i still get this error: "error=0x7e" when i trying to open my script.
Guest
20th February 2014, 02:59
Please give me the input file.
CarlPig
20th February 2014, 03:10
I can not give you a sample right now, because my internet connection is too slow.
so I have to wait until my family gets up when they are sleeping now, so i can borrow their internet connection.
Guest
20th February 2014, 03:13
You can cut a smaller piece. Anyway, I wait for your sample. Also please give your script.
CarlPig
20th February 2014, 03:17
Here:
LoadPlugin("C:\Video\New folder\DGDecodeIM.dll")
DGSource("C:\Video\New folder\KS1975.dgi", engine=1)
Guest
20th February 2014, 07:50
That forces Intel HW. Didn't you say you had no iGPU? Did you try engine=2 for SW?
CarlPig
20th February 2014, 13:34
Here is a sample:
http://www.mediafire.com/download/q1ir8yzyj11noxa/KM1975.Sample.mkv
I do not know specifically what iGPU is, and I do not think that I find something useful by writing iGPU on Google.
And i got the same error with both engine=0,1 and 2.
Guest
20th February 2014, 16:26
iGPU refers to an Intel GPU integrated into the CPU.
Everything works fine for me here with your sample. Can you please do these three things to help find out why it is not working for you:
1. Give details of your processor.
2. Run the system analyzer tool from the Intel Media SDK install and show the output. The analyzer is in the tools folder.
3. Run Dependency Walker on dgdecodeim.dll and report any unresolved DLLs.
CarlPig
20th February 2014, 17:22
My mainboard is a ASUS Z87-K: https://www.asus.com/Motherboards/Z87K/
My CPU is a i5-4670: http://ark.intel.com/products/75047/
Intel Media SDK System Analyzer (64 bit)
The following versions of Media SDK API are supported by platform/driver:
Version Target Supported Dec Enc
1.0 HW Yes X X
1.0 SW Yes X X
1.1 HW Yes X X
1.1 SW Yes X X
1.3 HW Yes X X
1.3 SW Yes X X
1.4 HW Yes X X
1.4 SW Yes X X
1.5 HW Yes X X
1.5 SW Yes X X
1.6 HW Yes X X
1.6 SW Yes X X
1.7 HW Yes X X
1.7 SW Yes X X
1.8 HW No
1.8 SW Yes X X
Graphics Devices:
Name Version State
Intel(R) HD Graphics 4600 10.18.10.3345 Active
System info:
CPU: Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz
OS: Microsoft Windows 8.1 Pro
Arch: 64-bit
Installed Media SDK packages (be patient...processing takes some time):
Intel« Media SDK 2014 for Clients (x64)
Installed Media SDK DirectShow filters:
Installed Intel Media Foundation Transforms:
Intel« Hardware M-JPEG Decoder MFT : {00C69F81-0524-48C0-A353-4DD9D54F9A6E}
Intel« Quick Sync Video H.264 Encoder MFT : {4BE8D3C0-0515-4A37-AD55-E4BAE19AF471}
Here is a screenshot from Dependency Walker: http://cloudho.st/i/6GkKqoXd.png
Guest
20th February 2014, 17:35
Thank you, Carl, that is great info and I can see the problem now from your DLL trace.
DGDecodeIM currently supports also the Nvidia engine via engine=3. It is desirable to be able to support all the available engines but if done simply as I have done, the DLL will have dependencies on all the DLLs associated with the various engines. In your case it fails to find the CUDA/CUVID DLLs because they are not installed.
I can either try to find a way to support all the engines in one filter using some tricks for DLL loading or I can release an Intel-only version that doesn't have dependencies on CUDA. I'll explore this today and make a decision. The easiest will be to make an Intel-only version. Either way you'll be able to run the code on your non-Nvidia system.
Thanks again for your help in uncovering this issue! :thanks:
CarlPig
20th February 2014, 17:45
I'm happy to help you.
Guest
20th February 2014, 18:06
Carl, can you please try this DLL? I did a quick and dirty removal of CUDA dependencies. Don't try engine=3!
http://neuron2.net/misc/Carl.zip
CarlPig
20th February 2014, 20:51
It working, i have now converted a movie.
I have used engine=1
Guest
20th February 2014, 21:49
OK, great! I'll make a clean new beta and we can open this to a wider audience.
Your assistance is greatly appreciated.
CarlPig
20th February 2014, 21:54
Thanks.
Guest
20th February 2014, 22:56
Here's beta 5, the first usable version for non-Nvidia users.
http://neuron2.net/misc/dgdecim_b5.zip
Next I will integrate the indexer into the source filter and then start addressing the problem streams that have been mentioned. Also, I want to look at performance because pistacho says 700fps is possible. :) There is a doubtful Sleep() call in the decode sample, and other things to look at.
Sharc
20th February 2014, 23:58
4. The engine options chooses the decoding engine.
engine = 0: Intel automatic (uses HW if available, otherwise uses SW)
engine = 1: Intel HW
engine = 2: Intel SW
So for Nvidia it is engine=0, or is Nvidia no more included?
Sharc
21st February 2014, 00:03
DGDecodeNV() and DGDecodeIM(engine=1) should act the same. I will investigate it.
Did you have a chance to look at it?
Guest
21st February 2014, 00:17
That's in the problem stream category. Still working on basic functionality at this point. All reports have been noted and will be addressed.
CarlPig
21st February 2014, 00:18
Intel HW cropping/resizing and deinterlacing will be great to have.
Guest
21st February 2014, 02:22
So for Nvidia it is engine=0, or is Nvidia no more included? Nvidia is not included. Future may bring it back if DLL tricks can be played.
lansing
21st February 2014, 02:56
I tested with a 1080p mp4 that I downloaded from youtube, on my i7 4770k @ 4.3Ghz, HD4600.
avsmeter reads:
Number of frames: 9419
Length (hhh:mm:ss.ms): 000:05:14.281
Frame width: 1920
Frame height: 1088
Framerate: 29.970 (2997/100)
Interlaced: No
Colorspace: YV12
Frames processed: 9419 (0 - 9418)
FPS (min | max | average): 125.1 | 439.3 | 374.5
CPU usage (average): 10%
Thread count: 39
Physical Memory usage (peak): 168 MB
Virtual Memory usage (peak): 322 MB
Time (elapsed): 000:00:25.154
the frame height was wrong. And the index note doesn't have the display size and frame rate correct.
Stream Type: MP4
Video Type: AVC
Profile: High
Level: 4
Coded Size: 1920x1088
SAR: 1:1
Display Size: 0x0
Frame Rate: 0.000000 fps
Colorimetry: BT.709 [1]*
Frame Structure:
Frame Type:
Coded Number: 9419
Playback Number: 9419
Frame Repeats: 0
Field Repeats: 0
Bitrate:
Bitrate (Avg):
Bitrate (Max):
Audio Stream: 1: MPEG-4 AAC LC 126kbps 44100 2ch
Elapsed:
Remain: 0:00:00
FPS:
Info: Finished!
lansing
21st February 2014, 03:24
with a concert h264 bd muxed into mkv.
Intel QuickSync HW
Frames processed: 14120 (0 - 14119)
FPS (min | max | average): 108.9 | 378.0 | 273.9
CPU usage (average): 10%
Thread count: 39
Physical Memory usage (peak): 185 MB
Virtual Memory usage (peak): 332 MB
Time (elapsed): 000:00:51.556
with nvdia gtx 650 ti boost
Frames processed: 4540 (0 - 4539)
FPS (min | max | average): 106.5 | 186.4 | 142.1
CPU usage (average): 3%
Thread count: 16
Physical Memory usage (peak): 76 MB
Virtual Memory usage (peak): 179 MB
Time (elapsed): 000:00:31.951
Guest
21st February 2014, 03:27
That's great performance.
The height is the coded frame height, it is not wrong.
The log is a remnant of the GUI DGIndexNV and will be removed along with other obsolete stuff.
lansing
21st February 2014, 04:15
with a concert 1080 mpeg2
Intel QuickSync
Frames processed: 5200 (0 - 5199)
FPS (min | max | average): 110.9 | 314.2 | 254.8
CPU usage (average): 15%
Thread count: 40
Physical Memory usage (peak): 179 MB
Virtual Memory usage (peak): 299 MB
Time (elapsed): 000:00:20.409
Nvidia VP5 card
Frames processed: 8000 (0 - 7999)
FPS (min | max | average): 193.8 | 392.2 | 286.0
CPU usage (average): 17%
Thread count: 16
Physical Memory usage (peak): 132 MB
Virtual Memory usage (peak): 191 MB
Time (elapsed): 000:00:27.976
one thing I notice is that when running nvidia card on mpeg2 video, its video engine stayed at 0% + 33% GPU loaded as shown in gpu-z. While when running on h264 video, the video engine was 99% loaded and 5% gpu load.
And for iGPU, its gpu usage scales with the speed. For the highest speed so far 374fps, gpu load is 15%; for 254fps, it's 9%.
Guest
21st February 2014, 04:19
Check the INI file and manual description for DGIndexNV. CUDA versus CUVID may make a difference.
lansing
21st February 2014, 06:08
Check the INI file and manual description for DGIndexNV. CUDA versus CUVID may make a difference.
I'm using beta4 for this run and seems like the decode mode switch for AVC stream was broken, when I changed the decode_mode in the dgi file to 1,1,1 or 0,0,0 to have them all use CUDA or CUVID, only the MPEG2 stream really shows any effect: I could see a switch of usage from gpu load to video engine load in GPU-Z. The AVC stream has no effect though, as it stayed using the video engine on all three switches.
Guest
21st February 2014, 16:00
Yes, this behavior is known and that is why I pointed it out.
Please always use the latest beta going forward.
lansing
21st February 2014, 17:31
I thought you mentioned that beta5 didn't have Nvidia engine, that's why I'm using beta4.
I really look forward to the HW IVTC by the Intel engine in the near future, since TIVTC in both Avisynth+ and Vapoursynth weren't doing so great with 1080 videos, I only got 50-60fps.
Guest
21st February 2014, 17:36
I thought you mentioned that beta5 didn't have Nvidia engine, that's why I'm using beta4. Well, since you have an Nvidia system you can run DGDecodeNV for comparisons. :sly: The index file is common between the two.
I really look forward to the HW IVTC by the Intel engine in the near future Yes, I'll be excited to experiment with it and see what it can do.
lansing
21st February 2014, 22:35
I can confirm that pistacho's MVCsource with latest available version 2.1.1 did reached over 600fps AVC decoding @ 24% GPU loaded. Props to him.
Number of frames: 116220
Length (hhh:mm:ss.ms): 001:04:37.874
Frame width: 1920
Frame height: 1080
Framerate: 29.970 (60000/2002)
Interlaced: No
Colorspace: YV12
Frames processed: 52250 (0 - 52249)
FPS (min | max | average): 287.9 | 707.7 | 606.7
CPU usage (average): 11%
Thread count: 35
Physical Memory usage (peak): 205 MB
Virtual Memory usage (peak): 314 MB
Time (elapsed): 000:01:26.120
And I test Cyberlink's MediaEspresso, looks like it uses Nvidia CUVID for hw decoding and Intel QuickSync for hw encoding when both devices are present, and both device ran at 99% loaded when active. Since the hw encoding side of iGPU can max out the usage, I suspect it can be the same for hw decoding too. Well, like maybe 50% GPU load at 1000+fps? lol
Guest
21st February 2014, 22:52
pistacho's done a great job refactoring, though it's a shame he seems reluctant to share his tricks with us. Nevertheless, I've already identified some changes that increase the frame rate (at the expense of CPU). I have reached 350 fps in a private build for a stream that previously ran at 200 fps and see other chances to improve that. I'll release those improvements at some point.
Frame accuracy is the first goal for me, however. As Avisynth expects source filters to be frame accurate, I believe that any source filter that is not frame accurate is either just some kind of decoding test bed or it is broken/crippled. Simulate a seek to near the end of a file by silently decoding the entire file!? No way to seek backward (beyond immediate Avisynth/application caching)?! Color me unimpressed. Sure, such filters can be useful in limited use cases, but why not implement frame accuracy when the methods are known and straightforward to implement?
Guest
21st February 2014, 23:08
Here is beta 6. You can specify the source stream instead of the index file in your script and then the DGI file will be automatically created if it does not exist.
http://neuron2.net/misc/dgdecim_b6.zip
With this I consider the basic functionality to be in place and we can start looking at problematic streams. I also have to create some documentation for QuickSync-only users. Then on to performance tweaking and Intel HW-based cropping/resizing/IVTC etc.
lansing
22nd February 2014, 00:09
Here is beta 6. You can specify the source stream instead of the index file in your script and then the DGI file will be automatically created if it does not exist.
http://neuron2.net/misc/dgdecim_b6.zip
With this I consider the basic functionality to be in place and we can start looking at problematic streams. I also have to create some documentation for QuickSync-only users. Then on to performance tweaking and Intel HW-based cropping/resizing/IVTC etc.
I tried the auto dgi generate, I dragged the avs to virtualdub and I saw the pop up message about index file being generating. However I waited for quite a while but still don't see any file generated and the pop up message just stayed there.
LoadPlugin("path\dgdecim_b6\DGDecodeIM.dll")
DGSource(xyz.mp4", engine=1)
Guest
22nd February 2014, 00:23
Try hitting OK! :D
Well alright I have updated beta 6 so that the dialog doesn't hold up the indexing and it dismisses itself after 10 seconds if you don't hit OK. Re-download it to get that change.
Even after the warning dialog dismisses, you have to wait until the indexing is complete, and then the first frame will be displayed in VirtualDub. Remember, indexing a BluRay can take 5 minutes or more! Shorter streams will finish much faster. I am welcome to ideas for improving the user interface.
lansing
22nd February 2014, 02:02
Try hitting OK! :D
Well alright I have updated beta 6 so that the dialog doesn't hold up the indexing and it dismisses itself after 10 seconds if you don't hit OK. Re-download it to get that change.
Even after the warning dialog dismisses, you have to wait until the indexing is complete, and then the first frame will be displayed in VirtualDub. Remember, indexing a BluRay can take 5 minutes or more! Shorter streams will finish much faster. I am welcome to ideas for improving the user interface.
still doesn't seem to work for me. After I drag the avs to virtualdub, immediate after the index generating message box, an error box pop up saying "failed to open input file".
Guest
22nd February 2014, 02:10
The script you posted is missing a quote. Could that be it? If not, please give your exact script. Also, verify your file name and path, as that is the obvious interpretation of the error message.
lansing
22nd February 2014, 02:35
ok i figured out the problem, the program filtered out all the space in the filename, so files with their file name contain spaces doesn't work.
Guest
22nd February 2014, 02:37
What program filtered them out? Your brain? :) Anyway, I am happy you have it working and thank you for your testing.
lansing
22nd February 2014, 02:46
i renamed the same file to "1.mp4" and it works, when I change it to "1 2.mp4" then it says "failed to open input file".
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.