HOME   Search Articles   All Articles   Submit an Article Random Article   Contact Us
  Fri Jan 27th,2012 04:10 pm Welcome Guest, Please LOGIN to your account or SIGNUP now
  Search Articles
 
Keyword
Exact phrase
All words (AND)
Any word (OR)
 
 
  Categories
  Media Server
  Action Script
  Apps
  Basic Hosting...
  Breeze
  Flash and XML
  Flash Live Streaming
  Flash Media Server
  Flash Players - PC
  Flash Players - PHP...
  Flash Players -...
  Flash Players -...
  Flash Press Releases
  Flash Video (FLV)...
  Flex
  FLV Coding
  FLV Encoding
  FLV Help
  FLV Hosting...
  FLV Software
 
  Authors
  shakespere
  hosting unleashed
  charlton Ting
  flv player maker
  flash flv
  Kevin Kelleher
  peter adre
  Mark tailer
  Delcious
  flvguru
More Authors List 
 
  Subscribe Articles
 
Email Address
Subscribe
Unsubscribe
 
 
  Our Sponsors
 
 
   
 
 Editor's Pick
 Flash Player 11: Encoding Live Video to H.264/AVC
 

New in Flash Player 11: Encoding Live Video to H.264/AVC

Posted on October 31, 2011 at 6:59 pm in Development, Media Solutions

The latest version of Flash Player (v.11.0) includes some exciting new features, including performance upgrades such as native 64-bit support, and asynchronous bitmap decoding. Perhaps most newsworthy though, is Flash Player's new capability to encode live video streams to the H.264/AVC standard. This new feature will allow developers to create real-time, high-quality, live video streaming applications for chat, conferencing, and live event broadcasting.

The following article demonstrates how to take advantage of Flash Player 11.0′s new H.264 encoding capabilities within a video streaming application built using Flash Builder 4.5. The application does the following:

  • Captures live video from a webcam
  • Establishes a connection to Flash Media Server 4.5 using the NetConnection class
  • Publishes video stream from application to FMS using an instance of the NetStream class
  • Displays outgoing video stream from camera (prior to being encoded) in a Video component within the application
  • Sends encoding parameters to Flash Player 11.0 to encode the raw webcam video to H.264
  • Displays encoded video's metadata, demonstrating that encoding worked
  • Streams live, encoded video from FMS to the application using another instance of the NetStream class
  • Displays newly encoded, streamed live video in another Video component within the application

H.264 Encoding in Flash Player 11.0 Example Application

Example Application showing live stream from webcam (left) and stream encoded to H.264 in Flash Player 11.0 (right).

To follow along with the example, please be sure to have the following:


Getting Started - Configuring Compiler Settings

To develop applications that target the new features available in Flash Player 11.0, it is necessary to configure the compiler to target player-version "11.0″, and SWF-version "13″, as well as the playerglobal.swc for Flash Player 11.0. To make these changes:

    1. Download the new playerglobal.swc for Flash Player 11.0, and rename this file from "playerglobal11_0.swc" to "playerglobal.swc".
    2. Create a folder named "11.0" in the directory "frameworkslibsplayer" that is inside your Flex SDK installation folder. (Fig. 1.0)
    3. Put the playerglobal.swc inside the new folder ("11.0").
    4. Locate the file "flex-config.xml", that is located in the "frameworks" folder within your Flex SDK installation directory.
    5. Within "flex-config.xml", locate the "target-player" tag, which specifies the minimum player version that will run the compiled SWF.
    6. Set "target-player" value to "11.0". (Fig.1.1)
    7. Also within "flex-config.xml", locate the "swf-version" tag, which specifies the version of the compiled SWF.
    8. Set "swf-version" value to "13". (Fig. 1.1)
    9. Save "flex-config.xml".

CreateFolderForPlayerGlblSwc

Figure 1.0. Create a folder for the playerglobal.swc named "11.0″.

Edit Values in flex-config

Figure 1.1. Edit values of "target-player" and "swf-version" tags within the flex-config.xml file.


Setting Up the Project in Flash Builder 4.5

The example application is a simple ActionScript 3.0 project (not a Flex or AIR project). To create a similar project in Flash Builder:

    1. Choose File -> New -> ActionScript project.
    2. Name the project "H264_Encoder", and click "Finish".
    3. In Flash Builder, with the H264_Encoder project selected, choose Project -> Properties.
    4. Verify that the compiler is targeting Flash Player 11.0. (Fig. 1.2) If it isn't, select the "Use a specific version" radio button, and type "11.0.0″ for the value.

SettingFlashPlayerVersionInFlashBuilder

Figure 1.2. Make sure that the compiler is targeting Flash Player 11.0 by inspecting the project's properties.

At this point, the application should look similar to the following:

package
{
public class H264_Encoder extends Sprite
{
public function H264_Encoder()
{
}
}
}

Next up, you'll be modifying the application so that it can communicate with your webcam. In addition, you'll add the code necessary for establishing a NetConnection to connect the application to Flash Media Server, as well two NetStream instances; one responsible for getting the video from the application into Flash Media Server, and one for bringing it back from the server into the application.


Coding the Application – Connecting a Camera, Establishing a NetConnection and NetStreams
    1. Directly under the opening class definition statement, but before the constructor method, create a private variable named "nc", and data typed as a NetConnection. Use code hinting to have Flash Builder generate the necessary import statements for you by starting to type "NetC..", then hit CTRL-SPACE to receive code hinting. Select "NetConnection" from the list, and notice that Flash Builder has imported the NetConnection class from within the flash.net package. If for some reason the import fails, go ahead and import it manually. Your code should appear as follows:

package
{
import flash.net.NetConnection;

public class H264_Encoder extends Sprite
{
private var nc:NetConnection;

public function H264_Encoder()
{
}
}
}

    1. Create two private variables to represent the NetStreams data typed as NetStream. Create one for the stream going from the application to the server (ns_out), and another for the stream coming back into the application from the server (ns_in), and remember to use code hinting to have Flash Builder import the necessary classes.

package
{
import flash.net.NetConnection;
import flash.net.NetStream;

public class H264_Encoder extends Sprite
{
private var nc:NetConnection;
private var ns_out:NetStream;
private var ns_in:NetStream;

public function H264_Encoder()
{
}
}
}

    1. Next, create a private variable named "cam" of type "Camera", and set its value = "Camera.getCamera()". The Camera class is a little different than other classes, in that you don't call a constructor to instantiate an object of type Camera. Instead, you call the getCamera() method of the Camera class. This method will return an instance of a Camera object unless there isn't a camera attached to the computer, or if the camera is in use by another application.

private var cam:Camera = Camera.getCamera();

Make sure the Camera class was imported:

import flash.media.Camera;

    1. It is now time to add code that will allow the application to connect to Flash Media Server using an instance of the NetConnection class. Under the import statements, the local variables, and the closing brace of the constructor function, create a private function named initConnection() that takes no arguments and returns void:

