The Architecture of Fast Video Cataloger

Introduction

Here is a very high overview of the technology we have used to build Fast Video Cataloger. The goal has always been to provide a video content management system for Windows with great performance.

Main application

The main application is written in C# using Visual studio and the .NET framework. We us a lot of async/await for threading as wait as background workers and explicit threading. C# is generally pretty efficient and we have access to most of the windows system using the .Net framework. We have had quite a bit of performance issues with garbage collection and use quite a bit of tricks to work around these performance issues.

User interface

The user interface in Fast video cataloger is done in WPF and a few extra UI components. WPF uses DirectX internally, and DirectX uses graphics hardware for rendering. We have made quite a few optimizations to ensure we can handle really large video collections with good performance.

Scripting

The scripting interface uses CSScript and we expose the API through some abstract interface classes as well as the direct WCF interfaces. You can extend Fast Video Cataloger with C# either by loading the scripts in the console windows or by creating actions that links to C# scripts.

Encryption

Video encryption uses Aes encryption and we hook the filesystem to be able to work on a stream level.

Web Browser

WPF has a web browser component but that uses internet explorer. The browser window is a hosted Chromium web browser, CEF sharp.

Video player

WPF has a video player component but that one has pretty bad performance and do not support all video formats. The video player in Fast video cataloger is custom for FVC and is written in C++ and uses a DirectShow filter graph to play videos. C# allow us pretty easy access to interface with c components. We build the graph manually to avoid common issue where a system has badly configured filter priorities (Select the player from preferences). We support a few different renderers that you can select from the preferences.

Video indexer

The video indexer is custom for FVC and is written in C++. We use a custom DirectShow filter graph with a few custom DirectShow filters for the capture. The video indexer subsystem is something we have developed for over 10 years. It contains quite a lot of “special” code to handle errors and all sorts of broken files and codecs.

Video database

The video database engine is SQLite and we have built a custom WCF interface. Locally the WCF server is run as a separate process and the game communicates through a memory pipe or tcp/ip.

Server

When running the Fast video cataloger serverthe WCF component is hosted as a Windows service and communicates with the game over TCP.

Conclusion

You can download a trial version of Fast video cataloger

How to share a catalog over the internet

How to share a video catalog over the internet

In Fast video Cataloger 7 we have added the ability to share a video catalog across a windows network or over the internet. It is easy and you just follow the wizard.

web server for videos

When sharing over the internet you first need to have a web server setup and configured. There are plenty of guides for how to set that up on the internet. If you don’t have a webserver already we recommend iis that comes with Windows or the Apache server. We use the Apache version that is distributed with Bitnami. After you have installed the server make sure it is working and that you can connect to it. Start with localhost and then try from a remote computer. If you don’t have a working web server the videos will not play but you will be able to browse the catalog and search. All metadata is loaded using the Fast video cataloger server and not the webserver. The webserver is only used for loading videos and companion images (and if you are using the generated web pages).
Videos need to be at the root of the webserver. The catalog you share should only have videos that are in the root of the webserver. The catalog file you share should not be in the root of the webserver.

 

You share a catalog if you want other users to access it, perhaps at the same time as you are. This is how you create a shared video library for your entire company or a project.

You can stop the server and work on it again as a local catalog when if no other user needs access.

When you share a catalog other users can add videos or photos to the catalog. When they add videos the video files are indexed locally and then uploaded over the Fast video cataloger service. Loading videos and images are done directly through a windows share while all metadata is accessed over the Fast video cataloger service.

Download the latest version of Fast video cataloger. If you have an older version you will need to update to version 7 as that is the first version that has support for sharing a catalog over the internet.

Share a video catalog in a Windows network

How to share a video catalog in a Windows network

In Fast video Cataloger 7 we have added the ability to share a video catalog across a windows network. It is super easy and you just follow the wizard.

 

You share a catalog if you want other users to access it, perhaps at the same time as you are. This is how you create a shared video library for your entire company, one place where all the videos are easily accessible and searchable.

