Tag Archives: Spyder

Building a Camera Tally Controller for Spyder

Over this past weekend I set out to create a camera tally device for the Spyder video processor.  Specifically, I wanted to try to use my relatively new Raspberry Pi 2 board running the Windows 10 IoT Core operating system to make something useful.  If you’ve read through my older blog posts, you’ve likely noticed that the Spyder is still my go-to target platform for playing with new technologies.  Let’s face it – when you’re playing with shiny new toys, it helps to mate it up with something you know very well so you don’t feel completely lost.  Before I get into the details, check out this brief video showing a working tally controller in action:

The whole process of building this device was simply fantastic.  The barrier to entry for people making hardware devices has gotten incredibly low over the past couple years, both from a cost and ease of development perspective.  The whole build process was very quick, and I had such a great time with it that I went ahead and put together a full 30 minute hardware and software video walk-thru for the project (more on this below).

Getting Started Making your own

To get started making your own, here are a couple links for the main hardware used on this project, as well as the wiring diagram for your reference.

Raspberry Pi 2 Kit ($70):  Amazon Link
8-Channel Relay Board ($9):  Amazon Link

Tally Wiring Diagram

Hardware Wiring Diagram for our Tally Controller

Links to the full source code, documentation resources, and a full YouTube walk-thru video are below.  This video has a ton of valuable information in there, covering the hardware specifics, Spyder implementation details, and the full process of creating our software application.  This is the first time I’ve gone through and made something this elaborate (and narrated the video), and I’ll be very interested to know what you think of it (so leave me a comment below if you’re so inclined).

GitHub Project (Source Code and Documentation):  Click Here

Next Steps

The tally controller we’ve created is certainly functional. but in it’s initial form the server IP address and tally source lists are hard-coded.  In the next stage of this project, we’re going to build a desktop application that can connect to the device remotely over the network and view/configure these properties.  We’ll also explore creating a user interface to run on the Pi’s HDMI output, which could be useful for monitoring and troubleshooting the device.

Until next time, take a look through those walk-thru video and the resources in the Github repository, and try to make one yourself.  I hope you enjoy going through this content as much as I enjoyed making it.

Bitmap Borders and Shadows: Part 2 of n

In the first part of this series of posts I discussed how to use the bitmap border / shadow feature on Spyder X20 and how it works under the hood.  In this post, I’m going to discuss the process for creating custom shapes and getting them loaded into the X20 video processor.  You might want to create custom shapes for any number of reasons, a common one being for corporate logos.  Below are a few examples of custom shapes I’ve generated for the sales team for various demos over time.

CNN_Logo 
DVD player video cut into CNN logo
Shards 
Another DVD player cut into shards

So How is a Shape Defined?

The bitmap border / shadow engine uses a XAML (eXtensible Markup Language)  parser to convert a vector-based shape definition into the specially formatted raster-based image that is loaded to the video processor hardware.  The shape definition is imported into the system as a .shape file, which contains a single XAML PathGeometry definition. Below is the contents of a shape file defining one of the ‘shard’ shapes above:

<PathGeometry
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Figures="M 100,0L 62.75,0L 51.75,24.3333L 
     65.9166,24.3333L 66.25,45.3333L 75.75,30.5L
     5.5833,62.3333L 92.5833,75.5L  100,75.8333L 100,0 Z "/>

The real meat of the shape definition is defined in the Figures section of a PathGeometry object, which is written in a mini path syntax.  In practice you’ll be copying and pasting this data out of a tool like Microsoft Expression Design, but in case your curious there are several pages online that describe the XAML path mini-language (one here) that you can peruse in your free time if your curious to know more about how this syntax works.

Tools of the Trade

There are many tools capable of generating XAML output, but my personal preference is Microsoft’s Expression Design tool.  You can download a 60-day free trial of this tool on Microsoft’s site (here).

You’ll also want to have a basic template file that you can paste your custom shape data into.  You can pull this off my site here.

OK I have the Tools, now what?

The steps involved are easier to show than describe, and so I created a video walkthrough showing the process of creating a custom shape with Expression Design, saving it into a .shape file, and then finally importing that shape into Spyder using Vista Advanced.  The walkthrough moves pretty fast; if you have any questions just leave a comment on this blog post for me and I’ll try my best to help.

 

Summary

So hopefully this post has helped explain the basics of creating custom shapes for your X20 system.  In the next post I’ll spend some more time building custom shapes and logos in Expression Design, and I’ll cover a few tips and tricks I’ve found to make the process more efficient.

Bitmap Borders and Shadows: Part 1 of n