private function initConnection():void
{
}

    1. As the first line of the function body, create a new NetConnection by instantiating the nc:NetConnection variable, which you declared in step 1:

nc = new NetConnection();

    1. It's always a good practice to verify that the NetConnection was successful. Next, add an event listener to listen for an event named "onNetStatus()". You will create the onNetStatus() event in the next section:

nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);

Be sure to either use code hinting, or import manually, the NetStatusEvent class, which is in the flash.events package:

import flash.events.NetStatusEvent;

    1. Next, and still within the initConnection() function body, tell the NetConnection where to connect to by calling the connect() method of the NetConnection class. As an argument to this method, add the URL for the location of the "live" folder within the installation Flash Media Server you want to connect to. The URL included in the example uses the RTMP protocol, and connects to the "live" folder within a copy of Flash Media Server installed on one of our servers. You can also stream to a local version of Flash Media Server, if you have one installed, by setting the URL to: "rtmp://localhost/live".

nc.connect("rtmp://office.realeyes.com/live");

    1. Finally, tell the NetConnection where Flash Media Server should invoke callback methods by setting the value for the NetConnection's "client" property to "this". Callback methods are special handler functions invoked by Flash Media Server when a client application establishes a NetConnection. Later on in this example you will work with the "onMetaData()" and "onBWDone()" callback methods. You will include these callback methods within the main application class, which is in fact the same object that will establish the NetConnection, and therefore the value of the NetConnection instance's (nc) client property should be set to "this".

nc.client = this;

The completed initConnection() function should appear as follows:

private function initConnection():void
{
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
nc.connect("rtmp://office.realeyes.com/live");
nc.client = this;
}


Coding the Application – Verifying a Successful NetConnection
    1. As mentioned, it's always a good practice to verify the success of a NetConnection attempt. To do this, create a protected function named onNetStatus() that takes an event, named "event", of type "NetStatusEvent" as its only argument, and returns void:

protected function onNetStatus(event:NetStatusEvent):void
{
}

    1. Within the onNetStatus() event body, create a Trace statement that outputs the value of event.info.code to the console during debugging. The code property of the info object in the NetStatus event will contain String data that indicates the status of the attempted NetConnection, such as "NetGroup.Connect.Success", or "NetGroup.Connect.Failed". Tracing the value of this property allows you to confirm the status of the NetConnection easily by simply running the application in debug mode.

protected function onNetStatus(event:NetStatusEvent):void
{
trace(event.info.code);
}

    1. Next, within the function body, and beneath the existing Trace statement, create a conditional statement that checks the value of event.info.code and compares it to the value "NetConnection.Connect.Success". If event.info.code == "NetConnection.Connect.Success", call three functions that you will create in the next section; one that publishes an outgoing video stream, one that displays the incoming video from the webcam, and one that displays the video stream being sent back to the application from the server. The completed onNetStatus() function should appear as follows:

protected function onNetStatus(event:NetStatusEvent):void
{
trace(event.info.code); if(event.info.code == "NetConnection.Connect.Success")
{
publishCamera();
displayPublishingVideo();
displayPlaybackVideo();
}
}

    1. This example attempts to connect to the server and start playing/publishing video automatically when launched. To achieve this, call initConnection() from within the main class' constructor method:

public function H264_Encoder()
{
initConnection();
}

At this point, you have included the code necessary to establish a NetConnection, and verify the success or failure of that connection with a Trace statement. In addition, you've included calls to functions that, when written, will handle the publishing and playback of the video from the webcam, as well as the video coming back from the server.

If you save the application now you'll notice some errors. The calls to publishCamera(), displayPublishingVideo(), and displayPlaybackVideo() generate errors because we haven't written them yet. You can comment out the calls to these functions and run the application in debug mode. If everything is set up correctly, you should see the Trace output "NetConnection.Connect.Success".

Comment out calls to unwritten functions

However, you should also see this error in the console: "ReferenceError: Error #1069: Property onBWDone not found on flash.net.NetConnection and there is no default value.". This is because Flash Media Server is attempting a callback function on the application that hasn't been written yet. In the next section you will include those callback functions.

connect success and bwdone error in console


Coding the Application – Including the Callback Functions, and Creating a TextField to Display Metadata

The sample application contains two callback functions – onBWDone(), and onMetaData(). The onBWDone() callback checks for available bandwith, which can be useful in applications that need to dynamically switch video assets according to the bandwith that's currently available. Although it's necessary to include this function in the client code (omitting it will generate an error when the server tries to make the function call) it's not necessary to actually do anything with it. This application isn't concerned with monitoring bandwith, so it can be left as an empty function.

The onMetaData() callback function is useful for accessing a video stream's metadata, and you will be adding code to this callback to do just that. The onMetaData() callback returns an Array of generic objects that represent the video stream's metadata. In the next section, you will create those objects to represent various metadata, and access their values in order to display the information within the UI. For now, you will simply add the two callback functions, and add some code to onMetaData() to access that metadata. In addition, you will create a TextField that you will eventually use to display the metadata in the UI.

    1. Create a new private instance variable named "metaText", and type it as an instance of the TextField class. Set its initial value to "new TextField()"

private var metaText:TextField = new TextField();

*Note – At this point you are simply creating the metaText object in memory. You won't actually add it to the display list until further on in the example.

Be sure to import the necessary TextField class:
import flash.text.TextField;

    1. Include the required onMetaData() callback function. Create a new public function named "onMetaData()" that accepts an Object named "o" as its only parameter, and returns void.

public function onMetaData( o:Object ):void
{
}

    1. To access the video stream's metadata, you will loop through the objects returned by the onMetaData() callback function. Again, you will create those objects in the next section, but for now, within the onMetaData() function create a "for…in" loop to loop through the objects. Within the loop's initializer, declare a local variable named "settings" data typed as a String within the Object "o".

public function onMetaData( o:Object ):void
{
for (var settings:String in o)
{
}
}

    1. Next, within the loop body, include a Trace statement that will output the name of each "settings" object returned by onMetaData(), concatenated with "=", and the object's value.

trace(settings + " = " + o[settings]);

    1. Finally, inside the for…in loop body, assign a text value to the metaText variable equal to each returned object's name, concatenated with "=", and the object's value. Create a new line for each iteration, and adjust the spacing between the double quotes, (and add an extra " " if you want to double-space the text) to properly layout the text in the UI.

metaText.text += " " + " " + settings.toUpperCase() + " = " + o[settings] + " ";

*Note* The layout and styling in this example are not intended to be examples of UI programming best practices. UI programming is outside the scope of this article.

The completed onMetaData() callback function should be similar to the this:

public function onMetaData( o:Object ):void
{
for (var settings:String in o)
{
trace(settings + " = " + o[settings]);
metaText.text += " " + " " + settings.toUpperCase() + " = " + o[settings] + " ";
}
}

    1. Next, add the onBWDone() callback function. Create a new public function named "onBWDone()" that takes no arguments, and returns void.

public function onBWDone():void
{
}

