Guide to recent How To articles about Fast video cataloger

Recent article overview about how to use Fast video cataloger

The last months we have added lots of information on how to use Fast video cataloger. Here is a quick guide to help you quickly find what might be useful for you.

New articles about how to use the software

Learn how you can use Fast video cataloger as a video library when you are live streaming in “video library for live streams”

Learn how to find identical or similar videos to save some space and clutter in “easy-way-to-find-similar-videos”

Learn how you can use the integrated companion image features in Fast video cataloger in “Managing photos and video images for your video files/”.

Fast video cataloger has an integrated file organizer. Learn how to organize your actual video files using this functionality in “How to work efficient with video folders/”.

This text, “How to work faster with videos in Fast video cataloger/”, is a favorite of mine. It goes through a bunch of small features that can save lots of time if you are a frequent user of Fast video cataloger.

“Video wall” is one of the unique features in Fast video cataloger. In “video-wall in Fast video cataloger/” we explain the feature in more detail. If you have not tested it already you owe it to yourself.

Learn how to get highest quality videoplayback in Fast video cataloger by reading “Using madvr for high quality video playback/”.

New articles about how to use the scripting functionalities

Scripting is not for everyone, there is a learning curve. But, if you are interested in automating tasks or extending the software we have added a bunch of new articles for you. And we have more text planned for the coming month. Maybe you know someone that is a programmer who would like to try it out?

In “Exporting thumbnail files from videos using c#” we show how you export the video thumbnails to jpeg files on disk. This will be useful when you want to use the images in another software or perhaps a web page.

In “Import videos from all my movies by Boildesoft” we show how you write a script that reads data from a standard Access database.

In “c# for all the really advanced video searches” we show how you may extend the search function to fit your specific need. This can be combining search criteria from external data or just be outside of what you can do with the user interface in Fast video cataloger.

Import videos from All My Movies by BoildeSoft

All my movies

All My Movies by Boildesoft ( https://www.bolidesoft.com/allmymovies.html ) is a software that lets you manage your collection of bought movies. It downloads movie data from the imdb database and many other services (http://imdb.com). It also let you track and rate movies you have watched.

If you compare to Fast video cataloger the focus of All my movies is toward collecting movies while Fast video cataloger is geared toward organizing any type of video clips you have on your computer or in your organisation.

Importing videos from All my movies

This sample script shows how to use the scripting support in Fast video cataloger to import data from an All my movies database. The full script is included at the end, simply load the script into the script window in Fast video cataloger and run it.

Database format

All my movies uses an Access database with the extension set as .amm. If you rename the file extension to .mdb you can load it straight into Access and have a closer look at the data. To be able to read the Access database in a program you need to install the Access database engine. Download it from here. Since Fast video cataloger is a 64 bit program make sure you install the 64 bit version of the database engine.

Import videos script

The script to import videos is pretty straight forward. To make it easy to follow I have put it all in the entry function. If you want to expand on this script you should split it up into a number of functions and you should add error handling.

First we show a dialog to let the user pick the All my movies database file to read from:


Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
dlg.FileName = "access"; // Default file name
dlg.DefaultExt = ".mdb"; // Default file extension
dlg.Filter = "mdb file (.mdb)|*.mdb|AllMyMovies file (.amm)|*.amm|All files (.*)|*.*"; // Filter files by extension
Nullable result = dlg.ShowDialog();

We then open the database file and runs a simple SQL query to get everything from the movies table in the database.


OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + dlg.FileName + @";User Id=admin;Password =;");
connection.Open();
OleDbDataReader reader = null;
OleDbCommand command = new OleDbCommand("SELECT * from movies", connection);
reader = command.ExecuteReader();

Next we create some new extended properties for the catalog. Some of the properties in All my movies are not in the list of default video properties. But, since you can add your own properties in Fast video cataloger we will also do that for these properties.


var catalog = scripting.GetVideoCatalogService();
catalog.SetPropertyMeta("video_property", "year", "edit");
catalog.SetPropertyMeta("video_property", "studio", "edit");
catalog.SetPropertyMeta("video_property", "trailer", "edit");
catalog.SetPropertyMeta("video_property", "length", "edit");
catalog.SetPropertyMeta("video_property", "comments", "edit");

Then we read each line of the movie table in the database to create video entries.

