Jump to content

Serving-Up Your BroadCam Content More Effectively--Tutorial


dedlykme

Recommended Posts

Serving-Up Your BroadCam Content More Effectively--Tutorial

 

I'm going to be bold here and offer a few suggestions to the BroadCam Video Streaming Server ("BVSS") User Community which, at least for may part, have improved my capabilities and general state of "Zen" when using BVSS. While BVSS is (in my experience) the best combination of being the easiest, most painless, & generally good quality media server available for the Windows OS, it is no secret that support from NCH Software hard to come by (sorry NCH..., but it's true).

This post will be the first in a series (probably) which will endeavor to share with my fellow Users some good, handy tips & tricks which I have found, thoroughly tested and which have improved upon the use of BVSS in some way.

 

So..., today the two topics I am going to discuss are the "Web Server" and "Modernizing Your BVSS Embed Scripting/Code".

 

First, the "Web Server"----

 

The "Web Server" that is bundled with BroadCam is NOT essential to the operation of the Media Server component (like Flash Media Server or Wowza) of the BroadCam Video Streaming Server. It is simply a generic web (www/html) server that is bundled with BroadCam for all the n00bs out there who don't know any better. The problem is, that it is really NOT a very good one at all, and it is kind of a resource hog due to being poorly written as well as being quite insecure.

If you are not using an account with a Web Hosting provider to host your web pages (there are plenty of free ones out there, too), and are serving up the web pages from your own local computer, I strongly recommend getting/installing a "real" web server such as XAMPP (Apache) or LightHttpD, both of which are free/open-source, highly supported standards based, and much more lightweight (not as taxing on your computer). LightHttpD is slightly more lightweight than XAMPP (hence the name) but either one is good. Just "Google" search terms "XAMPP Windows" and/or LightHttpD Windows". Each of these web servers has an editable text file named "httpd.conf" located in a directory/folder named "conf" where you can set the default server port (generally port "80") to any port number that works best for you. (See the Notes on "Using Custom Ports"*** below.)

The way to permanently turn-off/disable the web server that is bundled with BroadCam is to click on "Options", and under "Non Secure Web Access" click on the "Stop" button. Then click "OK" and are back at the BroadCam main interface window. Finally, exit BroadCam by clicking "File" - "Exit (Turn Off)" - "Stop", and then restart BroadCam.

The bundled web server component of BroadCam will no longer start-up with BroadCam (unless you re-enable it in "Options"), however, the Media Server component of BroadCam still starts-up automatically.

When using a different web server with BroadCam, you need to open "C:\Documents and Settings\All Users|Application Data\NCH Software\BroadCam\Web" in Windows Explorer and copy/upload the "nchplayer.swf" file to the same directory/folder where your hosted web pages are located. The plain-vanilla, generic web page "embed" code used by BVSS for your videos now needs to look like these samples:

 

Live Stream Sample**--

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="640" height="480">

<param name="movie" value="nchplayer.swf?host=Your_IP_Or_Hostname(FQDN):1935&scope=BroadCam&streamName=live&bandwidth=1&src=1&autostart=true">

<param name="allowfullscreen" value="true">

<param name="quality" value="high">

 

<embed src="nchplayer.swf?host=Your_IP_Or_Hostname(FQDN):1935&scope=BroadCam&streamName=live&bandwidth=1&src=1&autostart=true" width="640" height="480" allowfullscreen="true" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"/>

</object>

 

Recorded Video On Demand Sample**--

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="640" height="480">

<param name="movie" value="nchplayer.swf?host=Your_IP_Or_Hostname(FQDN):1935&scope=BroadCam&streamName=vod&bandwidth=1&src=myvideo&autostart=true">

<param name="allowfullscreen" value="true">

<param name="quality" value="high">

 

<embed src="nchplayer.swf?host=Your_IP_Or_Hostname(FQDN):1935&scope=BroadCam&streamName=vod&bandwidth=1&src=myvideo&autostart=true" width="640" height="480" allowfullscreen="true" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"/>

</object>

 

Before you fool around with the video embed script/code in your web pages I STRONGLY URGE you to read the second topic in this post: "Modernizing Your BVSS Embed Scripting/Code"

 

**Notes on the "FlashVars" (variables) in the code:

a.) For both Live and On Demand Video streams the "bandwidth=#" variable will always be "1" for your "Broadband"/higher-bitrate (in "Options") streams, and will be "0" for you "Dialup"/lower-bitrate streams.

b.) For Live Video streams the "src=#" variable will always be "1" for the first (or only, if applicable) stream that appears in the "Live Video Streams" window of the main BroadCam interface. Additional Live Streams will be numbered as "src=2", "src=3", etc. in the order that they appear in the same main window.

c.) For On Demand (recorded) Video Streams the "src=______" variable will always the file name of your pre-recorded/encoded video, ***minus*** the file extension ("myvideo" when the actual video is named "myvideo.flv"). In case you don't already know, BroadCam places your pre-recorded/encoded videos in to the following folders:

