VideoOS.toolkit failed to load

when running the app the VideoOS.toolkit throws an exception that it can’t load the file , even that the file exist in the app folder,

attach photo

https://developer.milestonesys.com/s/article/Dependent-files-in-MIP-SDK

You should not reference the VideoOS,Toolkit.dll directly it is refrenced by the VideoOS. Platform.SDK dll’s

Hi Bo,

we find the problem we had a mixed of 64 an 86 bit dll in the folder,

we replaced all the dll to a 32bit onces, and it works now,

but we still have an issue with _jpegVideoSource.Init();

from time to time we get a NULL value in this function.

after we call it, any idea what can be the reason?

The Init() has no return value so my guess is that you do a Get(). The documentation reads-

-

override object VideoOS.Platform.Data.JPEGVideoSource.Get (DateTime dateTime)

Get one JPEG at the specified time.

if no image found, null may be returned.

Parameters dateTime

Returns null or a JPEGData

class Implements VideoOS.Platform.Data.VideoSource.

-

Ref. https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_data_1_1_j_p_e_g_video_source.html&tree=tree_search.html?search=jpegvideosource

Hi Bo,

we change the get(). to .GetAtOrBefore()

like in the sample that we got from the support, but from time to time we get the following exception:

error 'JPEGVideoSource:GetAtOrBefore() - State error, must call Init() first. ’

but in the code we do call init before:

                    m_log.InfoFormat("SaveJPEG (by Camera TimeDate) (3) ");
                    Item item = new Item(fqid, "item1");
                    _jpegVideoSource = new JPEGVideoSource(item);
                    _jpegVideoSource.Init();
                    object obj = _jpegVideoSource.GetAtOrBefore(dt);
                    m_log.InfoFormat("SaveJPEG (by Camera shortcut) (4) ");
                    if (obj != null)
                    {
                        JPEGData jpegData = (JPEGData)obj;
 
                        // set JPEG file name: YYYYMMDD_HHMMSS_9766928.jpeg
                        strJPEGFilename = string.Format("{0:0000}{1:00}{2:00}_{3:00}{4:00}{5:00}_CAM{6}.jpeg", dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second,
                                                        strCameraShortcut);

and after this errors few times we get the Following:

error ‘class std::bad_alloc: bad allocation’

and then this error:

error ‘class NmThread::CmThreadError: Error running thread!’

and at lest we get this:

error ‘Unable to connect to toolkit!’

Any idea what causing this issue?

BR