Video wall

The Video Wall is a really efficient way to browse videos. You view your videos as animated thumbnails where the thumbnails of the video are quickly cycled through. There are Not many settings to care about but the available are described on the video wall preferences page.

Auto-index preferences

We talked about the video index settings before. Fast video cataloger can also automatically index videos from a folder. Whenever a video is added to that folder it will go to the index queue and then be added to your video catalog. This folder could, for example, be your browser download folder. It could be an inbox for anything that you want to go into your video library. Read about how you can configure automatic video indexing

Video indexer preferences page

Fast video cataloger lets you get an instant overview of a video through a thumbnail video wall. Core of this feature is the integrated video indexer. The video indexer can automatically extract thumbnails from a list of videos and more. It can also extract metadata from the videos and more. You can configure the video indexer to your needs from the indexer preferences page and more.

Video player preference page

You already know Fast video cataloger has an integrated video player that lets you play straight from a thumbnail. But did you know about all the ways you can configure the integrated video player in Fast video cataloger? Do you have issues playing some video files? Do you want to seek faster, need better video quality? Read about the preferences for the video player in Fast video cataloger at this new page.

General preferences page

Fast video cataloger has lots of features and we know that can be a bit overwhelming at first.

On the other hand, just about each feature serves a use and purpose. Most of them have at some point been added because one or more of our users requested it.

The preferences are where you can do a lot of customization of the program. Today we start a walkthrough of all property pages in the preferences to help you discover what the software has to offer and some recommendations from me. Let’s start with the General preferences page. And, if you have questions and feedback to use the comment.

New version available (6.21) available for download

Today we uploaded Fast video cataloger 6.21 and it is available for download.

There are lots of improvements since my latest blog update. The largest major improvements have been around the integrated video player. The end result should be increased video quality as well as better support for multiple screens.

Recent improvements to video player

  • The “direct video player” video player option, that should be the safest option for playback, now uses evr instead of vmr9. That change should result in higher quality output and faster playback.
  • Improvements to the threading should have fixed a few possible causes for freezes. For example, we should be able to handle a few known driver/codec issues a bit better with blank output instead of a frozen program.
  • Multiscreen support for the video player. It should now be possible to drag the video player window from the main window to the secondary window with a different resolution.
  • Respect “pause” state. If you pause a video and then click on a thumb the video will jump to the selected time but won’t start playing (this behavior can be controlled from the videoplayer preference ).

Recent improvements to video playlists

  • Now you can add to playlist from the scene search results.
  • Playlist has a more compact view in addition to the previous one, right click in the window to select view.

Other improvements

  • New video index option to rotate thumbnails 90 degrees if it has a rotate metadata. This is useful for videos taken with iphones. For this to work you need the settings to extract meta data from the video and the option to autorotate thumbnails. To play the videos correct you also need to use a video renderer that reads the rotation metadata and does realtime rotation. MadVR is one renderer that does that.
    Options for autorotate video thumbnails

  • If you capture a frame through the capture camera icon in the player that thumb will be selected after capture.
  • Add folder should now be quicker, especially with folders that contain encrypted videos.
  • Add videofile now accepts multiselection.
  • Updated ScriptInterface.cs to reflect latest version of the api.

Build your custom video solution with a WPF user interface

Custom video solution

If you want to develop a custom video solution in Fast video cataloger you will need a user interface. This article will show you how to build a WPF user interface in a Fast video cataloger script.

What is WPF

WPF stands for Windows Presentation Foundation and is a Windows technology to create user interfaces. In WPF you defined your user interface in an XAML file. The whole user interface in Fast video cataloger is built with WPF.

XAML to define the user interface

In WPF you specify the layout of the user interface in an XML file. This file defines what standard controls you want on your page and how the layout is going to be arranged. Separating the user interface from the code like this makes it possible to hand over the design and layout of the user interface to an artist and let the programmer focus on the actual code of the application. Well at least in theory. Even if you are doing both the code and the user interface it is a nice separation to have your layout defined in a separate file. You can also use programs like Blend or Visual studio to design your user interface without touching the code of your application.

Problems with WPF in scripts

If you want to use WPF to build a user interface for a script in Fast video cataloger there are a few problems we need to solve. First, when compiling a WPF applicaton there are actually different compilers compiling the XAML code that defines the user interface and the C# code that is the program. The scripting in Fast video cataloger has no XAML compiler so that’s one problem. Another problem is that you do not specify a list of files to load, you only load your main C# script file. So to be able to define a user interface in XAML we need to load the file dynamically from our C# script. Luckily there is a function in .net to do just that System.Windows.Markup.XamlReader.Load(...).

Referencing external scripts

To be able to use WPF we need to bring in a number of external references. In a Visual studio solution you would add these these as references to the soluton. Again, in Fast video cataloger we load one script file. To solve this Fast video cataloger does special parsing of comments to let you use comments to bring in external references. css_ref is the syntax to bring in an external reference. To bring in everything you need for WPF in your script just add these lines to the top of your script:

//css_ref WindowsBase;
//css_ref PresentationCore;
//css_ref PresentationFramework;
//css_ref System.Runtime
//css_ref System.ObjectModel