"C:\Documents and Settings\All Users|Application Data\NCH Software\BroadCam\High" for your "Broadband"/higher-bitrate videos,

and,

"C:\Documents and Settings\All Users|Application Data\NCH Software\BroadCam\Low" for your "Dialup"/lower-bitrate videos.

 

***Notes on "Using Custom Ports":

To change the port number used by BVSS for its bundled web server from default port number of port "86" (blocked by many ISP's), just click on "Options" & go to the first tab marked "Web Access". There you will see two buttons labeled "Configure" (one each for the "Private Network" & for the "Public Network").

Click on each of those & the resulting pop-up window will show and easily configurable "Port" setting where you can enter the port of your choice. Then click "OK" as many times as it takes until you have exited "Options" and are back at the BroadCam main interface window.

Don't forget to configure **both** the Private & Public Networks so that you don't get confused trying to access your media pages.

Important advice:

Choosing the wrong TCP or UDP custom port numbers for your applications can cause a conflict if that port number is already registered/pre-allocated by IANA for a different internet protocol/application. Whenever you configure a custom port for any internet application **always** check the current IANA List of Registered Ports which is available at:

 

http://www.iana.org/assignments/port-numbers

 

Personally, I always use TCP and/or UDP ports in the range of 34981-35353 since they are not registered/assigned to any other protocol/application and, as such, are never blocked by any ISP's.

Note: For Flash Media delivery you cannot change the port (port 1935), as that is the registered/assigned port for the Flash RTMP media delivery protocol and is hard coded as such into Flash Media Delivery applications.

As always, don't forget to open up the applicable ports (1935 & #####) in both any software **and** hardware (router) firewall(s) and, if you do, you can ignore the "Routing" warnings that show up in red on the BVSS "Web Access" tab in "Options".

 

 

 

 

Second, "Modernizing Your BVSS Embed Scripting/Code"----

 

The embed script/code samples shown above in the "Web Server" topic section are in the format that BroadCam generates in its sample pages/helpfile for n00bs. This format of embed code is klunky, ugly, cumbersome to deal with, and has been abandoned as outmoded by the Flash Standard & Adobe for quite a long time. There is a much cleaner, more current, and fully tested method of embedding your BroadCam video content in web pages using the most current "swfobject-2.2.js"(10KB) file, which is made publicly available by Adobe and by Google Code, and which uses a much more efficient, pretty, and more easily editable embed script. Some people prefer to leave the "swfobject-2.2.js" file hosted on Google's servers and access it using the URL that they provide to the public, but I prefer to host the file myself on my web server rather than depend on Google (it's only 10KB for Pete's sake).

First..., don't panic..., this is **soooooo eeezeeepeeezeee** to do!!

I have thoroughly tested this with BVSS, and have put everything you that need to do this in to a little ".zip" file ("bc_embed_files.zip"-21KB) that you can download from:

 

http://www.multiupload.com/WWKT0TAVC7

 

which also includes the samples given below.

So..., this first thing that you do after unzipping the zip-file is to copy the files contained in the "bc_embed_files" folder into the directory/folder where you place/host you web pages with embedded video. Next you need to edit simply your HTML files exactly as follows:

1. Between the "<HEAD>" and the "</HEAD" tags you insert "<script type='text/javascript' src='swfobject-2.2.js'></script>" (no quotes, obviously), so that the top part of your HTML page would look something like this really basic sample:

 

<html>

<head>

<script type='text/javascript' src='swfobject-2.2.js'></script>

<title>Video</title>

</head>

<body

style="color: #999999; background-color: #000000;"

alink="#ffffff" link="#3366ff" vlink="#999999">

<font size="1">

<span style="font-family: Verdana;">

 

Of course all of the "style", "font", "title" stuff is up to you.

 

2. Next it's time to put the nice, pretty, new BVSS video embed script/code into your web pages just like the following samples:

 

Live Stream Sample--

 

<div id='mediaplayer'></div>

 

<script type="text/javascript">

 

var flashvars = {

'provider': 'rtmp',

'host': 'Your_IP_Or_Hostname(FQDN)',

'scope': 'BroadCam',

'streamName': 'live',

'bandwidth': '1',

'src': '1',

'autostart': 'true',

'image': 'http://Your_IP_Or_Hostname(FQDN)/start_frame.jpg'

};

 

var params = {

'allowfullscreen': 'true',

'quality': 'high',

'allowscriptaccess': 'always'

};

 

var attributes = {

'id': 'player1',

'name': 'player1'

};

 

swfobject.embedSWF('nchplayer.swf', 'mediaplayer', '640', '480', '9', 'false',

flashvars, params, attributes);

 

</script>

 

 

Recorded Video On Demand Sample--

 

<div id='mediaplayer'></div>

 

<script type="text/javascript">

 

var flashvars = {

'provider': 'rtmp',

'host': 'Your_IP_Or_Hostname(FQDN)',

'scope': 'BroadCam',

'streamName': 'vod',

'bandwidth': '1',

'src': 'myvideo',

'autostart': 'true',

'image': 'http://Your_IP_Or_Hostname(FQDN)/start_frame.jpg'

};

 

var params = {

'allowfullscreen': 'true',

'quality': 'high',

'allowscriptaccess': 'always'

};

 

var attributes = {

'id': 'player1',

'name': 'player1'

};

 

swfobject.embedSWF('nchplayer.swf', 'mediaplayer', '640', '480', '9', 'false',

flashvars, params, attributes);

 

</script>

 

**Notes as to the FlashVars (variables) in the code:

a.) For both Live and On Demand Video streams the "bandwidth" variable will always be "1" for your "Broadband"/higher-bitrate (in "Options") streams, and will be "0" for you "Dialup"/lower-bitrate streams.