You can stop the server and work on it again as a local catalog when if no other user needs access.

When you share a catalog other users can add videos or photos to the catalog. When they add videos the video files are indexed locally and then uploaded over the Fast video cataloger service. Loading videos and images are done directly through a windows share while all metadata is accessed over the Fast video cataloger service.

Fast Video Cataloger 7 – Share video catalogs

After lots of work and testing, we are really happy to finally announce Fast video cataloger 7 with new support to share video catalogs in a local network or over the internet.

Video server

The big new thing in this version is that it includes the Fast video cataloger server. The server allows you to share a video catalog in a local network or over the internet if you host your videos on a web server. You can easily go between using a local video catalog to a video catalog hosted by the server. The server is run as a windows service so it can keep running in the background even if you do not have the Fast video cataloger program running. When a catalog is shared several people can access the catalog at the same time. If anyone adds a video to the catalog it will be indexed locally and uploaded to the server.

We have worked on the server for a number of years now with internal beta versions and lots of testing, I am super happy to finally be able to share this work with all users.

You start the server from the Share menu.

Rest API

We have a rest API for use from web pages. the rest API has functions for reading and search a catalog. When you share a catalog over the internet you have the option to generate a sample web page that uses the API. The API allows you to build web solutions that get video data from the Fast video cataloger server.

Updated style

We have gone through the program and added icons. It does look prettier but the real reason we did it is to make it easier to find the windows you need as there starts to be quite a lot of windows now in Fast video cataloger.

Copy & Paste keywords

We have added two new icons to the thumbnails when you hover with the mouse. Click the buttons to copy and paste keywords to the scene. You can separate the keywords with a ,. And, it uses the standard Windows clipboard so you can mark text in another program and click the paste button to make that text a keyword for the scene thumbnail.

Performance

When you select a video the thumbs are displayed faster. This is very evident if you have videos with hundreds of thumbnails. We have also done a big performance pass on rendering, it should run smoother especially on large screens.

And lot of other smaller improvements. Download the latest version or upgrade from inside the program.

Fast Video Cataloger 6.40

A new Fast video cataloger is now available for download. Lots of small but pretty important improvements in this update. Get it from https://videocataloger.com/download/

User interface improvements

  • The Scale of thumbnails is now stored per layout.
  • If you right-click on the thumbnails scale slider there is a context menu to select 50%, 100%, and 200% scale.
  • If “Extended properties” and “Extended thumbnail properties” are opened or not in the detail view is now stored with each layout.
  • When you add an actor it is now put first in the list and is selected. This should make it easier to spot if you want to drag it as a cast member right away.
  • When you have one of the top menus opened you used to have to first click outside to close it. Then you could click on other user interface elements. This is now fixed.

Video player

  • Using MadVR returning from fullscreen mode should now work correctly.
  • In fullscreen mode, click on the screen to pause/unpause.

Performance

  • Optimized thread pool usage a bit to fix general slowdown issues.
  • If using “Write metadata in video files” this should no longer block the keywording user interface.
  • Optimized keyword entry so it should be more responsive.

Bug fixes

  • Fixed issue with videos sometimes getting a 0 length when indexed.

Scripting

  • Error messages when compiling scripts should be a bit more clear, and we always scroll to the end of the message automatically.
  • ConsoleWrite could continue to the next line before the text was visible on the screen, this is fixed.

Fast video cataloger 6.39

Today Fast video cataloger 6.39 is available for download. This is a bug fix release without any new major features, thanks to everyone who has reported issues.

New .Net framework

We have updated to use the 4.62 version of the .net framework. If you have the latest version of Windows 10 this is already included with your operating system. If you are on an older version the installer will check if you have the framework and prompt you to install it as part of the installation process. The updated .net framework includes a whole range of general bug fixes and performance improvements in .net. More info on the official .net page.

Usability improvements

  • If you hold ctrl when entering a keyword in the keyword search field it will direct that keyword to the exclude keyword box instead.
  • We limited the height keywords can take in the keywording box to prevent the input field to scroll down if a catalog has lots of keywords and/or the panel is thin.
  • You can now click on the video player screen area to play/pause the video.

