[RESOLVED] DGAvcDecDI crashes when playing mkv-file

Support forum for DGAVCDecDI
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

There is an example.

http://www.filefactory.com/file/b4f9h39 ... seless.264

MD5: 178CB2406C737728C6AD2A2CA16DE9AD
Size: 28'586'623 b


By the way, I can't play this file with your soft. But the same file wrapped in mkv container by x264.exe encoder - I can.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

It has the same problem with illegal frame_num value.

What are you using to encode this? Is it an official version of x264.exe? If so, you could ask the x264 guys about it.
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

admin wrote:It has the same problem with illegal frame_num value.

What are you using to encode this? Is it an official version of x264.exe? If so, you need to ask the x264 guys why they are generating illegal files.
Yes, it is official version. I took it from x264.nl. Thank you for your analysis. I doubt whether I will ask developers about anything. I really don't know what I should say them. Again, I'm just an amateur and I know nothing about the standards. Sorry for disturbing you and thanks for help.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

You're not disturbing me; I appreciate you bringing this issue to light.

Looking closer at the spec, I see I have to parse the SPS differently when profile=244, so I am probably reading the wrong frame_num value. I will continue investigating.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

I have revised the parsing to allow for profile 244 and I now have your stream playing fine without crashing. I will release a new revision this evening if my regression testing goes without surprises.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

Build 2025 is now available.
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

Thank you very much, Donald.

It works fine now. But... When I am using SetMTMode in my Avisynth script it crashes. There is no such problem when I am opening source file with DSS2() plugin instead of DGSource(). DSS2() comes with HAALI media splitter - avss.dll. Source file is big enough (about 18Gb), so I don't know how to load it. But it was made in the same way as example from this thread. Application crashes from very beginning, before encoding starts.

Script looks like following

Code: Select all

SetMemoryMax(1200)
SetMTMode(5,4)

DGSource("my_file.dgi")
#DSS2("my_file.mkv")

SetMTMode(2)

super = MSuper(pel=2, sharp=2)
backward_vec2 = MAnalyse(super, isb=true, delta=2, overlap=4)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=4)
forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=4)
forward_vec2 = MAnalyse(super, isb=false, delta=2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)

return last
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

I don't know anything about MT and have no interest in installing it.

Didée is our local expert on this. He has performed similar experiments for DGDecNV. Maybe you'd like to ping him about this.
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

Ok, thank you.

May be you know some other way how to reach multi-threading processing in your application? I read a little about decoder you are using in your application. It is multi-threaded in its nature. But I see that only one core used when I am processing my video. It is not very effective I think.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

I believe you have to not attempt to multithread the source filter but only the remaining part of the script. I know that DiAVC is multithreaded and I see it using multiple threads on my PC. So perhaps you have it misconfigured. Please consult DIAVC for assistance in that regard.
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

Well. May be you are right regarding decoder misconfiguration. The matter is that trial version has no configuration tool at all. :) Only file diavc.ax. I know this is not your area. It's just my think aloud.

BTW. May be you will be interested. I've asked regarding my problem in DiAVC thread elsewhere.

I do not know really if this reply correct or not. But until now there are no others.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

As I said, do not attempt to MT the DGSource() filter. Use DiAVC's integral multithreading.

DGSource() code itself is thread-safe. It's the combination with DiAVC that causes the issue, I believe.
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

Ok. I think I understand you.

Can you propose some test case regarding stable multi-threading with DGSource+DiAVC? I mean some avisynth script. Because you've told that in your computer everything works fine.
I know that DiAVC is multithreaded and I see it using multiple threads on my PC.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

Just use DGSource() and enable multithreading in the DiAVC configuration.
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

I don't understand how it could be reached within Avisynth (and with trial version of DiAVC)?

Do you mean something like that?

Code: Select all

DGSource("my_file.dgi")