Remember that the onBWDone() callback function is what Flash Media Server uses to check available bandwith, and this application doesn't require that information. It still must be included, however, since the server will be calling it on the application object. To avoid a runtime error, simply include an empty onBWDone() callback.

public function onBWDone():void
{
}

Now that the application has the necessary callback functions, and it loops through the objects returned by onMetaData() to populate a TextField with that data, it's time to add code that enables the application to read webcam data, encode that webcam data to the H.264 standard, and to then stream the encoded video.


Coding the Application – Setting Up H.264 Encoding, and Publishing to the NetStream

In this next section, you will attach your webcam to an instance of the Camera class. You will then encode the webcam input to H.264 using properties of the Camera class, and new H264VideoStreamSettings class. Certain encoding parameters can't be set (yet, although support for this is hopefully coming soon) with the new H264VideoStreamSettings class, so you'll be setting those values from properties in the Camera class.

Next, you will attach the encoded video to a live video stream, and stream it to Flash Media Server's "live" directory. (You will bring a new stream back into the application from Flash Media Server in the next section)

Finally, in order to read the metadata of the newly encoded video stream, you will call the send() method of the NetStream class (available only when using Flash Media Server). As arguments to the send() method, you will include @setDataFrame, a special handler method within Flash Media Server, the onMetaData() callback method you added earlier to listen for the metadata client-side, and finally, the name of a local variable ("metaData"), data typed as an Object, used to represent the desired metadata items. First:

    1. Create a protected function named "publishCamera()" that takes no arguments and returns void:

protected function publishCamera():void
{
}

    1. In the first line of this new function, instantiate the ns_out NetStream object by calling its constructor. Pass the constructor the NetConnection instance "nc":

ns_out = new NetStream(nc);

    1. On the next line, attach the Camera instance "cam" to the outgoing NetStream by calling the attachCamera() method of the NetStream class. Pass this method the cam instance:

ns_out.attachCamera(cam);

    1. Next, create a new local variable named "h264Settings", data typed as H264Settings and set its initial value equal to "new H264Settings()":

var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();

Be sure to import the H264VideoStreamSettings class:

import flash.media.H264VideoStreamSettings;

    1. Call the setProfileLevel() method of the H264Settings class on the h264Settings object to encode the video using the "BASELINE" profile, and a level of "3.1″:

h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_3_1);

Be sure to import both the H264Profile class, and the H264Level class:

import flash.media.H264Level;
import flash.media.H264Profile;

    1. Next, use the setQuality() method of the Camera class to encode the video stream at 90000 bps (900Kbps), and with a quality setting of "90″:

cam.setQuality(90000, 90);

    1. Use the setMode() method of the Camera class to set the video's width, height, and frames per second, and to determine if it should maintain its capture size when if camera has no default behavior for this parameter:

cam.setMode(320, 240, 30, true);

    1. Next, using the setKeyFrameInterval() method of the Camera class, set the video's keyframe interval to 15 (once every two seconds):

cam.setKeyFrameInterval(15);

  1. To set the outgoing video's compression settings, assign the values of the h264VideoStreamSettings variable to the videoStreamSettings property of the outbound stream, "ns_out"
    ns_out.videoStreamSettings = h264Settings;
  2. Call the publish() method of the NetStream class on the outgoing NetStream, and pass it parameters to provide a name for the stream ("mp4:webCam.f4v"), as well as a destination folder in Flash Media Server ("live"):
  3. ns_out.publish("mp4:webCam.f4v", "live");
  4. Now it's time to create the objects that will hold the metadata values of the encoded video you will access at runtime. Create a new local variable named "metaData", data typed as an Object, and set its initial value equal to "new Object()":
  5. var metaData:Object = new Object();
  6. These metaData objects are generic, meaning you can assign any name/value pairs you like. For example, there's no encoding setting that comes from the Camera, VideoStreamSettings, or H264VideoStreamSettings classes that would allow you to display a copyright, but you can add one easily enough like this:
  7. metaData.copyright = "Realeyes Media, 2011";

    Of course, you can also create objects with values that do come from settings within the aforementioned classes, such as:

    metaData.codec = ns_out.videoStreamSettings.codec;
    metaData.profile = h264Settings.profile;

  8. Create the following metaData objects and add them to the publishCamera() function:
  9. metaData.codec = ns_out.videoStreamSettings.codec;
    metaData.profile = h264Settings.profile;
    metaData.level = h264Settings.level;
    metaData.fps = cam.fps;
    metaData.bandwith = cam.bandwidth;
    metaData.height = cam.height;
    metaData.width = cam.width;
    metaData.keyFrameInterval = cam.keyFrameInterval;
    metaData.copyright = "Realeyes Media, 2011";
  10. Call the send() method of the NetStream class on the ns_out object and pass it the name of the handler method "@setDataFrame", and the callback method "onMetaData", as well as the local variable metaData:
  11. ns_out.send("@setDataFrame", "onMetaData", metaData);

    The completed publishCamera() function should resemble the following, with the exception of the commented-out code:

    protected function publishCamera():void
    {
    ns_out = new NetStream(nc);
    ns_out.attachCamera(cam);
    var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();
    h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_3_1);

    // ALTHOUGH FUTURE VERSIONS OF FLASH PLAYER SHOULD SUPPORT SETTING
    // ENCODING PARAMETERS ON h264Settings BY
    // USING THE setQuality() and setMode() METHODS,
    // FOR NOW YOU MUST SET THE PARAMETERS ON THE CAMERA FOR:
    // BANDWITH, QUALITY, HEIGHT, WIDTH, AND FRAMES PER SECOND.
    // h264Settings.setQuality(30000, 90);
    // h264Settings.setMode(320, 240, 30);

    cam.setQuality(90000, 90);
    cam.setMode(320, 240, 30, true);
    cam.setKeyFrameInterval(15);
    ns_out.videoStreamSettings = h264Settings;
    trace(ns_out.videoStreamSettings.codec + ", " + h264Settings.profile + ", " + h264Settings.level);
    ns_out.publish("mp4:webCam.f4v", "live");

    var metaData:Object = new Object();
    metaData.codec = ns_out.videoStreamSettings.codec;
    metaData.profile = h264Settings.profile;
    metaData.level = h264Settings.level;
    metaData.fps = cam.fps;
    metaData.bandwith = cam.bandwidth;
    metaData.height = cam.height;
    metaData.width = cam.width;
    metaData.keyFrameInterval = cam.keyFrameInterval;
    metaData.copyright = "Realeyes Media, 2011″;
    ns_out.send("@setDataFrame", "onMetaData", metaData);
    }


Coding the Application – Displaying and Encoding the Video From the Webcam, and Displaying Video Streamed Back From the Server

The application needs to display both the raw, un-encoded incoming video from the webcam, as well as the inbound streaming video after it has been encoded to H.264 in the Flash Player, sent to Flash Media Server, and then back to the application. In addition, the metadata that you defined in the previous section needs to be displayed in the UI to reveal the encoding settings defined in publishCamera().

In this next section, you will create two functions, displayPublishingVideo(), and displayPlaybackVideo() to play the streams and display the metadata on screen.

    1. Create a new private instance variable named vid_out, and set its data type to Video:

private var vid_out:Video;

Be sure to import the Video class:

import flash.media.Video;

This new instance of the Video class will be used to playback the not-yet-encoded video coming in from the webcam.

    1. Next, create a protected function named displayPublishingVideo() that takes no arguments and returns void:

protected function displayPublishingVideo():void
{
}

    1. In the first line of the function body, instantiate the vid_out variable by calling the constructor method of the Video class:

vid_out = new Video();

    1. To place the new Video component on screen correctly, assign x and y values to vid_out so x = 300, and y = 10

vid_out.x = 300;
vid_out.y = 10;

    1. Next, use the height and width values from the webcam to set the height and width of the video display:

vid_out.width = cam.width;
vid_out.height = cam.height;

    1. To allow the vid_out component to display video coming from the webcam, call the attachCamera() method of the Video class, and pass that method the instance of the Camera class that represents the webcam:

vid_out.attachCamera(cam);

    1. Finally, add vid_out to the display list by calling the addChild() method of the DisplayObjectContainer class:

addChild(vid_out);

At this point, the displayPublishingVideo() function should look similar to:

protected function displayPublishingVideo():void
{
vid_out = new Video();
vid_out.x = 300;
vid_out.y = 10;
vid_out.width = cam.width;
vid_out.height = cam.height;
vid_out.attachCamera(cam);
addChild(vid_out);
}

If you run the application at this point, provided you have a webcam attached to your computer (and you un-commented the calls to the functions publishCamera(), and displayPublishingVideo() within onNetStatus()), you should see the Flash Player dialog that asks permission to access your camera. Grant Flash Player permission, and you should now see a live video feed coming from your webcam.

Next, you'll add code to the displayPublishingVideo() function that will display the metadata objects you created earlier. The metadata text won't show up until the code is in place to handle the incoming stream, however. This is because metaText's text property is set within the onMetaData() function, and onMetaData() is run only when Flash Media Server sends the stream back to the application. You'll start by adding the metaText TextField object to displayPublishingVideo() and assigning values for its properties:

    1. In the displayPublishingVideo() function, directly under the existing addChild() method call, set metaText's "x" value to "0″, its "y" value to "55″, its width to "300″, and its height to "385″

metaText.x = 0;
metaText.y = 55;
metaText.width = 300;
metaText.height = 385;

    1. Assign color values for the backgroundColor, textColor, and borderColor of metaText. In order to display backgroundColor and borderColor, you must assign both the background and border properties to "true".

metaText.background = true;
metaText.backgroundColor = 0x1F1F1F;
metaText.textColor = 0xD9D9D9;
metaText.border = true;
metaText.borderColor = 0xDD7500;

    1. Add the metaText TextField object to the display list by calling the addChild() method, and passing it the metaText object.

addChild(metaText);

Next, you'll create a function that will bring the video stream back in from Flash Media Server, and display it in another Video object.

    1. Create a new instance variable named vid_in and data type it as a Video.

private var vid_in:Video;

  1. Next, create a new protected function called "displayPlaybackVideo()" that takes no arguments and returns void.

    protected function displayPlaybackVideo():void
    {
    }

  2. In the first line of the function body, instantiate a copy of ns_in, the NetStream variable you declared earlier, and set its initial value equal to new NetStream(nc) with the "nc" NetConnection passed as an argument.
  3. ns_in = new NetStream(nc);
  4. Instead of calling the attachCamera() method, as you did for the previous NetStream, set the client property of the new NetStream to "this".
  5. ns_in.client = this;
  6. Next, call the play() method of the NetStream class, and pass it the String value for the name of the stream. This should be the name of the outgoing stream as well.
  7. ns_in.play("mp4:webCam.f4v");
  8. Instantiate the vid_in variable by calling its constructor.
  9. vid_in = new Video();
  10. Next, set some sizing and layout properties for the new Video object so that it sits properly on the stage.
  11. vid_in.x = vid_out.x + vid_out.width;
    vid_in.y = vid_out.y;
    vid_in.width = cam.width;
    vid_in.height = vid_out.height;
  12. Attach the incoming NetStream to the Video object to have it playback the video.
  13. vid_in.attachNetStream(ns_in);
  14. Finally, add vid_in to the display list by calling the addChild() method and passing vid_in as its only argument.
  15. addChild(vid_in);

    Make sure to un-comment the call to displayPlaybackVideo() in the onNetStatus() function, and then save and run the application. You should see a dark rectangle appear that displays the video's encoding settings, and two video streams, side-by-side. The video on the left is the raw video footage coming from the webcam, and the one on the right is the stream coming back from Flash Media Server.


Coding the Application – Adding Some Finishing Touches

The application is almost done! It could stand a little visual clean up however.

    1. First, add Metadata above the class declaration to set the height and width of the application to something more reasonable.

[SWF( width="940", height="880" )]

Next, you'll create three more TextFields that will display a simple label for the encoding settings list, as well as information about each of the separate video streams. You'll also work with some simple text formatting to size the text something different than the default.

    1. Create three new TextField variables, one named "vid_outDescription", one named "vid_inDescription", and one named "metaTextTitle". Data type each of them as TextField, and call the constructor for each.

private var vid_outDescription:TextField = new TextField();
private var vid_inDescription:TextField = new TextField();
private var metaTextTitle:TextField = new TextField();

    1. Within the displayPublishingVideo() function, directly below the call to add metaText to the display list, add a line that sets the text property for metaTextTitle. Play with spacing between the double quotes and add a " " to get the positioning the way you'd like it.

metaTextTitle.text = " - Encoding Settings -";

    1. Next, create a local variable named "stylr", that is an instance of the TextFormat class. Instantiate this variable by calling its constructor.

var stylr:TextFormat = new TextFormat();

Ensure that the TextFormat class has been imported.

import flash.text.TextFormat;

    1. Set the size property of the new TextFormat class to "18″.

stylr.size = 18;

    1. Apply the style defined with the stylr variable to the metaTextTitle TextField by calling the setTextFormat method of the TextField class and passing that method the name of the TextFormat object "stylr" as an argument.

metaTextTitle.setTextFormat(stylr);

    1. Add more styling and layout property values to metaTextTitle the same way you added them to metaText earlier:

metaTextTitle.textColor = 0xDD7500;
metaTextTitle.width = 300;
metaTextTitle.y = 10;
metaTextTitle.height = 50;
metaTextTitle.background = true;
metaTextTitle.backgroundColor = 0x1F1F1F;
metaTextTitle.border = true;
metaTextTitle.borderColor = 0xDD7500;

    1. Create descriptive text to be displayed for the outbound video stream. Set the text property for the vid_outDescription TextField to display this descriptive text. Again, play with the spacing and new lines to get it positioned correctly

vid_outDescription.text = " Live video from webcam " +
" Encoded to H.264 in Flash Player 11 on output";

    1. Add both the metaTextTitle TextField, and the vid_outDescription TextField to the display.

addChild(vid_outDescription);
addChild(metaTextTitle);

    1. Add descriptive text for the incoming video stream in the same manner. Set values for properties on vid_inDescription, and add the TextField to the display.

vid_inDescription.text = " H.264-encoded video " +
" Streaming from Flash Media Server";
vid_inDescription.background = true;
vid_inDescription.backgroundColor =0x1F1F1F;
vid_inDescription.textColor = 0xD9D9D9;
vid_inDescription.x = vid_in.x;
vid_inDescription.y = cam.height;
vid_inDescription.width = cam.width;
vid_inDescription.height = 200;
vid_inDescription.border = true;
vid_inDescription.borderColor = 0xDD7500;
addChild(vid_inDescription);

There you have it! The application should now automatically attach a webcam, display the webcam video, encode that video to H.264, and then stream it to and from Flash Media Server, displaying the end result in another video. The source files can be downloaded here. The completed code should appear as follows:

package
{
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.events.NetStatusEvent;
import flash.media.Camera;
import flash.media.H264Level;
import flash.media.H264Profile;
import flash.media.H264VideoStreamSettings;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.text.TextField;
import flash.text.TextFormat;

[SWF( width="940", height="880" )]
public class H264_Encoder extends Sprite
{
private var nc:NetConnection;
private var ns_out:NetStream;
private var ns_in:NetStream;
private var cam:Camera = Camera.getCamera();
private var vid_out:Video;
private var vid_in:Video;
private var metaText:TextField = new TextField();
private var vid_outDescription:TextField = new TextField();
private var vid_inDescription:TextField = new TextField();
private var metaTextTitle:TextField = new TextField();

public function H264_Encoder()
{
initConnection();
}

private function initConnection():void
{
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
nc.connect("rtmp://office.realeyes.com/live");
nc.client = this;
}

protected function onNetStatus(event:NetStatusEvent):void
{
trace(event.info.code);
if(event.info.code == "NetConnection.Connect.Success")
{
publishCamera();
displayPublishingVideo();
displayPlaybackVideo();
}
}

protected function publishCamera():void
{
ns_out = new NetStream(nc);
ns_out.attachCamera(cam);
var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();
h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_3_1);

// ALTHOUGH FUTURE VERSIONS OF FLASH PLAYER SHOULD SUPPORT SETTING ENCODING PARAMETERS
// ON h264Settings BY USING THE setQuality() and setMode() METHODS, FOR NOW YOU MUST SET
// SET THE PARAMETERS ON THE CAMERA FOR: BANDWITH, QUALITY, HEIGHT, WIDTH, AND FRAMES PER SECOND.

// h264Settings.setQuality(30000, 90);
// h264Settings.setMode(320, 240, 30);

cam.setQuality(90000, 90);
cam.setMode(320, 240, 30, true);
cam.setKeyFrameInterval(15);
ns_out.videoStreamSettings = h264Settings;
// trace(ns_out.videoStreamSettings.codec + ", " + h264Settings.profile + ", " + h264Settings.level);
ns_out.publish("mp4:webCam.f4v", "live");

var metaData:Object = new Object();
metaData.codec = ns_out.videoStreamSettings.codec;
metaData.profile = h264Settings.profile;
metaData.level = h264Settings.level;
metaData.fps = cam.fps;
metaData.bandwith = cam.bandwidth;
metaData.height = cam.height;
metaData.width = cam.width;
metaData.keyFrameInterval = cam.keyFrameInterval;
metaData.copyright = "Realeyes Media, 2011″;
ns_out.send("@setDataFrame", "onMetaData", metaData);
}

protected function displayPublishingVideo():void
{
vid_out = new Video();
vid_out.x = 300;
vid_out.y = 10;
vid_out.width = cam.width;
vid_out.height = cam.height;
vid_out.attachCamera(cam);
addChild(vid_out);
metaText.x = 0;
metaText.y = 55;
metaText.width = 300;
metaText.height = 385;
metaText.background = true;
metaText.backgroundColor = 0x1F1F1F;
metaText.textColor = 0xD9D9D9;
metaText.border = true;
metaText.borderColor = 0xDD7500;
addChild(metaText);
metaTextTitle.text = " – Encoding Settings -";
var stylr:TextFormat = new TextFormat();
stylr.size = 18;
metaTextTitle.setTextFormat(stylr);
metaTextTitle.textColor = 0xDD7500;
metaTextTitle.width = 300;
metaTextTitle.y = 10;
metaTextTitle.height = 50;
metaTextTitle.background = true;
metaTextTitle.backgroundColor = 0x1F1F1F;
metaTextTitle.border = true;
metaTextTitle.borderColor = 0xDD7500;
vid_outDescription.text = " Live video from webcam " +
" Encoded to H.264 in Flash Player 11 on output";
vid_outDescription.background = true;
vid_outDescription.backgroundColor = 0x1F1F1F;
vid_outDescription.textColor = 0xD9D9D9;
vid_outDescription.x = 300;
vid_outDescription.y = cam.height;
vid_outDescription.width = cam.width;
vid_outDescription.height = 200;
vid_outDescription.border = true;
vid_outDescription.borderColor = 0xDD7500;
addChild(vid_outDescription);
addChild(metaTextTitle);
}

protected function displayPlaybackVideo():void
{
ns_in = new NetStream(nc);
ns_in.client = this;
ns_in.play("mp4:webCam.f4v");
vid_in = new Video();
vid_in.x = vid_out.x + vid_out.width;
vid_in.y = vid_out.y;
vid_in.width = cam.width;
vid_in.height = vid_out.height;
vid_in.attachNetStream(ns_in);
addChild(vid_in);
vid_inDescription.text = " H.264-encoded video " +
" Streaming from Flash Media Server";
vid_inDescription.background = true;
vid_inDescription.backgroundColor =0x1F1F1F;
vid_inDescription.textColor = 0xD9D9D9;
vid_inDescription.x = vid_in.x;
vid_inDescription.y = cam.height;
vid_inDescription.width = cam.width;
vid_inDescription.height = 200;
vid_inDescription.border = true;
vid_inDescription.borderColor = 0xDD7500;
addChild(vid_inDescription);
}

public function onBWDone():void
{

}

public function onMetaData( o:Object ):void
{
for (var settings:String in o)
{
trace(settings + " = " + o[settings]);
metaText.text += " " + " " + settings.toUpperCase() + " = " + o[settings] + " ";
}
}

}
}


Download Source Here

Author flash flv  Added On Tue Jan 17th,2012
Rating (0)  Category Flash Live Streaming
 
 Article Of The Day
 Adding Caption Subtitles to flv mp4 using XML
 

::::::::::::::::::
:: PROGRAM INFO ::
::::::::::::::::::

Program Name........: CCPlayer by FLV HOSTING.com


:::::::::::::::::::::::::::::
:: DESCRIPTION or/and USES ::
:::::::::::::::::::::::::::::

Features:
• Play / Pause / Stop / Rewind Forward, Backward
• Progress bar with buffering
• Elapsed Time /Total time
• Video Name display
• Audio On/Off
• Volume Slider / Mute
• Video Size
• Full Screen
• XML playlist
• Closed caption
• Caption xml each for video
• Language selection for caption
• Resizable
Playlist.xml: Here You can able to add/remove video files and also mention your video path in src node and video name in desc node.

 


For example:
<playlist>
 <vid src="video/hancock.flv" desc="Hancock (2008) - Movie Trailer"/>
 <vid src="video/redbelt.flv" desc="Redbelt (2008) - Movie Trailer"/>
</playlist>

captionXML.xml: Here you can able to add/remove subtitles and it’s timing for each video. Each video have separate xml file.
CCButton: It toggles the caption on and off.
FOr example:
<sub initial="2" end="7">
<txt id="0">Video_2 Text for language1</txt>
<txt id="1">Video_2 Text for language2</txt>
</sub>

Language selection: Here You can select the subtitle language using language combo box and also add/remove languages in captionXml.
For example:
<langu id="0">English</langu>
<langu id="1">French</langu>

Video Name: When you roll over on forward and backward button,Now you can see the appropriate video name for the video.
Video Size: Video default size is 440*330(width*height). You can change the size of the video by set the height and width in flash embedded code.
Play Button: When clicking this button,it's plays the video
Pause Button: When clicking this button,it's pause the video.
Stop Button: When clicking this button,it's stop the video.
FullScreen Button: When clicking this button,it's shows the video in full screen.
Forward Button: When clicking this button,it will play the next video.
Backward Button: When clicking this button,it will play previous video.
Audio On/Off Button: It toggles the audio on and off.

http://www.flvhosting.com/dowloads/ccplayer/ccplayer.zip

For Commercial License, click to purchase.

Addenda / Disclaimers
---------------------

Closed Caption Player
The 21st Century Communication and Video Accessibility Act requires that producers and content creators of online video must provide closed captioning.

Note; MUST provide. This is not an option if this regulation goes through. Some companies seek to charge you a bunch for adding subtitles closed caption in players. You can do it yourself with our FREE Player

This has significant implications for e-commerce video, as these legal requirements will apply to all content producers, not just traditional television networks. While there is discussion of only requiring television producers to comply, the wording in the bill could be interpreted to mean any video content that is playable on a television device. With advances in television sets, accessing web content may be standard by the time the final FCC regulations are in place.

President Obama signed this bill into law on October 8, and the full implications are just starting to be understood within the video commerce industry. The new law requires that the FCC create a series of guidelines that regulate and require web video to be closed captioned, just as broadcast and cable is now.

This means that all content creators will be responsible for providing easy-to-access closed captioning tools on all of their video content.

The final regulations defining these requirements will be established by the FCC, after a series of committee meetings over the next several months.

December 2010: The FCC is required to have assembled the Video Programming and Emergency Access Advisory Committee.
June 2011: The Advisory Committee is required to submit a report to Congress that outlines a schedule for requiring closed captioning; technical specs that content providers must adhere to, and any recommendations around additional regulations needed.
The committee will have broad authority to require certain technical protocols, and require usability standards for accessing the closed caption controls. Beyond closed captioning, the bill also has similar requirements for “video description” information. Video description is audio information that describes what’s happening visually on the screen, and designed for use by the blind to access video content.

The impact for all content producers should be obvious. If you have video content on your website, you will need to ensure that there is strong closed captioning provided to be in compliance with this law. While this is burdensome, the prospects for doing business with the deaf and hard of hearing community are attractive. The community is close knit, and therefore, customer loyalty is very high.

An important exemption is issued for consumer generated media. This goes a long way to ensure that huge video platforms, like YouTube, won’t be liable for ensuring compliance. But, if an e-commerce company uses online video for commercial purposes, they may not be exempt; that will be defined as the advisory committee meets.

Of course, you have two choices for ensuring compliance.
If you run your video content through a home-grown delivery solution,
you will need to build out a closed captioning technology. Or, just use this player
The benefits are increased customization, but the cost is clear – both financial and in terms of legal exposure.

See demo here
http://flvhosting.com/demos/ccplayer

Please note that we do not support the distribution of copyrighted video content, so you should not use this applet to distribute or display video content that is not yours, and we take no responsibility for abuse of this applet. we provide software, but we do not police the use of the software!


License/Support
---------------
You may use this application in your own software projects without restriction, but you should not re-distribute the app in a manner similar to how it is
 distributed on FLV Hosting.com. You must not re-sell or re-distribute the source code in any form.
in other words, use it for your projects, but do not compete with us!

We do not offer free support for this product, or help with modifications, but we do offer development under paid support.
If you need paid support, you can go to www.flvhelp.com/support with your questions and we will provide an estimate of cost.

If you wish to get teh source code for Commercial use, you will need to purchase a license. This can be obtained at
www.flvpowertools.com/ddcart

FLV Hosting.com

EXAMPLE XML for demo video


<Captions>

<langu id="0">English</langu>
<langu id="1">French</langu>

<subtitles>
<sub initial="1" end="">
<txt id="0">In 1931 when it was opened. George Washington carried 15,000 cars a day, on the single roadway.</txt>
<txt id="1">En 1931, quand il a été ouvert. George Washington effectué 15.000 voitures par jour, sur la chaussée unique.</txt>
</sub>
<sub initial="8" end="">
<txt id="0">A lower deck was added in 1962, and today, the same journey is made by 300,000 vehicles</txt>
<txt id="1">Un pont inférieur a été ajouté en 1962, et aujourd'hui, le même trajet est effectué par 300.000 véhicules</txt>
</sub>
<sub initial="15" end="">
<txt id="0">We're very fortunate that Othmar Amman who was the engineer and designed this bridge...</txt>
<txt id="1">Nous sommes très heureux que Othmar Amman qui était l'ingénieur et conçu ce pont ...</txt>
</sub>
<sub initial="19" end="">
<txt id="0">...took a lot of time and patience and attention to details to build a bridge which is not only elegant</txt>
<txt id="1">... a fallu beaucoup de temps et de patience et d'attention aux détails de construire un pont qui est non seulement élégant</txt>
</sub>
<sub initial="25" end="">
<txt id="0">...but also one that's very strong. For instance the suspender ropes, thats suspend main deck...</txt>
<txt id="1">... mais aussi celui qui est très fort. Par exemple, les cordes jarretelles, thats suspendre pont principal ...</txt>
</sub>
<sub initial="30" end="">
<txt id="0">They can carry 4 times the weight they really have to.</txt>
<txt id="1">Ils peuvent transporter 4 fois le poids qu'ils ont vraiment à.</txt>
</sub>
<sub initial="34" end="">
<txt id="0">Most of the weight that bridge has to carry is not the traffic, it's realy the weight of the bridge itself.</txt>
<txt id="1">La plupart du poids de ce pont doit procéder n'est pas le trafic, c'est vraiment le poids du pont lui-même.</txt>
</sub>
<sub initial="39" end="">
<txt id="0">- background music -</txt>
<txt id="1">- la musique de fond -</txt>
</sub>
<sub initial="55" end="">
<txt id="0">"At the bridge headquaters, near the Toll plaza, the entire span is monitored from an operations room. "</txt>
<txt id="1">Au siège de pont, à proximité de la gare de péage, la durée est surveillé dans une salle des opérations.</txt>
</sub>
<sub initial="63" end="">
<txt id="0">"Housed behind bullet proof glass, this is the one of most sophisticated traffic management systems..."</txt>
<txt id="1">Abrité derrière une vitre pare-balles, c'est celui de la plupart des systèmes sophistiqués de gestion de la circulation ..</txt>
</sub>
<sub initial="69" end="">
<txt id="0">"...in the world."</txt>
<txt id="1">... dans le monde.</txt>
</sub>
<sub initial="71" end="">
<txt id="0">"One of the things we have been doing on this bridge is bringing it to the 21st century,... "></txt>
<txt id="1">Une des choses que nous avons fait sur ??ce pont est-il apporter au 21e siècle, ...</txt>
</sub>
<sub initial="75" end="">
<txt id="0">"... by adding what we calling Intelligent Transportation System to the bridge."></txt>
<txt id="1">.. en ajoutant ce que nous appelant systèmes de transport intelligents sur le pont.</txt>
</sub>
<sub initial="79" end="">
<txt id="0">"It's really helping us to manage traffic, we can't expand the size of the bridge"></txt>
<txt id="1">C est vraiment nous aider à gérer le trafic, nous ne pouvons pas augmenter la taille du pont</txt>
</sub>
<sub initial="83" end="">
<txt id="0">"so we have to work with what we have."></txt>
<txt id="1">nous devons donc travailler avec ce que nous avons.</txt>
</sub>
<sub initial="86" end="102">
<txt id="0">"By putting in this transportation systems, we think we can make the traffic flow more efficient."></txt>
<txt id="1">En mettant dans cette systèmes de transport, nous pensons que nous pouvons faire la circulation plus efficace</txt>
</sub>

</subtitles>
</Captions>


 

Author closedcaptionplayer  Added On Wed May 11th,2011
Rating (0)  Category Flash Players - Progressive
 
 Article Categories
Media Server(5) Action Script(0) Apps(1)
Basic Hosting Questions(5) Breeze(1) Flash and XML(1)
Flash Live Streaming(3) Flash Media Server(2) Flash Players - PC(0)
Flash Players - PHP MYSQL(0) Flash Players - Progressive(5) Flash Players - Streaming(2)
Flash Press Releases(4) Flash Video (FLV) DRM(0) Flex(0)
FLV Coding(3) FLV Encoding(7) FLV Help(0)
FLV Hosting Featured Clients(1) FLV Software(2) FLV Streaming(5)
FLV Tutorials(4) FLV Video(5) Flv Video Updates(5)
FLVPlayback component (0) Gadget News(13) H.264 Hi Definition(3)
html5(8) Macromedia SWF(0) Online Recording with Webcam (0)
Swish(0) YouTube Videos(1)
 
 Latest Articles
 Progressive Streaming
 

 

Progressive Download (FLV)

In 1999 Macromedia (Now Adobe) introduced a new technique called progressive download for delivering video in Flash. This method enables developers to use ActionScript commands to feed external FLV files into a Flash movie and play them back during runtime. In this method, the video content (FLV file) is kept external to the other Flash content and the video-playback controls (the video player) in the SWF file. When the video is played, the video file is downloaded to the client's computer (hard drive) before playback. The file is served from a normal web server through an HTTP request just like a normal web page or any other downloadable document.

flv hosting progressive flv player Unlike traditional download-and-play methods of video delivery, however, the file starts playing before it has completely downloaded when you use progressive download. Pros and Cons Keeping the video external and separate to the SWF file offers a number of benefits over embedded video, including the following: Easy to update: It's relatively easy to add or change content independently of the video player and without the need to republish the SWF file. Small SWF file size: Your SWF file can remain very small for fast page loads and the video can be delivered when the user requests it. Better performance:

Because the FLV and SWF files are separate, the performance and results of your video playback will typically be better. Issues such as the lack of sync between the fps rate of the video and the fps rate of the SWF file will no longer be a problem. These benefits apply to both progressive download and streaming video.

They are compelling enough to warrant that embedded video should only be used as a last resort. When comparing progressive download to streaming video, there's really only one benefit to progressive download:

You don't need streaming server software to deliver the video. Progressive download video can be served from any normal web server.

For example, it can be served off the same machine that is running Apache or IIS and serving your HTML pages. While the progressive download approach is nice in that respect, you should note the following potential issues:

  • Limited seek and navigation capabilities: Viewers cannot seek forward through the video before it is completely downloaded. Viewers need to wait until the video is downloaded before they can navigate to a particular portion of the video. Because of this, streaming video will probably be a better choice than progressive download when you are delivering long video files in which you want to let viewers skip around, such as lengthy symposia or training materials.
  • User-accessible content: Because the file is downloaded, the media physically resides on the viewer's machine. Savvy users will be able to search their browser caches or temporary Internet files and access the content. This is not necessarily a bad thing if the content owner has no concerns about rights management for his or her content. In fact, in that case it may actually be useful—if the user decides to view the same video clip again before the browser cache is cleared, the file plays back from the local cache without the user having to access the web again. However, if digital rights are a concern, streaming video is a better option.

When to Use Progressive Download

Although we have clients who use progressive download for 30 minute TV shows without issues, progressive download is a perfect use for hobbyists or websites that have low traffic requirements and only need to deliver short videos. Customers who need advanced features and control over their video delivery—not to mention displaying video to large audiences (for example, several hundred simultaneous viewers), tracking and reporting video viewing statistics, or offering the best video experience—should consider streaming video.

Author flvguru  Added On Mon Jan 23rd,2012
Rating (0)  Category Delivery
 why do my videos stutter in website in flash flv player
 

There can be several factors to consider when investigating buffer.

1. The player, even if RTMP streaming, should have a 2-3 second buffer time, to allow internet connections to sync

2. The user/viewer internet connection versus video bitrate.

When streaming, there are 2 types. Progressive, and RTMP Media protocol.

Progressive streaming will stream smoothly if the video can be downloaded to the users device faster than it can be watched. Usually the video is transferred to the temp files and is then displayed in the player to view.

With RTMP, no transfer of video takes place. The video plays on the server, and the player displays to view.

3. Bitrate. If the video has a bitrate higher than a connection can handle, then buffer/stutter can happen.

Example. DSL of 200kbps trying to view a video of 1000kbps can stutter.

4. Server hosting pipe size, slow servers, and shared accounts.

If a hosting provider shares accounts and has too small a pipe (2mbps example) and multiple people are watching a video or accessing websites, then the pipe can get maxed, thus providing information ( in this case video) in a piecemeal fashion. Servers try to spread requests for information from it, bit by bit to many connections at once, so each request gets a little at a time ( you see this sometimes when a website loads slowly)

 

FLV Hosting uses state of the art SSD drive servers with gigabit routers and fiber optic delivery from several internet peers, such as Level 3, Qwest, and uunet.  

 

As such, we provide the best environment possible for streaming video. However we cannot control the user/viewer internet connection, which is usually the number one issue in streaming experiences.

 

RTMP streaming is a superior method of streaming, as there is no waiting to move back and forth in the video, and even large files can play successfully.

 

We do support flowplayer, which can be configured with account settings provided. If you wish to use flv hosting players without flowplayer branding, you can choose in the custom player section.

 

www.flvosting.com/codegenerator

See here a video of our interface at FLV FLash Hosting

 

Flash Server Streaming

What is Flash Streaming Server and when should I use it ?

In general, for INSTANT playback on videos longer than 15-20 minutes long, and if you want to "protect" the FLV from internet sharing. The difference between progressive and streaming is very subtle.

A Progressive Download in Flash means you are able to watch the video while the rest of the video is loading into the player and is caching into the users temporary internet files.

Flash Streaming Server works differently by using the Flash Player, you can command it to stream directly from the server, with no caching into computer temp folders. This method is preferred for videos longer than around 15 minutes FLV Hosting STREAMING Demo 1 FLV's being played remotely from the server use Streaming Playback. If the FLV or MP4 file is not playing through a Flash Server you won't be able to use Streaming Playback.

RTMP DEMO # 1

Though nearly identical to Progressive download, server streaming does have some advantages to the developer. Streaming servers can, invisibly adjust for changes in bandwidth, allow the user to move to any position in the video and to set up playlists that have no lag between videos. Flash application communicates through FLV hosting and is called RTMP.

Even though the browser can play the file while connected to the server, the file cannot be played locally, and it is not cached to the users temp internet files. Given the connection to the MX server however, it allows the user to play the movie directly in their chosen browser.

This eliminates the need for a third party download such as Quicktime, Windows Media Player, Divx or Real Player.

Flash is embedded in 98% of all internet browsers, a higher percentage than WM, Real Player and Quicktime combined.

FLV Player 2 Flash Media  Server Player Demo 2

Demonstrates the versatility of player construction with the use of thumbnails and cue points at 1/16th of the total movie time. Look for the button next to the volume for the scenes control. This allows for instant fast forward or navigation similar to a DVD chapter listing. Embedding the player is limited only to the developers html and xml skills.

The player can be made to be a launched in a new window. This kind of player is also suitable for members areas for Pay Per View and other user controlled situations. The players in the demos are available for purchase, see below. NOTE: If just buying the SWF you will need an account with FLV Hosting as they are configured for our servers. If purchasing the source files you can alter the FLA file to use a different RTMP setting.

Free RTMP Streaming FLV Players are included with every account.

FLV Flash – A Fantastic File Format

The file format used in this process is Flash FLV or Flash Live Video, and it plays in a Streaming Server Flash Player. (RTMP protocol)

While traditional methods of media delivery include some kind of download to the user's computer, either in a pre-loader or through temporary Internet files, Flash server and a Flash FLV Player connect in a completely different manner. Simply put, it's a new connection to the file each time the user uses the controls in the player.

This means that in the background it's a "start here" "stop here" "start again here" style of play, a bit like a remote VCR or DVD player, but with no downloads or caching.

Here's The Top Ten Reasons to Stream Video Using Flash – either FLV or MP4

1. FLV format file sizes after conversion are up to 60% smaller, saving server storage costs.

2. FLV's start – stop connection style saves on bandwidth (which is as much as 60% less per month).

3. FLV format has no local player in operating systems, so file sharing is virtually nullified.

4. FLV format plays directly in more browsers than Windows Media, Real Player or QuickTime.

5. FLV server can authenticate clients, and control users as you wish. 6. FLV players can be completely customized for logos, branding and embedded links.

7. FLV players can play files from a programmable database, and simple administration area.

8. FLV players can be programmed to integrate with databases for free previews, time, users.

9. FLV encoding can include user information for content tracking, misuse, or DRM.

10. Flash Communications servers are easier to maintain than others, and less prone to security hacks. Who is using Flash Streaming Servers? Yahoo, IBM, Sony, Universal Studios, the list is growing.

According to Computerworld's "IBM to Drop Windows-based Storage" article "IBM plans to discontinue its line of Windows-based network-attached storage (NAS) devices in order to focus on higher-end products, including an upcoming file server that will run Linux, sources said…" Flash is suitable for various applications, including live, on-demand, audio and video streaming, 24 x 7 live radio broadcasting, pay-per-view, with digital rights management, delivery to mobile devices, including phones, product demonstrations, commercials and movie trailers, employee and partner training, corporate communications – the list goes on and on…

The primary use of flash servers is that it creates an open socket connection.. This is push technology as opposed to pull technology. A users connection however does not become "more stable or faster because of it.

Open socket connections are primarily used in gaming/vrml chat environments and adds little value to precompiled content such as video's streaming video's in my opinion., The advantage of push/open socket is in "live content" such as the aforementioned environments and Live broadcast video/communication where by one would/could use multiple ports for simultaneous streams/connections to and from the server.

Author flvguru  Added On Mon Jan 23rd,2012
Rating (0)  Category FLV Video
 Online Recording with Webcam
 

Demo #1 - Webcam Video Recorder Demo



Make sure your Webcam and mic are plugged in and turned on. This SIMULATED Demo shows how you can record videos online.

Use your webcam and microphone to record or, after uploading your FLV file(s) you can preview the file first, or just generate the code to place the video into any webpage. . In general, the recorder will require some custom development to satisfy clients needs. Please contact us for further information on options

To use this recorder, you will need a FLASH MEDIA (RTMP) account or server -- Additional costs may apply to configure, custom program, as well as licence this product. Standard install is $250 with additional to handle how the videos are to be saved and displayed
Low Hosting Prices

Author flash flv  Added On Tue Jan 17th,2012
Rating (0)  Category Flash Live Streaming
All Articles 
 
 
  Login Here
 
Username
Password
Signup Now
Forgot password
 
 
  Top Rated
 
Adobe FLash Video...
Yet another free...
Using FFMpeg to...
ESPN Chooses RTMP...
HOW TO STREAM LIVE...
How to add add text...
 
 
  Most Popular
 
Embed Flash FLV
Updated 2011 How to...
Free Online FLV...
Free Youtube Player...
Flv player in Flash
How to convert FLV...
 
 
  Editor's Pick
 
Flash Templates
Free FLV Players...
How to add add text...
Featured Articles...
No more Flash......
 
 
  Sponsor
 

S

P

O

N

S

O

R

A

D

 
   
 
   
 HOME | LOGIN | SIGNUP
SUBMIT AN ARTICLE | SEARCH ARTICLES | ALL ARTICLES
TERMS OF USE | PRIVACY POLICY | LEGAL POLICY | CONTACT US