b.) For Live Video streams the "src" variable will always be "1" for the first (or only, if applicable) stream that appears in the "Live Video Streams" window of the main BroadCam interface. Additional Live Streams will be numbered as "2", "3", etc. in the order that they appear in the same main window.

c.) For On Demand (recorded) Video Streams the "src" variable will always the file name of your pre-recorded/encoded video, ***minus*** the file extension ("myvideo" when the actual video is named "myvideo.flv"). In case you don't already know, BroadCam places your pre-recorded/encoded videos in to the following folders:

"C:\Documents and Settings\All Users|Application Data\NCH Software\BroadCam\High" for your "Broadband"/higher-bitrate videos,

and,

"C:\Documents and Settings\All Users|Application Data\NCH Software\BroadCam\Low" for your "Dialup"/lower-bitrate videos.

d.) For both Live and On Demand Video streams the new "image" variable allows you to set a static "Start Frame" image (.jpg), which is displayed in the player when the video stream is not playing and/or before it starts.

 

Again, I have put everything you that need to do this in to a little ".zip" file ("bc_embed_files.zip"-21KB) that you can download from:

 

http://www.multiupload.com/WWKT0TAVC7

 

which also includes the samples given above.

 

Well.., that's all for today..., but if you are so motivated, you might want to consider watching this thread because coming **very soon** is:

1. "'Skinning'/Customizing the Appearance of the Nchplayer" -- I have just about perfected this and, no..., it is not a hack. But let's face it..., the Nchplayer in it current form is really kind of an "ugly duckling" just waiting to be a "swan" (Sorry again, NCH..., nothing personal).

2. "Using the JW Player (and others..., maybe) With BVSS" -- I have written a tiny, little script (less then 1KB) which asynchronously (both directions: to & from the server) translates the Flash variables ("FlashVars") so that they can be understood by the JW Player, BVSS, and vice-versa. This is in the final, "fail-safe" testing phase. If you haven't heard of the JW Player, Google it..., it's very cool. This script also has the potential for use with additional players such as the Flowplayer and various other Flash/Action-Script players. I'm kinda proud of this one!

 

Okay so..., ciao for now.

Good Luck & Happy Streaming,

 

DeDLykMe

"When the going gets weird, the weird turn pro."

-- Hunter S. Thompson

Link to comment
Share on other sites

  • 1 year later...

dedlykme:

 

Hi I tried you embedded Flash code by saving the following as html in notepad:

 

_______________________________________________________________________

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macr...ersion=9,0,0,0" width="640" height="480">

<param name="movie" value="nchplayer.swf?host=Your_IP_Or_Hostname(FQDN):1935&scope=BroadCam&streamName=live&bandwidth=1&src=1&autostart=true">

<param name="allowfullscreen" value="true">

<param name="quality" value="high">

 

<embed src="nchplayer.swf?host=Your_IP_Or_Hostname(FQDN):1935&scope=BroadCam&streamName=live&bandwidth=1&src=1&autostart=true" width="640" height="480" allowfullscreen="true" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com...tflashplayer"/>

</object>

____________________________________________________________________

While I had been using :

_________________________________________________________________________

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="480" height="360">

<param name="movie" value=Your_IP_Or_Hostname(FQDN)/nchplayer.swf?host=Your_IP_Or_Hostname(FQDN):1935&scope=BroadCam&streamName=live&bandwidth=1&src=1&autostart=true">

<param name="allowfullscreen" value="true">

<param name="quality" value="high">

<embed src=Your_IP_Or_Hostname(FQDN):86/nchplayer.swf?host=216.195.174.123:1935&scope=BroadCam&streamName=live&bandwidth=1&src=1&autostart=true" width="480" height="360" allowfullscreen="true" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"/>

</object>

_____________________________________________________________________________

My old code worked fine but yours did not for me. I was working through your examples hoping to find if you have a method to serve a static jpg image from the stream like an ancient webcam. Perhaps you could help me find out what I did wrong with your code so I can move on. Help with the static image issue would also be greatly appreciated.

Link to comment
Share on other sites

  • 1 month later...
  • 7 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...