Once we have the references we also need to add the “using” clause as usual in “.net”. Adding the following at the top of your script should bring in all we need for WPF.

using System;
using System.Xaml;
using System.Windows;
using System.IO;
using System.Windows.Controls;

Visual studio solution

The sample solution provided with the Fast video cataloger has all the references set up so you can add your XAML files and C# files there and use the UI editor to design your user interface. You are even able to compile the user interface even though the compilation in the solution works in a completely different way compared to the script. Even so, this is a good way to quickly catch errors. I highly recommend you use the provided sample solution and continue to build on the provided WPF sample.

Step by step through the script

This sample starts with a class that inherits from the Window class. This is the main window for the user interface. In the constructor we can set the size and title of the window.

Width = 320;
Height = 200;
Title = "Dynamic WPF window";

The next step is to load the actual xaml file that defines our user interface. Here is the code to do this:

string current_folder = Directory.GetCurrentDirectory();
string path = current_folder + "\\scripts\\samples\\hello_wpf.xaml";
using (FileStream fs = new FileStream( path, FileMode.Open))
{
m_RootElement = (DependencyObject) System.Windows.Markup.XamlReader.Load(fs);
}

XAML and the user interface definition

and if we look at the XAML file that defines the user interface it looks like this:


<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Foreground="Black"
Background="White"
UseLayoutRounding="True">
<StackPanel>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Label Foreground="Black">Enter message:</Label>
<TextBox Width="100" Name="input1" Margin="10"/>
</StackPanel>
<Button Name="button1"
Margin="10"
Width="96"
BorderThickness="2"
Content="Click Me" />
</StackPanel>
</Page>

The first lines are standard XAML for creating a page for a Window.

Next, a <StackPanel> controls the layout saying that everything below will be stacked vertically. Next, we have another <StackPanel> that says anything in it will be stacked horizontally. In there we add a <Label>, i..e. a text line and then a <TextBox> that accepts input from the user. Below the <StackPanel> we have a <Button>.

Connecting the button

We have now seen the definition of the user interface. Loading a XAML file dynamically like we do unfortunately mean that bindings does not work. Because of this we need to connect the button from the C# side and we do that like this:


Button btn = (Button)LogicalTreeHelper.FindLogicalNode(m_RootElement, "button1");
btn.Click += button1_Click;

The LogicalTreeHelper.FindLogicalNode function helps us find a UI element with the Name property set as “button1”, and we give the root of the loaded XAML file to search from. The function will return our Button and then we only need to hook up the Click event to the function we want to be called when the user clicks the button i.e. button1_Click

The last thing we do in the main window constructor is to set the content of the window to the loaded root element.
this.Content = m_RootElement;
This is what actually sets the loaded user interface to be displayed in the Window.

The script

The script starts as always at the static Run function. Here we create an object of our class and just call ShowDialog to show the window. When you run the script you will see the user interface. If you click the button we take what text has been input in the text box and shows that in a popup window.

The last thing to explain is the Main function. It is only needed because WPF expects the Main function when you compile in Visual Studio, it is never called or needed when running the C# file as a script in Fast Video cataloger.

WPF is a great option for building user interface and is highly recommended when you build a custom video solution on top of Fast video cataloger.

Complete XAML file


<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Foreground="Black"
Background="White"
UseLayoutRounding="True">
<StackPanel>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Label Foreground="Black">Enter message:</Label>
<TextBox Width="100" Name="input1" Margin="10"/>
</StackPanel>
<Button Name="button1"
Margin="10"
Width="96"
BorderThickness="2"
Content="Click Me" />
</StackPanel>
</Page>

Complete C# file


//css_ref WindowsBase;
//css_ref PresentationCore;
//css_ref PresentationFramework;
//css_ref System.Runtime
//css_ref System.ObjectModel

using System;
using System.Xaml;
using System.Windows;
using System.IO;
using System.Windows.Controls;

namespace VideoCataloger
{

public partial class HelloWindow : Window
{
DependencyObject m_RootElement;

public HelloWindow()
{
Width = 320;
Height = 200;
Title = "Dynamic WPF window";

string current_folder = Directory.GetCurrentDirectory();
string path = current_folder + "\\scripts\\samples\\hello_wpf.xaml";
using (FileStream fs = new FileStream( path, FileMode.Open))
{
m_RootElement = (DependencyObject) System.Windows.Markup.XamlReader.Load(fs);
}

Button btn = (Button)LogicalTreeHelper.FindLogicalNode(m_RootElement, "button1");
btn.Click += button1_Click;

this.Content = m_RootElement;
}

private void button1_Click(object sender, RoutedEventArgs e)
{
TextBox textbox = (TextBox) LogicalTreeHelper.FindLogicalNode(m_RootElement, "input1");
MessageBox.Show("Message is: " + textbox.Text);
}

[STAThread]
public static void Main()
{
}

static public void Run(IScripting scripting, string argument)
{
HelloWindow wnd = new HelloWindow();
wnd.ShowDialog();
}

}
}