In this next series of posts, I’m going to discuss the bitmap borders and shadows (BBS) feature that first appeared in Vista Advanced 3.5.0.  If you haven’t played with them yet, you owe it to yourself to do so. 

This first blog post will discuss how (and when) you can use the feature, how it works under the covers, and how to get the best possible performance from it.  If you have no idea what the bitmap borders and shadows feature is, take a look at the action shot below.

358

The image above shows two related features, bitmap borders and shadows and window titling.  I’m going to skip over titling for this post, and concentrate only on the bitmap border / shadow feature.

What Can I do With Bitmap Borders?

Bitmap borders goes beyond the traditional supported borders to enable custom shapes and fills to be defined.  Shadows applied will keep the same shape as the bitmap border, and can even have a color other than black defined (not shown).

one layer

Features Shown:

  1. Non-Rectangular window (rounded edges in this example)
  2. Image file used as border texture
  3. Shadow shape that matches the border shape

The Spyder software comes with about a dozen border shapes that you can use, as well as a number of images that can be used to texture the border.  Of course you can create and use custom shapes and fill images, which I’ll be discussing in detail in the next blog post.

The KeyFrame property panel contains handles for all of the available bitmap border and shadow adjustments, and I’ve included a few screenshots of the most interesting ones below.  Using them is pretty self explanatory, and so I won’t bother going through them exhaustively.

border settings border texture border shape
General Settings Border Texture Border Shape

 

So How Does It Work?

Under the covers, the border / shadow settings selected are used to generate a specially formatted image at a size relative to the input video resolution, which gets loaded once into the target layer where it is in turn merged with the video each frame. The Images below show this process.

Example - Source Video Frame Buffer (2048×1200)

In this frame buffer, the active video is repositioned so that it will fit correctly when merged with the border image loaded.  These offsets are programmed by the server as part of the image loading process

Example - Border Bitmap  Buffer (2048×1200)

This buffer stores the generated image which will be merged with the video.  Special bit values are encoded into the image to specify what area of the image should be mixed with the video and which area should be mixed with the VI.

Example - Both Resulting Image

Once the image is loaded, the hardware in the X20 layer will perform the video cutout and merge the image with the border on a frame-by-frame basis.

Note that the image sequence above makes a point to call out the frame buffer sizes in the layer hardware; a size of 2048×1200.  This is important because the generated image file previously mentioned needs to fit within these dimensions.  Since the image file must be loaded relative to the input video resolution, there may not be enough ‘free’ frame buffer space to generate the desired effect. 

In cases where there isn’t enough space to fit the requested bitmap border / shadow settings, the server will automatically scale back the border offset and then the border thickness until the image fits.

Also note that the image files generated can be relatively large, and in almost all cases you really need to be running a still server to ensure a good experience.  While technically the bitmap borders will work when using traditional USB loading, the image load times detract much of the experience.  There is additional information on the still server on the Vista forum site, and I’ve additionally just completed a post describing the still server here.

Where Bitmap Borders Won’t Work

There are a few scenarios where bitmap border functionality isn’t available, and this section attempts to list them all to save you from surprises in the field.

  • Input Resolutions above 2048 wide OR 1200 high.  This causes the layers to enter a special mode that uses two layer frame buffers, and there is no bitmap border support when in this mode.

  • Running a VI height above 1850.  When your running a VI at a height above 1850, certain layers cannot support still images, effectively disabling bitmap borders.

Tips for Getting the Best Experience

While certainly not required, the recommendations presented here are sure to be extremely beneficial for anyone using the bitmap border / shadow feature set.

Use a Still Server

I know I mentioned this already once in this post, but it can’t possibly be stressed enough.  If your using bitmap borders and shadows (or stills for that matter), then plunk down a few hundred bucks and buy a PC to hook up to your X20 for use as a still server.  The speed performance improvement when using this accessory can easily be over 10x. 

Build Treatments to Recall Bitmap Border Settings

Using treatments is good practice in general, but the load times involved with adjusting bitmap borders and shadows make it an even more beneficial practice.  Instead of manually adjusting KeyFrame parameters each time you want to setup a bitmap border, just make a treatment for the looks you use most frequently (border / shadow treatment settings include bitmap border options).  Not only does this clean up the workflow for the operator, the on-screen experience is nicer since the system will use the smooth go processor to automatically pull the layer off screen while loading the border.

Summary

I always like knowing how things work under the hood, and if your like me then hopefully this has shed a little light on how the bitmap border and shadow feature works.  In the next post, I’m going to discuss how you can create your own custom border shapes and use them with the Spyder X20.