Using the vod service



Streaming media from the vod service

The vod (video on demand) service lets you stream recorded media to clients without building an application or configuring the server. Simply copy recorded media files to the server and clients can stream them. By default, copy media files to the following locations:

  • To stream files over RTMP only, copy files to RootInstall/applications/vod/media.

  • To stream files over RTMP and allow progressive download over HTTP, copy files to RootInstall/webroot/vod.

    Note: To serve files over HTTP, install Apache.

You can use any of the following clients to play video streamed from the vod service:

  • Flash Media Server sample video player (RootInstall/samples/videoPlayer)

  • Flash FLVPlayback component (fl.video.FLVPlayback)

  • Flex VideoDisplay component (mx.controls.VideoDisplay)

  • Any custom-built application that runs in Flash Player, AIR, or Flash Lite 3

Test the vod service

  1. Double-click the RootInstall/samples/videoPlayer/videoplayer.html file to open the sample video player in a browser.

  2. Click any video in the SOURCE: /applications/vod/media list or in the SOURCE: /webroot/vod list.

  3. To stream your own videos to the video player, do one of the following:

    • To stream media over RTMP only, place files in the RootInstall/applications/vod/media folder.

    • If you installed Apache and want to serve media over RTMP or HTTP, place video files in the RootInstall/webroot/vod folder.

  4. Enter the address of the video in the STREAM URL text box, check VOD, and click PLAY STREAM.

    The following table lists the possible addresses based on file format and protocol:

    File format

    Address

    F4V

    http://serverName/vod/fileName.f4v

    rtmp://serverName/vod/mp4:fileName

    rtmp://serverName/vod/mp4:fileName.f4v

    FLV

    http://serverName/vod/fileName.flv

    rtmp://serverName/vod/fileName

    rtmp://serverName/vod/fileName.flv

    Note: To use localhost as the serverName for HTTP, append the port number 8134, for example, http://localhost:8134/vod/video.f4v. The server uses port 8134 internally for HTTP.
  5. Choose Start > All Programs > Adobe > Flash Media Server 3.5 > Flash Media Administration Console to open the Administration Console. Log in to the server to see the vod service running.

    Note: When you play a video over HTTP, the client does not connect to the vod application. Instead, Apache serves the video to the client.

Vod service configuration parameters

Two parameters in the RootInstall/conf/fms.ini file determine the locations of the media folders for the vod application:

VOD_COMMON_DIR = C:\Program Files\Adobe\Flash Media Server 3.5\webroot\vod 
VOD_DIR = C:\Program Files\Adobe\Flash Media Server 3.5\applications\vod\media

The Application.xml file in the RootInstall/applications/vod folder uses these parameters in <Streams> tags to specify virtual directory mappings for streams. The server looks for media in the order the <Streams> tags are listed in the Application.xml file.

If you installed Apache, you can stream media over RTMP and HTTP. Place media files in the folder specified in the VOD_COMMON_DIR parameter. To stream media over RTMP only, place media files in the folder specified in the VOD_DIR parameter. Media files are available at the following addresses:

File format

Address

F4V

http://serverName/vod/fileName.f4v

rtmp://serverName/vod/mp4:fileName

rtmp://serverName/vod/mp4:fileName.f4v

FLV

http://serverName/vod/fileName.flv

rtmp://serverName/vod/fileName

rtmp://serverName/vod/fileName.flv

Duplicate the vod service

The server supports an unlimited number of instances of the vod service.

  1. Duplicate the RootInstall/applications/vod folder in the applications folder and give it a new name, for example, vod2. In this case, the new vod service is located at RootInstall/applications/vod2.

    You can create as many instances of the vod service as you need.

  2. Clients can connect to the vod service at the URL rtmp://flashmediaserver/vod2.

  3. Open the fms.ini file (located in RootInstall/conf) and do the following:
    • Add a parameter to set the content path for the new service, for example: VOD2_DIR = C:\Program Files\Adobe\Flash Media Server 3.5\applications\vod2\media.

    • If you installed Apache and want the media files to be available over HTTP, add a new VOD2_COMMON_DIR parameter: VOD2_COMMON_DIR = C:\Program Files\Adobe\Flash Media Server 3.5\webroot\vod2.

  4. Open the Application.xml file in the RootInstall/applications/vod2 folder and do the following:

    • Edit the virtual directory to the following: <Streams>/;${VOD2_DIR}</Streams>.

    • Edit the virtual directory to the following: <Streams>/;${VOD2_COMMON_DIR}</Streams>.

  5. Place recorded media files into the following locations:

    • Place files that stream only over RTMP in the C:\Program Files\Adobe\Flash Media Server 3.5\applications\vod\media folder.

    • Place files that stream over RTMP or HTTP in the C:\Program Files\Adobe\Flash Media Server 3.5\webroot\vod2.

    Note: You do not have to specify the media subdirectory in the URL; the media directory is specified in the path you set in the fms.ini file.

Modify the vod service

Note: You cannot modify the vod service on Flash Media Streaming Server
  1. Create a folder in the RootInstall/applications folder or use the default RootInstall/vod folder.

  2. Do one of the following:

    • If you’re using the default applications/vod folder, move the main.far file to a safe location. Copy the RootInstall/samples/applications/vod main.asc file to the applications/vod folder.

    • If you created a folder in step 1, copy the main.asc, Application.xml, allowedHTMLdomains.txt, and allowedSWFdomains.txt files from the RootInstall/samples/applications/vod folder to the new folder.

  3. Open the RootInstall/conf/fms.ini file in a text editor and edit the VOD_DIR parameter and the VOD_COMMON_DIR parameter to point to the correct locations.

  4. Restart the server.

Disable vod services

 Move any vod service folders out of the applications folder.