Bug fixes

  • Fixed crash after capturing a screenshot to file.
  • Fixed issue with aspect ratio when using MadVR renderer.
  • Fixed issues that it was not possible to drag the seek bar in the videoplayer.
  • Fixed issue with bins not showing up in the dropdown in some cases.

Video web search in Fast video cataloger

I will show you how to access the web browser in Fast video cataloger to easily integrate a web search with your video catalog. In Fast video cataloger 6.31 we opened up the integrated web browser in Fast video cataloger for scripting. If you are on an older version please update to the latest version from our download page or click the upgrade button in the program.

Web browser window

The web browser is what you see when you click on the view button and Help.

Click the help button to open the web browser.

Here is how it looks with just the script console and the web browser open in Fast video cataloger.

Script console and web browser open.

Scripting the browser

IScripting has a new member function GetBrowser(); that will get you the top-level interface to the integrated chromium web browser. The complete interface is documented on the cef GitHub site. To load a web page to the browser window you simply need to call Load() and give your URL as argument.

To get the underlying browser object and access the dom model you can call GetBrowser() to get and IBrowser object. The IBrowser interface has a MainFrame property of type IFrame and from here you can get access to execute javascript. That is outside the scope of this text, let me know if you are interested in more example on how to use that functionality.

Google search

You can do google searches by giving the right arguments to the google URL. http://www.google.com/search is the root URL. Search arguments are passed as q=[search terms]. Search terms need to be separated by a + sign. There are plenty of extra arguments to customize your search, for example, as_filetype=[file extension] to search for a specific filetype or as_sitesearch=[site URL] to search only at a specific site. In this example, I will only use the basic search query but you can easily expand on it to fit your needs. Remember to use & between arguments if you want to send more than the q argument y.

The search sample

We start by getting your current video selection. Then we fetch the VideoFileEntry for that selection using the VideoCatalogService interface. This is very similar to most other samples. Then we do a bit of string manipulation. Spaces in the Google query should be separated by + so we replace all spaces and also all _ as they are probably meant as spaces in the title. Last we check if the title has a “.” in there somewhere and get rid of everything after the . as that is probably a file extension. Now we have the string we want to search for. We need to pass this to google as q= so we put that in the query string.
Next, we get the browser with GetBrowser() and then call Load() with the Google base URL and the search query.

Script Code

Copy-paste the following into the script console to use the selected video title as a search term on google. Click Run to execute the script.

using System.Runtime;
using System.Collections.Generic;
using VideoCataloger;
using VideoCataloger.RemoteCatalogService;
class Script
{
  static public async System.Threading.Tasks.Task Run ( IScripting scripting, string arguments ) { 
  var selection = scripting.GetSelection();
  List selected_videos = selection.GetSelectedVideos();
  if (selected_videos.Count>0) {
    var cataloger = scripting.GetVideoCatalogService();
    var video_entry = cataloger.GetVideoFileEntry( selected_videos[0] );
    string title = video_entry.Title;
    title = title.Replace(' ', '+');
    title = title.Replace('_', '+');
    int extension = title.LastIndexOf(".");
    if (extension!=-1)
      title = title.Substring(0,extension);

    string query = "q=" + title;
    var browser = scripting.GetBrowser();
    browser.Load("http://www.google.com/search?" + query);
    }
  }
}

Serve videos from a web server

With Fast video cataloger, you can serve videos you have in your catalog over a web server. This will let you share a video catalog with someone and give them super fast search and access while keeping all the large videos on your web server.

How to host video from a web server

Hosting your videos from a web server can be a practical solution if you need to share a catalog without having to distribute your videos files. A video catalog is usually relatively small (on the order of a few gigabytes) and easy to distribute while the video files can easily take up terabytes of space. If a user has the catalog local it can be searched and browsed quickly. Then when the user finds a video and wants to play it, only the relevant part of the video is served over your web server.

Web server

