Skip to main content
March 5, 2007
Question

Streaming stored content with FMS2... Please help.

  • March 5, 2007
  • 6 replies
  • 694 views
Hello,

I am running the free FMS2 server for development purposes, hoping
that it proves well enough to buy a licensed product before we launch
our product to assist in streaming videos and mp3s (we might even
implement some other applications in Flash 8 Pro given that we already
bought a copy of Flash 8 Pro for this task alone).

Current, I am only able to stream live events with FMS 2.0.4 r79. The
next part of my project adds the availabilty of stored content (aka
on-demand; from what I understand). However, all of my attempts at
streaming .flv files from FMS2 by using either FLVPlayback component
with a contentPath set to
rmtp://x.x.x.x/test/streams/cafe_townsend_chef

I have omitted my server's public IP address.

In another test, I tried adding the .flv file extension to
contentPath. My clients fail to connect with either format.

I have also used the stage and actionscript to test the stream with,
it still fails, but here is a sample of my code with tracing:

connection_nc = new NetConnectio();
connect_nc.onStatus = function(info){
trace("level is: " + info.level + "\n" + "code is: " + info.code";)
}

connection_nc.connect"(rtmp:/x.x.x.x/test/streams");
var play_ns:NetStream = new NetStream(connection_nc);
theVideo.attachVideo(play_ns);
play_ns.play("cafe_townsend_chef.flv");

play_ns.onStatus = function(info) {
trace("level is: " + info.code);
trace("description is: " + info.description);
trace("details are: " + info.details);
}


In this .fla, I have "Video 1" on the stage with the name property set
to theVideo.

When I "Control->Test Movie" in Flash Pro 8, that produces these
results (no videos or audio plays):

level is: status
code is: NetConnection.Connect.Success
level is: NetStream.Play.Reset
description is: Playing and resetting cafe_townsend_chef.flv.
details are: cafe_townsend_chef.flv
level is: NetStream.Play.Start
description is: Started playing cafe_townsend_chef.flv.
details are: cafe_townsend_chef.flv

At this point, fms2_console.swf "View Applications" is showing a
connection to "test" app, with "stream" as an instance. I show one
client using rtmp with 6213/6813 bytes in/out, a recent Connection
Time, and 2/4 messages in/out.

I am using port 1935 by default and ability to be resource efficient
with applications, which has been opened on the firewalls protecting
our server which can be seen by the NetConnection.Connect.Success
statement from what I have read. I am able to stream live events from
this server during development and they work.

During testing for stored content (what I am trying to accomplish
now), I have also turned off apache, which normally binds to port 80
and added the following lines to my conf/_defaultRoot_/Adaptor.xml
defined inside <HostPortList></HostPortList> directives:

<!-- <HostPort name="edge1" ctl_channel=":19350">${ADAPTOR.HOSTPORT}</HostPort> -->
<HostPort name="edge1" ctl_channel=":19350">:1935</HostPort>
<!-- Ready for testing when Apache is turned off -->
<HostPort name="edge2" ctl_channel=":19351">:80</HostPort>

After restarting FMS2, this only produces a slightly different result
when using http instead of rmtp in any/all of the code above. In
firefox, the status bar just keeps a "Waiting for x.x.x.x...", but
never loads content in the player and doesn't show. In IE, I get a box
to click on to play content, after clicking, it just reports "Done" on
the status bar.

I thought this was a Flash Pro 8 issue regarding my code (since this
is my first project using Adobe's products), but I have tried several
examples around Adobe's site (tutorials, live docs, FMS2 development
pdf provided with the server package), plus some off-site ones found
by googling. I opened a case with Adobe's Flash Pro 8 Customer Service
team and they say it's an FMS2 problem after running some tests
against my server.

I have also traded out the .flv used for testing to verify it is not
the source of my problems.

Does anyone know my problem and have a fix or just have some advice on
where to go from here?

Hopefully Adobe staff can shed some light on this.

Let me know if there are blanks I still need to fill in.

