Export Multiple Device and Camera at Once using SDK

Hi, Is it possible to export Multiple Camera or I/O Device at One Time using SDK because I see the standard milstone function we able to add multiple camera to export DB BLK file at one Time so after export finish and using Samart Client to open we will see group camera that we exported in playback mode So is it possible to do that using SDK too

Thank you

I try meathod Like this still getting error

private void FindAllCamerasExport(List<Item> searchItems, List<Item> foundCameraItems)
        {
            foreach (Item searchItem in searchItems)
            {
                if (searchItem.FQID.Kind == Kind.Camera && searchItem.FQID.FolderType == FolderType.No)
                {
                    bool cameraAlreadyFound = false;
                    foreach (Item foundCameraItem in foundCameraItems)
                    {
                        if (foundCameraItem.FQID.Equals(searchItem.FQID))
                        {
                            cameraAlreadyFound = true;
                            break;
                        }
                    }
                    if (!cameraAlreadyFound)
                    {
                        foundCameraItems.Add(searchItem);
                    }
                }
                else
                {
                    FindAllCamerasExport(searchItem.GetChildren(), foundCameraItems);
                }
            }
        }
 
private void ExportStart() { 
List<Item> cameraItems = new List<Item>();
                    if (exportAll.Checked == true)
                    {
                        FindAllCamerasExport(Configuration.Instance.GetItemsByKind(Kind.Camera), cameraItems);
                    }
 
                    _exporter.Init();
                    _exporter.Path = Paths;
                    _exporter.CameraList = cameraItems;
                    _exporter.AudioList = audioSources;
 
............
}

Yes, it should be possible to export a list of cameras rather than just one (which is what the samples do).

Is this a Smart Client plugin or a standalone application?

What is the error you get?

Stand Alone Example Can you show me how it been done wth audio input for each camera as well

Is this right way to get related Microphone on each camera in list

List<Item> cameraItems = new List<Item>();
                    if (exportAll.Checked == true)
                    {
                        FindAllCamerasExport(Configuration.Instance.GetItemsByKind(Kind.Camera), cameraItems);
 
                        audioSources = cameraItems; // Get the defined related Microphones and Speakers for the selected camera
                        if (EnvironmentManager.Instance.MasterSite.ServerId.ServerType == ServerId.EnterpriseServerType)
                        {
                            //Enterprise does not record speaker sound
                            foreach (Item item in audioSources.ToList())
                            {
                                if (item.FQID.Kind != Kind.Microphone)
                                {
                                    audioSources.Remove(item);
                                }
                            }
                        }
 
                    }
audioSources = cameraItems; // Get the defined related Microphones and Speakers for the selected camera

-Will not work. You will get cameras not microphones. Why not use the same method that finds cameras to find microphones? (a Search for Kind.Microphone.)

Or use the method in the sample? (ExportSample)

audioSources = _item.GetRelated();

Note, if using this method you will have to do this for each camera item on your list, and make a complete list out of the many lists. (In the sample there is only one camera item.)

OK I able solve export multiple camera and audio togther in single file but I got another problem as I use componet Export (Which I not smart client plug-in) It able to export video sucessful but I notic that Bookmark is not exported and there is not CustomSettings directory as example below first pricture I export using componet Sample called “ExportSample” to export in ClientFile/Data Directory content following

User-added image

Second pricture I export using Smart Client to export in ClientFile/Data Directory content following

You can see it different set Of Data here

Thank you

The standalone export does not include support for bookmarks.

Milestone will put this on the wish list, to implement this enahncement to the functionality to future versions of the MIP SDK.

It might be possible for you to implement this yourself, you do have the access to bookmarks in the MIP SDK, you can explore the reading of the bookmarks in the BookmarkCreator sample. How to format the file and where to put it etc. you would simply have to learn by seeing the files the Smart Client makes, there is no further documentation for this.

Thank you The Problem is that When I export using Plugin in Smart Client if the video length is more than 45 min or more than 1 hours the error will ouccur As show below

This only happen if I Export As Database and no log Exception what ever in progamData/Milestone/ but If I export as AVI The error is not ourcur So In my code the the start time and End Time is correct because it able to export AVI with same code but just changing type of export here is some of my code

