Hello, excuse if I am insistent, but I need to know this detail for a possible development.

I have a process that generate a FLV File in certain directory.  This file is used by Red5 for server streaming. The detail is that the FLV file is not closed and it grows continuously.


This is a fragment of the Red5 Server Code:

    serverStream = StreamUtils.createServerStream (appScope, "liveX");

    SimplePlayItem item = new SimplePlayItem();
    item.setStart(0);        
    item.setLength(200000);
    item.setName("dynamic.flv");
    serverStream.addItem(item);
    
    serverStream.start();



Another solution is using the getStreamLength and addItem, like this:


    serverStream = StreamUtils.createServerStream (appScope, "liveX");

    String fileName = "dynamic.flv";
    int fileLength = getStreamLength(fileName);
    log.info("first fileLength: " + fileLength );

   
    SimplePlayItem item = new SimplePlayItem();
    item.setStart(0);       
    item.setLength(fileLength);
    item.setName(fileName);
    serverStream.addItem(item);

    serverStream.start ();



    // In another Thread or Timer Event
    while (true)
    {

        fileLength = getStreamLength(fileName);
        log.info("fileLength: " + fileLength );

        SimplePlayItem item = new SimplePlayItem();
        item.setStart(lastLength);       
        item.setLength(fileLength);
        item.setName(fileName);
        serverStream.addItem(item);

        lastLength = fileLength;

    }

The problem with that is that the "getStreamLength" funtion always returns the first value.

   
    first fileLength: 300
    fileLength: 300
    fileLength: 300
    ...

   
   




Thank you verry much!!!!
HT. BA, Argentina.

---------- Forwarded message ----------
From: Homero Thomsom < [EMAIL PROTECTED]>
Date: Oct 26, 2006 12:39 AM
Subject: Stream FLV File while it grows
To: [email protected]

Hi

I have the following code:

    serverStream = StreamUtils.createServerStream (appScope, "liveX");

    SimplePlayItem item = new SimplePlayItem();
    item.setStart(0);        
    item.setLength(200000);
    item.setName("dynamic.flv");
    serverStream.addItem(item);
    
    serverStream.start();

Another process has open the file and adds frames to this.
The objective is that the file is Streamed while is modified by the other process.

Some idea?

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to