super = MSuper(pel=2, sharp=2)
backward_vec2 = MAnalyse(super, isb=true, delta=2, overlap=4)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=4)
forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=4)
forward_vec2 = MAnalyse(super, isb=false, delta=2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
or may be something like following?

Code: Select all

DGSource("my_file.dgi")

SetMTMode(2)

super = MSuper(pel=2, sharp=2)
backward_vec2 = MAnalyse(super, isb=true, delta=2, overlap=4)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=4)
forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=4)
forward_vec2 = MAnalyse(super, isb=false, delta=2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
Which one example is correct for using multithreading in Avisynth? Please specify.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

I've found some code that makes DGSource() not thread-safe, and therefore not compatible with MT. I have corrected it and slipstreamed it into build 2025. So redownload build 2025 and update DGAVCDecodeDI.dll. Please test it and report your results.
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

Thank you. I've downloaded last version. And what I have.

This code works properly but only with 1 thread (please pay your attention on comments within script).

Code: Select all

DGSource("my_file.dgi")

SetMTMode(2)
# or SetMTMode(2,0) or SetMTMode(2,3) or SetMTMode(2,4)

super = MSuper(pel=2, sharp=2)
backward_vec2 = MAnalyse(super, isb=true, delta=2, overlap=4)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=4)
forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=4)
forward_vec2 = MAnalyse(super, isb=false, delta=2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
Following code crashes all time when I am using x264 coder.

Code: Select all

SetMTMode(5)
# or SetMTMode(5,0) or SetMTMode(5,2) or SetMTMode(5,3) or SetMTMode(5,4)

DGSource("my_file.dgi")

SetMTMode(2)

super = MSuper(pel=2, sharp=2)
backward_vec2 = MAnalyse(super, isb=true, delta=2, overlap=4)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=4)
forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=4)
forward_vec2 = MAnalyse(super, isb=false, delta=2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
Following code crashes all time when I am using x264 coder. And it only works once with VirtualDub(I was unable to repeat this result later).

Code: Select all

SetMTMode(5,4)

DGSource("my_file.dgi")

SetMTMode(2,4)

super = MSuper(pel=2, sharp=2)
backward_vec2 = MAnalyse(super, isb=true, delta=2, overlap=4)
backward_vec1 = MAnalyse(super, isb=true, delta=1, overlap=4)
forward_vec1 = MAnalyse(super, isb=false, delta=1, overlap=4)
forward_vec2 = MAnalyse(super, isb=false, delta=2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

That's all I can do for you on this issue. Use your first script.
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

This is certainly not what I expected. DSS2() can work stable with multi-threading in all these scripts. But... That's something at least.
Thanks.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

You need to ask DiAVC about it. I have confirmed that DGSource() itself is threadsafe. I can open a script several times in simultaneous VirtualDub instances and they play fine and independently.

Beyond that, it's your problem to get MT working. I know nothing about it, and more precisely, I don't care at all about it. And what are you after anyway? The source filter is already multithreaded and the remainder of your script is running fine under MT. What are you trying to achieve by MT'ing the souce filter?

You are free to use DSS2() if that works better for you. :)
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

admin wrote:You need to ask DiAVC about it. I have confirmed that DGSource() itself is threadsafe. I can open a script several times in simultaneous VirtualDub instances and they play fine and independently.
As far as I know possibility to run several applications simultaneously is not equal to multi-threading. Threadsafe means that you can run several threads within one application process in operating system. It is because every process runs in its own memory area which is isolated from other processes. But threads run in shared memory area which one process owns.
admin wrote:Beyond that, it's your problem to get MT working. I know nothing about it, and more precisely, I don't care at all about it.
Yes, you told me already about it. It is a pity (for me of course).
admin wrote:And what are you after anyway? The source filter is already multithreaded and the remainder of your script is running fine under MT. What are you trying to achieve by MT'ing the souce filter?
I am trying to use all cores of my CPU. I don't know exactly how it works with DSS2() but it works smoothly on all cores and when I am not MT'ing before this filter it works on one core only. The same situation with your plug-in - it can works on one core only when I am not turning on MT before it.

May be MT spawns several threads when filter loads the video. And consequent filters runs within these threads.
admin wrote:You are free to use DSS2() if that works better for you. :)
I know, I know... But DiAVC decoder is better than it analogues. So I tried to use it.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

I know, I know... But DiAVC decoder is better than it analogues. So I tried to use it.
What makes you think that DSS2() cannot use the DiAVC decoder?

One more time: DiAVC runs multithreaded distributed on all your CPUs. There is no need to try to instantiate DGSource() multiple times. If you cannot get DiAVC to use all your cores, then again, talk to DiAVC about it!
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

admin wrote:
I know, I know... But DiAVC decoder is better than it analogues. So I tried to use it.
What makes you think that DSS2() cannot use the DiAVC decoder?
At present I not quite understand how to make it work with DiAVC.
admin wrote:One more time: DiAVC runs multithreaded distributed on all your CPUs. There is no need to try to instantiate DGSource() multiple times. If you cannot get DiAVC to use all your cores, then again, talk to DiAVC about it!

On forum.doom9.org I've got reply regarding this. There is no need to perform special action to force decoder for using multithreading.

And I've notice that when I run following script within VirtualDub all my cores were used. But that happened only one time and only within VirtualDub

Code: Select all

SetMTmode(5,4)
DGSource()
SetMTMode(2,4)
May be MT spawns several threads when filter is loading the video. And consequent filters run within these threads. I think this explanation is reasonable. Every filter (including DGSource) runs in its own thread which has been spawned by MT.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: DGAvcDecDI crashes when playing mkv-file

Post by admin »

What version of Avisynth are you running? Also, what version of MT.dll?

If you give me enough information I will try to duplicate the issue.
DAE avatar
prokhozhijj
Posts: 30
Joined: Sat Jan 01, 2011 11:16 am

Re: DGAvcDecDI crashes when playing mkv-file

Post by prokhozhijj »

I have usual Avisynth (last 32-bit version from SourceForge) and MT-libraries from SEt version 2009.07.12. I've got Avisynth MT here http://forum.doom9.org/showthread.php?p ... ost1301410

There are my Avisynth files

http://www.filefactory.com/file/b4g40cf ... isynth.zip

MD5: 869C8001ACF985372DC9E0F7A8328745
Size: 2'200'278
Post Reply