To set up this workflow you will need to have a web server installed. Windows come preinstalled with IIS but it will need to be enabled. You can enable it through the “Turn Windows features on and off” that you can reach via clicking Windows key + R key and type appwiz.cpl in the run window and press enter. Now you see the Program and Features part of Control Panel and on the left-hand side click on the “Turn Windows features on or off” link and you will see a long list of features. Locate Internet Information Services(IIS) and check that checkbox. Once you click OK windows will take a while to set your IIS server up. When it is done you can navigate to localhost from your web browser and access your IIS webserver.
Another great free web server is the Apache webserver.
In general, we have to refer to the developer of the software on how to install and configure their web server. There is more than plenty of information about it available online.

www root

Once you have your web server setup and configured you need to find the root from where files are served. If you are using IIS this will normally be “C:\inetpub\wwwroot\” and on Apache it will be something like “C:\wamp\apache2\htdocs\” (using the highly recommended Bitnami wamp distribution ). All videos you want to access over the webserver must be below this root folder.

Please note: Not all video formats can be read from an HTTP server, especially old formats that can be problematic. We recommend that the videos you place on your webserver is in mp4 format.
That was the preparation. You should now hopefully have a working web server and videos in the www root of your webserver.

Configure Fast video cataloger for serving videos over http server

The next step is to go to Fast video cataloger and on the info screen click the “Use hosted videos” button.

Where you find the option to configure hosting through a web server

This brings up the configuration wizard and is an easy step by step guidance. In the first dialog, you enter the www root of your web server. Remember that if you are using IIS it might be “C:\inetpub\wwwroot\” and on Apache it might be something like “C:\wamp\apache2\htdocs\”.

In the second field enter the URL of the server as seen when you access it through a web server. When you are running on a local server this would be http://localhost/ or http://127.0.0.1/. You have now configured Fast video cataloger to recognize your web server. The open button is a good way to test it is set up and running.

play video through web server.

Adding videos

Next, you add the videos from your www-root to your catalog. Do this the same way as usual from the add videos window. When you click on one of your added videos you will notice that the path to the video will be something like: [WebServer]\video_indexer.mp4

When you play this video the path will be converted to your www root and played. This is very similar to how special folder work.

To load the video over the webserver you will need to go into the “Use hosted videos” dialog again and check the “Enable loading over http” checkbox.
If you play the video after that it will be loaded through requests to your webserver. This specific setting is saved in the catalog so if you share your catalog with someone else the [WebServer]\video_indexer.mp4 will resolve to the same URL for them as well.

Note: Fast video cataloger works most efficiently when you have your videos and images locally. Only host through a web server if you don’t have direct access to the files.

Fast Video Cataloger 6.33 – Exclude videos with keyword

A new version of Fast video cataloger is now available from the download page

Search – Exclude keywords

You can now exclude videos matching keywords from the search result. You find this option in the search window below the keywords. This excludes filter works on the set of filtered videos. For example, when you search for all videos matching an actor you can exclude videos that have specific keywords. If you search for a keyword and exclude that keyword, the exclusion will take priority.

Search – Actors

The actor search now supports search on Actor Bio and Actor Link.

The Actor window now only load visible portraits to save memory for catalogs with lots of actors. And, we extended the script API with a new SearchActor() function. Make sure to check out our previous blog post on how to write a script to import actors from an external movie database.

Scripting

Talking about scripting. we updated Console writing so it can be done from any thread in a script, for example from a browser callback. I also added some more documentation on the exposed browser. We will write a more detailed post on how you can use it later but it is all working in the current build if you want to try it. Running scripts from an action button always gave an error message, this is fixed.

Meta data in files is faster

Writing metadata to video files (enable from the metadata preference page) is now done in a background thread and is faster.

Video player

We fixed an issue when you clicking on the seek bar while a video was playing and that click was ignored. There were scaling issues when using the vmr9 video player could happen if there was a big difference between the video aspect ratio and the window aspect ratio. Changed order of vmr7 and vmr9 in the preferences ( The recommendation is still to prefer the direct option )