Skip to main content
Participant
March 8, 2007
Question

Recording a stream and using it on the fly

  • March 8, 2007
  • 1 reply
  • 452 views
Hi,

I'm trying to upload a video stream from a flash client and convert the video stream on the fly (from an external converter like ffmpeg or vlc).
Since I don't manage to send the stream directly to the converter, a solution I have found is to publish the sream as "record", and have a converter read the file to perform the operation.

However, when setting the record method for publishing, the recorded file is not written continuously. Incoming stream is buffered, written, buffered, written and so on. So, the program reading the file stops it reaches the end.

Is there a way in FMS2 to either:
- forward incoming RTMP stream to a stream converter (using an outgoing RTSP stream or something like that) ?
- force FMS2 to dump the stream continuously, as soon as it receives the incoming data ?

Thanks for any help,

Greg
    This topic has been closed for replies.

    1 reply

    maelickAuthor
    Participant
    March 8, 2007
    J'ai trouvé quelque chose :) Je suis en train de tester.

    // Assume foo is a data-only stream
    application.myStream = Stream.get("foo");

    if (application.myStream){
    application.myStream.syncWrite = true;
    application.myStream.record();
    application.myStream.send("test", "hello world");
    }

    greg
    maelickAuthor
    Participant
    March 8, 2007
    I have tested. The value syncWrite is set to true, however it is still not writing in real time the file on the server.

    Does anyone has an idea ?

    Greg
    Participant
    March 12, 2007
    Stream.syncWrite

    Availability Flash Media Server 2.

    Usage myStream.syncWrite

    Description
    Property; a Boolean value that controls when a stream writes the contents of the buffer to a
    FLV file when the stream is recording. When syncWrite is true, all the messages that pass
    through the stream are flushed to the FLV file immediately. It is highly recommended that
    user should only set syncWrite to true in a stream that contains only data. Synchronization
    problems might occur when syncWrite is set to true in a stream that contains data and
    audio, video, or both.

    ... sounds like a problem is occuring :)