View Full Version : Avisynth - DirectShowSource "CoInitialize has not been called.."
hristoff2
29th June 2007, 21:08
Hi guys, I'm getting this error:
Avisynth error:
DirectShowSource: Could not open as video or audio.
Video returned: "DirectShowSource: couldn't create filter graph:
CoInitialize has not been called. "
Audio returned: "DirectShowSource: couldn't create filter graph:
CoInitialize has not been called. "
..when huffing with avs2yuv, mencoder or opening anything via directshowsource in vdubmod. Vdub itself works for some reason, I can use direct input for x264 but it's way faster with prerendering.
Any suggestions?
I don't want to huff via vdub because I can't do prerendering and encoding to x264 in one step and it's necessary that I'm at the pc to start the encode (x264) - that's ok but not perfect. (And I didn't find out anything about that error..?)
h2
Fizick
30th June 2007, 11:05
Report versions anf other information.
hristoff2
30th June 2007, 13:56
Avisynth 2.57 retail, 2.58 (beta) - same error.
Windows XP Pro
Intel Core2Duo
Tried different versions of vdub, vdubmod, avs2yuv - same result. At the moment installed: newest vdub & vdubmod
That should be everything which would matter, if not please ask for it.
h2
foxyshadis
30th June 2007, 16:20
Always with the same file or format? Sounds like a bad directshow filter is calling CoUninitialize one time too many. The log may or may not help pinpoint the problem, I'm not sure. (logfile="somefile",logmask=-1)
hristoff2
30th June 2007, 16:43
This happens always with DirectShowSource here, the error isn't source depending - if it was, I wouldn't mind asking here :)
Opening the script with vdubmod, getting the error:
00:00:00.000 fff 0x00000000 DirectShowSource 2.5.7 build:Dec 24 2006 [20:11:50]
00:00:00.000 080 0x01302EE8 New GetSample (audio).
00:00:00.000 080 0x01302EE0 New DirectShowSource.
00:00:00.000 080 0x01302EE8 ~GetSample.
00:00:00.000 fff 0x00000000 Close audio log 2.
00:00:00.000 080 0x01302EE8 New GetSample (video).
00:00:00.000 080 0x01302EE0 New DirectShowSource.
00:00:00.000 080 0x01302EE8 ~GetSample.
00:00:00.000 fff 0x00000000 Close video log 2.
00:00:00.000 fff 0x00000000 Close Create_DirectShowSource Cleanup Handler log 1.
Opening the script with vdub, not getting the error:
00:00:00.000 fff 0x00000000 DirectShowSource 2.5.7 build:Dec 24 2006 [20:11:50]
00:00:00.000 080 0x015E39D8 New GetSample (audio).
00:00:00.000 080 0x015E39D0 New DirectShowSource.
00:00:00.001 040 0x015E39D8 GetSample::AddRef() -> 2
00:00:00.001 008 0x015E39D8 GetSample::JoinFilterGraph(0x015f61e0, GetSample)
00:00:00.001 008 0x015E39D8 GetSample::QueryInterface({8e1c39a1-de53-11cf-aa63-0080c744528d}, ppv) ** E_NOINTERFACE **
00:00:00.001 008 0x015E39D8 GetSample::QueryInterface({f90a6130-b658-11d2-ae49-0000f8754b99}, ppv) ** E_NOINTERFACE **
00:00:00.004 008 0x015E39D8 GetSample::EnumPins()
00:00:00.004 080 0x01612858 New GetSampleEnumPins.
00:00:00.004 040 0x015E39D8 GetSample::AddRef() -> 3
00:00:00.004 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.004 040 0x015E39D8 GetSample::Release() -> 2
00:00:00.004 080 0x01612858 ~GetSampleEnumPins.
00:00:00.004 008 0x015E39D8 GetSample::EnumPins()
00:00:00.004 080 0x01612858 New GetSampleEnumPins.
00:00:00.004 040 0x015E39D8 GetSample::AddRef() -> 3
00:00:00.004 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.004 020 0x015E39D8 GetSample::ConnectedTo() ** VFW_E_NOT_CONNECTED **
00:00:00.004 040 0x015E39D8 GetSample::Release() -> 2
00:00:00.004 080 0x01612858 ~GetSampleEnumPins.
00:00:00.004 040 0x015E39D8 GetSample::AddRef() -> 3
00:00:00.004 008 0x015E39D8 GetSample::EnumPins()
00:00:00.004 080 0x01612858 New GetSampleEnumPins.
00:00:00.004 040 0x015E39D8 GetSample::AddRef() -> 4
00:00:00.004 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.004 040 0x015E39D8 GetSample::AddRef() -> 5
00:00:00.004 008 0x015E39D8 GetSample::QueryPinInfo() 0x015e39d8
00:00:00.004 040 0x015E39D8 GetSample::Release() -> 4
00:00:00.004 020 0x015E39D8 GetSample::ConnectedTo() ** VFW_E_NOT_CONNECTED **
00:00:00.004 008 0x015E39D8 GetSample::QueryInternalConnections()
00:00:00.004 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.004 040 0x015E39D8 GetSample::AddRef() -> 5
00:00:00.004 001 0x015E39D8 GetSample::QueryAccept(audio) reject major type {e436eb83-524f-11ce-9f53-0020af0ba770}
00:00:00.004 020 0x015E39D8 GetSample::ReceiveConnection() ** VFW_E_TYPE_NOT_ACCEPTED **
00:00:00.004 040 0x015E39D8 GetSample::Release() -> 4
00:00:00.004 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.004 008 0x015E39D8 GetSample::EnumMediaTypes()
00:00:00.004 080 0x01612A00 New GetSampleEnumMediaTypes.
00:00:00.004 008 0x01612A00 GetSampleEnumMediaTypes::Next(1) pos=0
00:00:00.004 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.004 008 0x01612A00 GetSampleEnumMediaTypes::Next(1) pos=1
00:00:00.004 080 0x01612A00 ~GetSampleEnumMediaTypes.
00:00:00.004 040 0x015E39D8 GetSample::Release() -> 3
00:00:00.004 080 0x01612858 ~GetSampleEnumPins.
00:00:00.004 040 0x015E39D8 GetSample::Release() -> 2
00:00:00.101 040 0x015E39D8 GetSample::AddRef() -> 3
00:00:00.101 008 0x015E39D8 GetSample::QueryInterface({ebe1fb08-3957-47ca-af13-5827e5442e56}, ppv) ** E_NOINTERFACE **
00:00:00.101 040 0x015E39D8 GetSample::Release() -> 2
00:00:00.101 040 0x015E39D8 GetSample::AddRef() -> 3
00:00:00.101 008 0x015E39D8 GetSample::QueryInterface({ebe1fb08-3957-47ca-af13-5827e5442e56}, ppv) ** E_NOINTERFACE **
00:00:00.101 008 0x015E39D8 GetSample::EnumPins()
00:00:00.101 080 0x01928520 New GetSampleEnumPins.
00:00:00.101 080 0x01928520 ~GetSampleEnumPins.
00:00:00.101 008 0x015E39D8 GetSample::EnumPins()
00:00:00.101 080 0x01928520 New GetSampleEnumPins.
00:00:00.101 080 0x01928520 ~GetSampleEnumPins.
00:00:00.101 040 0x015E39D8 GetSample::Release() -> 2
00:00:00.116 040 0x015E39D8 GetSample::AddRef() -> 3
00:00:00.116 008 0x015E39D8 GetSample::EnumPins()
00:00:00.116 080 0x01928600 New GetSampleEnumPins.
00:00:00.116 040 0x015E39D8 GetSample::AddRef() -> 4
00:00:00.116 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.116 040 0x015E39D8 GetSample::AddRef() -> 5
00:00:00.116 008 0x015E39D8 GetSample::QueryPinInfo() 0x015e39d8
00:00:00.116 040 0x015E39D8 GetSample::Release() -> 4
00:00:00.116 020 0x015E39D8 GetSample::ConnectedTo() ** VFW_E_NOT_CONNECTED **
00:00:00.116 008 0x015E39D8 GetSample::QueryInternalConnections()
00:00:00.116 008 0x015E39D8 GetSample::EnumMediaTypes()
00:00:00.116 080 0x019353F0 New GetSampleEnumMediaTypes.
00:00:00.116 008 0x019353F0 GetSampleEnumMediaTypes::Next(1) pos=0
00:00:00.116 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.116 040 0x015E39D8 GetSample::AddRef() -> 5
00:00:00.116 008 0x015E39D8 GetSample::QueryInterface({56a8689d-0ad4-11ce-b03a-0020af0ba770}, ppv)
00:00:00.116 040 0x015E39D8 GetSample::Release() -> 4
00:00:00.116 008 0x019353F0 GetSampleEnumMediaTypes::Next(1) pos=1
00:00:00.116 080 0x019353F0 ~GetSampleEnumMediaTypes.
00:00:00.116 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.116 040 0x015E39D8 GetSample::AddRef() -> 5
00:00:00.116 008 0x015E39D8 GetSample::QueryInterface({56a8689d-0ad4-11ce-b03a-0020af0ba770}, ppv)
00:00:00.116 040 0x015E39D8 GetSample::AddRef() -> 6
00:00:00.116 001 0x015E39D8 GetSample::QueryAccept(audio) MEDIATYPE_Video
00:00:00.116 020 0x015E39D8 GetSample::ReceiveConnection() ** VFW_E_TYPE_NOT_ACCEPTED **
00:00:00.116 040 0x015E39D8 GetSample::Release() -> 5
00:00:00.116 040 0x015E39D8 GetSample::Release() -> 4
00:00:00.116 040 0x015E39D8 GetSample::Release() -> 3
00:00:00.116 080 0x01928600 ~GetSampleEnumPins.
00:00:00.116 040 0x015E39D8 GetSample::Release() -> 2
00:00:00.121 040 0x015E39D8 GetSample::AddRef() -> 3
00:00:00.121 008 0x015E39D8 GetSample::GetClassID() E_NOTIMPL
00:00:00.121 040 0x015E39D8 GetSample::Release() -> 2
00:00:00.132 040 0x015E39D8 GetSample::AddRef() -> 3
00:00:00.132 008 0x015E39D8 GetSample::EnumPins()
00:00:00.132 080 0x019353F0 New GetSampleEnumPins.
00:00:00.132 040 0x015E39D8 GetSample::AddRef() -> 4
00:00:00.132 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.132 040 0x015E39D8 GetSample::AddRef() -> 5
00:00:00.132 008 0x015E39D8 GetSample::QueryPinInfo() 0x015e39d8
00:00:00.132 040 0x015E39D8 GetSample::Release() -> 4
00:00:00.132 020 0x015E39D8 GetSample::ConnectedTo() ** VFW_E_NOT_CONNECTED **
00:00:00.132 008 0x015E39D8 GetSample::QueryInternalConnections()
00:00:00.132 040 0x015E39D8 GetSample::AddRef() -> 5
00:00:00.132 008 0x015E39D8 GetSample::QueryPinInfo() 0x015e39d8
00:00:00.132 040 0x015E39D8 GetSample::Release() -> 4
00:00:00.132 008 0x015E39D8 GetSample::GetClassID() E_NOTIMPL
00:00:00.132 008 0x015E39D8 GetSample::EnumMediaTypes()
00:00:00.132 080 0x01939838 New GetSampleEnumMediaTypes.
00:00:00.132 008 0x01939838 GetSampleEnumMediaTypes::Next(1) pos=0
00:00:00.132 040 0x015E39D8 GetSample::AddRef() -> 5
00:00:00.132 008 0x015E39D8 GetSample::QueryPinInfo() 0x015e39d8
00:00:00.132 040 0x015E39D8 GetSample::Release() -> 4
00:00:00.132 008 0x015E39D8 GetSample::GetClassID() E_NOTIMPL
00:00:00.132 008 0x015E39D8 GetSample::QueryDirection()
00:00:00.132 040 0x015E39D8 GetSample::AddRef() -> 5
00:00:00.132 008 0x015E39D8 GetSample::QueryInterface({56a8689d-0ad4-11ce-b03a-0020af0ba770}, ppv)
00:00:00.132 040 0x015E39D8 GetSample::AddRef() -> 6
00:00:00.132 040 0x015E39D8 GetSample::Release() -> 5
00:00:00.132 040 0x015E39D8 GetSample::Release() -> 4
...........
...........
..........
..........
00:00:04.021 008 0x0163CB68 GetSample::SetSyncSource(0x00000000), was 0x00000000
00:00:04.021 008 0x0163CB68 GetSample::JoinFilterGraph(0x00000000, (null))
00:00:04.021 008 0x0163CB68 GetSample::QueryInterface({8e1c39a1-de53-11cf-aa63-0080c744528d}, ppv) ** E_NOINTERFACE **
00:00:04.021 008 0x0163CB68 GetSample::GetState(), state is 0
00:00:04.021 040 0x0163CB68 GetSample::Release() -> 1
00:00:04.041 080 0x0163CB68 ~GetSample.
00:00:04.041 fff 0x00000000 Close video log 1.
This is failing at line 1515 of directshow_source.cppCheckHresult(env, CoCreateInstance(CLSID_FilterGraphNoThread, 0,
CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void**)&gb),
"couldn't create filter graph");And yes this will indeed fail if COM is not initialized. Question is how is your COM environment getting released, because Avisynth initializes COM as part of it's startup. There is a longstanding development thread DllMain & CoInitialize/CoUninitialize (http://forum.doom9.org/showthread.php?t=48279) about where best to initialize COM and even whether Avisynth should do it at all. Perhaps we should be doing the calls inside AviSource and DirectShowSource. I will cross reference this post in that thread.
hristoff2
2nd July 2007, 23:21
Any suggestions what could've changed anything leading to this? I'd assume it's something specific here because I've got two almost identical systems (1x web/game/encode | 1x encoding).
They're identical (codecs, dshow filters, avisynth - everything about video).
hristoff2
2nd July 2007, 23:22
Any suggestions what could've changed anything leading to this? I'd assume it's something specific here because I've got two almost identical systems (1x web/game/encode | 1x encoding).
They're identical (codecs, dshow filters, avisynth - everything about video).
And thanks for making this public in the developer's thread.
Richard Berg
2nd July 2007, 23:44
Same version of VDubMod? That's probably where the bug is.
hristoff2
3rd July 2007, 13:45
No, not the same version and both report the same error. (sorry forgot to mention that)
Vdub itself works on both though, avs2yuv doesn't work. (on both)
shadowhaze
30th July 2007, 02:00
I've got the same problem as hristoff2. If I try to use directshowsource in avisynth to open a non avi file, I get this error. This happens with VDMod, HCenc, AvsP. As with hristoff2, VD seems to work, but I'm not sure it's at 100%. I'm running XP SP2, avisynth 2.57 (now 2.85 alpha) and use the latest k-lite "Mega" codec pack
I've read this thread and the avisynth development thread a few times, searched on the net for a solution, installed avisynth 2.58 alpha (as there was some change to coinitialization), re-installed my codecs, and changed the settings on ffdshow but nothing worked.
This seems to be the solution http://forum.doom9.org/showthread.php?p=276372#post276372, but I have no idea where to copy it and what to delete. I'm a complete novice when it comes to writing or modifying software.
I would very much appreciate any assistance on this problem. I'm sure hristoff2 and others with same issue would be grateful as well.
Thanks
stax76
16th July 2010, 18:21
I got a report now, according to the log file I received, VirtualDubMod succeeded to open a basic script with DSS/WMV but x264 gave this error. IIRC the same person who reported this reported problems with the open/save file browser and another problem with drag & drop, since the shell uses much COM and nobody else ever reported any of these problems to me before in the last 7 years I'm suspecting something COM related being broke on this systems, probably something installed that broke something or some system setting.
IanB
17th July 2010, 01:32
The current algorithm regarding COM is to initialise it on IScriptEnvironment creation.
If COM was already initialised, i.e. use count now >= 2, then release Avisynth's extra use count and take no further action regarding COM.
If COM was not initialised, i.e. use count now == 1, then keep Avisynth's active use count and remember the current Thread Id. On IScriptEnvironment deletion if the current Thread Id matches the saved Thread Id then release COM. If the Thread Id does not match then tough luck, the process just leaked a COM instance. This is better than releasing COM for the wrong thread, which can cause all sorts of problems including crashes.
Your problem sounds like something is buggering up the COM use count for the current process and/or thread.
stax76
17th July 2010, 02:47
Do you have a idea how to find out what the culprit is? Maybe everybody having this problem posting which libraries are loaded (as shown by Process Explorer).
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.