try
                {
                    //List<Item> audioSources = new List<Item>();
                    List<Item> CameraSource = new List<Item>();
                    String destPath = _path;
                    StartTimeC = DateTime.Parse(CaseStartTimeUpdate);
                    EndTimeC = DateTime.Parse(EndDate);
 
                    if ((StartTimeC > EndTimeC) && (CaseCounter == null))
                    {
                        MessageBox.Show("Start time need to be lower than end time");
                        return;
                    }
 
                    if ((radioButtonAVI.Checked))
 
                    {
                        CaseNumSubString = CaseNum.Replace(@"/", "_");
                        FileName = CaseNumSubString + "_" + witness + ".avi";
                        Paths = Serverip + @"\d$\caseFile\";
 
                        _exporter = new VideoOS.Platform.Data.AVIExporter()
                        { Filename = FileName, Width = 640, Height = 480 };
 
                    }
                    else if ((radioButtonBLK.Checked))
                    {
 
                        _exporter = new VideoOS.Platform.Data.DBExporter(true) { Encryption = false };
                        
                        Paths = Serverip + @"\c$" + CaseVideoPath + @"\" + CaseNumSubString;
 
                    }
                    else
                    {
                        MessageBox.Show("Please Select Export Type");
                    }
 
                    List<Item> cameraItems = new List<Item>();
                    List<Item> AudioSource = new List<Item>();
                    
                        cameraItems = new List<Item>() { _item };
                        AudioSource = _item.GetRelated(); // Get the defined related Microphones and Speakers for the selected camera
                        if (EnvironmentManager.Instance.MasterSite.ServerId.ServerType == ServerId.EnterpriseServerType)
                        {
                            //Enterprise does not record speaker sound
                            foreach (Item item in AudioSource.ToList())
                            {
                                if (item.FQID.Kind != Kind.Microphone)
                                {
                                    AudioSource.Remove(item);
                                }
                            }
                        }
                    
 
                    _exporter.Init();
                    _exporter.Path = Paths;
                    _exporter.CameraList = cameraItems;
                    _exporter.AudioList = AudioSource;
                    
                    bool startresult = _exporter.StartExport(StartTimeC.ToUniversalTime(), EndTimeC.ToUniversalTime());
 
                    if (startresult)
                    {
                        _timer.Tick += ShowProgress;
                        _timer.Start();
                        
 
                        exportBtn.Enabled = false;
                        exportBtn.Enabled = true;
                    }
                    else
                    {
                        int lastError = _exporter.LastError;
                        string lastErrorString = _exporter.LastErrorString;
                        labelError.Text = lastErrorString + "  ( " + lastError + " )";
                        _exporter.EndExport();
                    }
                }
                catch (Exception ex)
                {
                    EnvironmentManager.Instance.ExceptionDialog("Start Export", ex);
                }
            }
            else
            {
                MessageBox.Show("Please Select Row to Export");
            }
        }
 
 private void ShowProgress(object sender, EventArgs e)
        {
            if (_exporter != null)
            {
                int progress = _exporter.Progress;
                int lastError = _exporter.LastError;
                string lastErrorString = _exporter.LastErrorString;
                if (progress >= 0)
                {
                    progressBar.Value = progress;
                    if (progress == 100)
                    {
                        _timer.Stop();
                        labelError.Text = "Done";
                        _exporter.EndExport();
                        _exporter = null;
                        buttonCancel.Enabled = false;      
                }
                if (lastError > 0)
                {
                    progressBar.Value = 0;
                    labelError.Text = lastErrorString + "  ( " + lastError + " )";
                    if (_exporter != null)
                    {
                        _exporter.EndExport();
                        _exporter = null;
                        buttonCancel.Enabled = false;
                    }
                }
            }
        }

The Code work perfectly because it able to export AVI but not Database

What does the error say? (Screen capture is cut off and only part of the message shows.)

If you export the same sources using the Smart Clients own export dialog, do you get the same error?

You should look at the Smart Client Export sample, we think you took the standalone export sample and put it in a Smart Client plugin, we are surprised it works at all if that is what you did.

Could you for clarity describe what it is you want to achieve?

We just want to export workspace that we able to select specific Start/End time to export video that all but er couldn’t get it to work if export video more than 1 hours

When I do a small modification on the Smart Client Export sample so that it export 2 hours, it works fine for me. Could you tried to use that as a basis extending both time and number of included devices?