while (reader.Read())
{
  string name = reader["Name"].ToString();
  string path = reader["LocalPath"].ToString();
  string description = reader["description"].ToString();
  string url = reader["url"].ToString();
  int video_id = catalog.AddVideo(path, name, 0, description, 0, 0, url, null, 0, null, null);

Once we have the video created we get the id of the newly created video and can use that to set the extended properties.

  string year = reader["year"].ToString();
  catalog.SetVideoFileExtendedProperty(video_id, "year", year);
  string studio = reader["studio"].ToString();
  catalog.SetVideoFileExtendedProperty(video_id, "studio", studio);
  string trailer = reader["trailer"].ToString();
  catalog.SetVideoFileExtendedProperty(video_id, "trailer", trailer);
  string length = reader["length"].ToString();
  catalog.SetVideoFileExtendedProperty(video_id, "length", length);
  string comments = reader["comments"].ToString();
  catalog.SetVideoFileExtendedProperty(video_id, "comments", comments);
}

Finally, we close the Access database and refresh Fast video cataloger to show the imported videos.


connection.Close();
scripting.GetGUI().Refresh("");

Conclusion

It is pretty easy to import data from All my movies into Fast video cataloger. You can use the same techniques to import data from other software, or, your custom solutions into Fast video cataloger. If you have imported a file to the video you can select “reindex” on the videos. Then the program will scan the video file for thumbnails and extended properties.

Below is the full script. You can also find the file in the sample script folder when you downlod Fast video cataloger.

using System.Collections.Generic;
using VideoCataloger;
using Microsoft.Win32;
using System;
using System.IO;

namespace VideoCataloger
{
    using RemoteCatalogService;
    using System.Data.OleDb;

    public class ImportMDB
    {
        static public void Run(IScripting scripting, string argument)
        {
            scripting.GetConsole().Clear();

            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.FileName = "access"; 
            dlg.DefaultExt = ".mdb"; 
            dlg.Filter = "mdb file (.mdb)|*.mdb|AllMyMovies file (.amm)|*.amm|All files (.*)|*.*"; 
            Nullable result = dlg.ShowDialog();
            if (result == true)
            {

                try
                {
                    // https://www.microsoft.com/en-us/download/details.aspx?id=13255
                    // to download the access database runtime of the provider is not installed
                    // note you need the 64 bit version

                    OleDbConnection connection = 
                    new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" 
                    + dlg.FileName + @";User Id=admin;Password =;");
                    connection.Open();
                    OleDbDataReader reader = null;
                    OleDbCommand command = new OleDbCommand("SELECT * from  movies", connection);
                    reader = command.ExecuteReader();

                    // Setup the extended video properties
                    var catalog = scripting.GetVideoCatalogService();
                    catalog.SetPropertyMeta("video_property", "year", "edit");
                    catalog.SetPropertyMeta("video_property", "studio", "edit");
                    catalog.SetPropertyMeta("video_property", "trailer", "edit");
                    catalog.SetPropertyMeta("video_property", "length", "edit");
                    catalog.SetPropertyMeta("video_property", "comments", "edit");

                    while (reader.Read())
                    {
                        string name = reader["Name"].ToString();
                        string path = reader["LocalPath"].ToString();
                        string description = reader["description"].ToString();
                        string url = reader["url"].ToString();

                        int video_id = 
                        catalog.AddVideo(path, name, 0, description, 0, 0, url, null, 0, null, null);

                        string year = reader["year"].ToString();
                        catalog.SetVideoFileExtendedProperty(video_id, "year", year);
                        string studio = reader["studio"].ToString();
                        catalog.SetVideoFileExtendedProperty(video_id, "studio", studio);
                        string trailer = reader["trailer"].ToString();
                        catalog.SetVideoFileExtendedProperty(video_id, "trailer", trailer);
                        string length = reader["length"].ToString();
                        catalog.SetVideoFileExtendedProperty(video_id, "length", length);
                        string comments = reader["comments"].ToString();
                        catalog.SetVideoFileExtendedProperty(video_id, "comments", comments);
                    }

                    connection.Close();
                    scripting.GetGUI().Refresh("");
                }
                catch (Exception ex)
                {
                    scripting.GetConsole().WriteLine( ex.Message );
                }
            }
        }
    }

}