Thanks.


    This topic has been closed for replies.

    6 replies

    March 7, 2007
    I have tested almost all of my code (no smil yet) with the Windows XP Pro version of Flash Media Server 2 development licensed and it works great against rtmp://localhost/...

    I am still searching for a solutiion to fix this problem as the only servers I run capable of handling the bandwidth for a thousand concurrent connections are on Linux (I don't have a Windows 2003 server to use for this purpose).

    Please let me know what else needs exposing to find a solution to thie problem.
    March 7, 2007
    Before my last post, I also tried using a smil.xml file as the contentPath of an FLVPlayback component as described here:

    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=d244749e

    My smil.xml was located in fms2_install_dir/applications/test/streams/_definst_/

    Note: All remotely (not locally imported files) located files (any format, .flv or .xml) in contentPath have always failed to load when setting the url and leaving "Download FLV for cue points and dimensions" checked. I keep it unchecked when setting a new path.

    My smil.xml looks something like this:

    <smil><head>
    <meta base="rtmp://x.x.x.x/test" >
    <layout>
    <root-layout width="240" height="180" ></layout></head>
    <body>
    <switch>
    <video src="cafe_townsend_chef" system-bitrate="128000" dur="3:00.1">
    <ref src="cafe_townsend_chef.flv" dur="3:00.1"/>
    </switch>
    </body>
    </smil>

    I continue without having any stored content streaming (it doesn't work yet). Someone has to know why...
    March 6, 2007
    I tested with the Flash 8 Pro provided main.asc in fms2_install_dir/applications/test/ and see the same behaviour as majority of the other tests.

    In the process of searching for "FLVPlayback and main.asc" on Adobe's main site, I found an article that provides a thoroughly setup media player using FLVPlayback. The .fla leaves the contentPath blank on the component and sets a server variable in actionscript (default is localhost, I updated it with my server).

    When I publish preview the SWF, I get this error:


    Error : dir NetConnection.Call.Failed


    What could be causing this on either client or server side?


    When I publish HTML, the page never loads content.

    Some settings and where I have put them in certain files:

    <VirtualDirectory> settings contained within fms2_install_dir/conf/_defaultRoot_/_defaultVhost/Vhost.xml:

    <Streams>
    /approot; /opt/macromedia/fms/applications/MyCollection/streams/_definst_/
    </Streams>

    These are <FileObj> settings inside fms2_install_dir/applications/FileObj/Application.xml

    <VirtualDirectory>
    /approot; /opt/macromedia/fms/applications/MyCollection/streams/_definst_/
    </VirtualDirectory>


    fms2_install_dir = /opt/macromedia/fms

    Article:
    http://www.adobe.com/devnet/flashmediaserver/articles/on_demand_player.html

    Source:
    http://download.macromedia.com/pub/developer/on_demand_player.zip

    Example of this player live:
    http://robertsandie.com/demo/OnDemandPlayer.html

    March 6, 2007
    Oh... I didn't notice that you were using the prefab media components.

    As I recall, there is a main.asc file that ships with the component that you need to place in the application directory. It's been discussed here before... try searching this borad with the terms flvplayback and main.asc.
    March 6, 2007
    Thanks for your response.

    After copying cafe_townsend_chef.flv to FMS2 Install DIrectory/applications/test/streams/_definst_/ I updated both the FLVPlayback component contentPath and the connection_nc.connect("..."); code with your suggestion, even giving rmtp a shot.
    I get the same results of no audio or video for the client. The connection is logged in FMS2 and fms2_console.swf shows an active client, the bytes in/out do not grow and neither does msgs in/out. Trace code produces same results as first mentioned.

    What else could it be?
    March 6, 2007
    Assuming youf flv file resides here:

    FMS Install Dir/applications/test/streams/_definst_/cafe_townsend_chef.flv

    Your rtmp path is

    rmtp://x.x.x.x/test/cafe_townsend_chef

    Note the directory structure for the location of the flv file, and the omission of the /streams/ dir in the rtmp path.