Skip to main content
Participant
January 10, 2007
Question

Multiple streams playing at the same time?

  • January 10, 2007
  • 2 replies
  • 403 views
I'm busy buidling my first flash application wich includes FMS2. I've got a mic connected wich records a few audiochannels to FMS, no problem there.

Now i want to play these audiochannels at the same time a progressive movie is playing. But the audiochannels have to be synced perfectly with the mvoie.

So my question is how can i regulate that after the progressive movie is fully downloaded and starts playing that at the streams play without interuptions at the specific times they need to play.

Sorry from my English grammer :)
And many thanks!
    This topic has been closed for replies.

    2 replies

    Participating Frequently
    January 15, 2007
    Consider breaking the video into smaller manageable chunks and provide an interface for user to select these smaller pieces. With smaller media you have an easier time starting a swf with the video.
    January 15, 2007
    You could record the timestamps when you start to record a voice stream , while you are playing the downloaded FLV.

    E.g. your progressive movie starts to play.

    At timestamp 1 minute and 15 seconds you start to record voice stream A
    At timestamp 3 minute and 2 seconds you start to record voice stream B
    At timestamp 3 minute and 29 seconds you start to record voice stream C

    Store those 3 timestamps in a database.

    When a user wants to see and hear the result you need to download the movie. Download the data-timestamps from a database. Download the voice-streams.

    Then have a fast interval running.

    Start your movie.

    Let the interval check if the play-time of the movie is matching one of your recorded timestamps. If it does ; play the voice-stream.

    Et voila.

    But don't expect this to be flawless. The resolution of the interval is pretty good (you can have an interval run 50 times a second) but the resolution of the FLV is not so accurate.

    command: time (NetStream.time property)
    public time : Number [read-only]
    The position of the playhead, in seconds

    Flash only lets you time this way on whole seconds.

    Normally ppl would record a movie and insert cuepoints. See the Video Encoder tool that's installed when you installed Flash 8.

    This requires "editting" of the movie before you can use it ; but you only need to listen for an event on your client. Ofcourse you can only use this method if you want to use fixed cuepoints in your main-movie (like points for a voiceover/comment or something)

    from the docs:

    command: onMetaData (NetStream.onMetaData handler)
    onMetaData = function(infoObject:Object) {}
    Invoked when the Flash Player receives descriptive information embedded in the FLV file
    being played.
    The Flash Video Exporter utility (version 1.1 or greater) embeds a video's duration, creation
    date, data rates, and other information into the video file itself. Different video encoders
    embed different sets of metadata.
    This handler is triggered after a call to the NetStream.play() method, but before the video
    playhead has advanced.
    In many cases the duration value embedded in FLV metadata approximates the actual
    duration but is not exact. In other words it will not always match the value of the
    NetStream.time property when the playhead is at the end of the video stream.
    Participant
    January 15, 2007
    The recorde audio has to be a stream from FMS2, so when the user has a slow internet connection the aduio would get out of sync when the buffer get's empty.