nanoStream Documentation – LiveVideoEncoder-Plugin – Programming with MFC

nanoStream ActiveX Plugin – VisualC++ and MFC

This tutorial shows how easy it is to create a custom Live Encoding and Streaming application with the nanoStream plugins, based on VisualStudio, C++ and MFC.

This tutorial was created with VisualStudio 2008, but should work similar with VS 2010.

Create a new MFC Application Project (File/New Project)

screenshot - nanoStream Life Video Encoder - new-project

In the following MFC Application Wizard, select “Dialog Based Application”

screenshot - nanoStream Life Video Encoder - application-settings

Select all default values for the rest and Finish

screenshot - nanoStream Life Video Encoder - generated classes

A new project solution is created based on an empty dialog.
Right-click on the dialog and select “Insert ActiveX Control…”

screenshot - nanoStream Life Video Encoder - insert-active-x

Select “nanoStream RTMPActiveX Class”

screenshot - nanoStream Life Video Encoder - rtmpActiveX

Position and resize the control window accordingly.
The window will show a live camera preview later.

screenshot - nanoStream Life Video Encoder - ATL Control

Create a class member variable for the control for simpler access:

nanoStream Life Video Encoder -

Now let us create a button to create a camera preview.
From the Toolbox, select “Button” and place the button on the dialog.

screenshot - nanoStream Life Video Encoder - place button

Double-Click on the button to edit the new source code event handler:

screenshot nanoStream Life Video Encoder - event-handler

This is the complete code which shows the camera preview: