分类: Streaming

  • Install lighttpd on ubuntu

    sudo apt-get update

    sudo apt-get upgrade

    sudo apt-get install lighttpd

    modify lighttpd configuration ==> sudo nano /etc/lighttpd/lighttpd.conf

    • Disable global dir listing :  server.dir-listing          = “enable”  ==> server.dir-listing          = “disable”
    • Add alias of url:   alias.url = (
                    “/img/”         => “/www/image/”,
                    “/fp/”          => “/www/flowplayer/”,
                    “/Google_I_O/”  => “/usr/share/red5/dist/webapps/root/Google_I_O/”,
                    “/assets/”      => “/usr/share/red5/dist/webapps/root/assets/”,
                    “/download/”    => “/data/download/”,
                    “/dl/”          => “/data/download/”
                    )
    • Enable dir listing for the specified url:  $HTTP[“url”] =~ “^/dl/|^/download/|^/Google_I_O/” {
          dir-listing.activate = “enable”
       }
    • Enable module of mod_flv_streaming

    sudo /usr/sbin/lighty-enable-mod cgi

    sudo /etc/init.d/lighttpd  force-reload

     

  • Flowplayer

     

     

    Flowplayer is an Open Source video player for the web. Embed the video streams into your web pages. User will get rich media experience by viewing video streams from your site. Player could be extended with Flash plug-ins, JavaScript plug-ins or Streaming plug-ins. Give a new look and feel to the player by extending it.

    It could play the video irrespective of location. The video could be stored in any CDN network like Akamai, Amazon Cloudfront or even local web server. It has built-in slow motion and fast forward support. Social sharing is an important need for almost all web sites. Its viral plug-in helps to spread the videos to most popular social media.

    It has ability to detect bandwidth speed and adjust the bit-rate transferred. It supports MPG, WMV, MOV and AVI formats.

     

    http://flowplayer.org/

    http://flowplayer.org/plugins/streaming/rtmp.html

     

    http://code.google.com/p/flowplayer-plugins/source/checkout

    svn checkout http://flowplayer-plugins.googlecode.com/svn/ flowplayer-plugins-read-only

     

     

  • Play Flash based on HTML path in Red5

    For each flash file,  setup a HTML file with the same name as the flash file, except for the extension.

    The HTML pass the file name to SWF, and SWF play the video.

     

    http://commondatastorage.googleapis.com/red5.zhenglei.net/PlayStreamByPath.7z

     

  • Passing parameter from HTML to Flash in Adobe CS4

    Suppoe we need pass the video name from HTML to Flash.

    1.   Add the following  ActionScript into FLA:

    # Display the video in screen

    var my_fmt = new TextFormat();
    my_fmt.color = 0xFF0000;
    my_fmt.underline = true;
    this.createTextField(“myTxt”, 1, 320, 10, 200, 20);
    myTxt.autoSize = “left”;
    myTxt.setTextFormat(my_fmt);

    #  myVIDEO is the parameter from HTML
    if (myVIDEO == undefined) {
    myTxt.text = “Keynote_1.flv”;
    } else {
    myTxt.text = myVIDEO;
    }

    // create basic netConnection object
    var nc:NetConnection = new NetConnection();

    // connect to the local Red5 server
    nc.connect(“rtmp://192.168.127.127/oflaDemo”);

    // create the netStream object and pass the netConnection object in the constructor
    var ns:NetStream = new NetStream(nc);

    // attach the netStream object to the video object
    videoContainer.attachVideo(ns);

    // Play the video
    ns.play(myTxt.text);

     

     

    2.  Generate the SWF and HTML from FLA

     

     

    3. Modify the generated HTML to add myVIDEO parameter,

       Three parts to be modified in HTML:

     

       A)  Add the following line in the  AC_FL_RunContent block:

           ‘FlashVars’,’myVIDEO=Keynote_2.flv’,

     

      B)  Add the following line in the  Object block:

          <param name=”FlashVars” value=”myVIDEO=Keynote_2.flv” />

     

      C)  Add the following into the embed scr block:

         FlashVars=”myVIDEO=Keynote_2.flv”

     

    http://commondatastorage.googleapis.com/red5.zhenglei.net/Pass_Variable_From_Html_To_Flash.7z

     

  • setup red5 on ubuntu 10.10

    sudo apt-get update

    sudo apt-get upgrade

    sudo apt-get install sun-java6-jdk

    sudo apt-get install sun-java6-jre

    sudo apt-get install ant

    sudo apt-get install subversion

    sudo apt-get install ivy

    cd /usr/share

    sudo svn export  http://red5.googlecode.com/svn/java/server/trunk/

    sudo mv trunk red5

    sudo chown lzheng -R red5

    sudo chgrp lzheng -R red5

    cd red5

    ant clean

    ant dist

     

    #  Install oflaDemo:

     

     

    # Method 1:    Install from snapshots

    wget http://red5.googlecode.com/svn/snapshots/oflaDemo-r3989-java6.war

    mkdir oflaDemo && cd oflaDemo && unzip  ../oflaDemo-r3989-java6.war && cd ..

    sudo mv oflaDemo  /usr/share/red5/dist/webapps/

     

     

    # Method 2:    Install from dev trunk

    # Download

    svn export http://red5.googlecode.com/svn/java/example/trunk/oflaDemo/

     

    # Setup build property

    echo red5.root=/usr/share/red5/dist > ~/build.properties

    #echo build.optimize=true >> ~/build.properties

    # echo debug.status=false >> ~/build.properties

     

    cd oflaDemo

    ant clean

    ant

    # Result:   dist/oflaDemo.war

    mkdir oflaDemo && cd oflaDemo && unzip  ../dist/oflaDemo.war && cd ..

    sudo mv oflaDemo  /usr/share/red5/dist/webapps/