Application Development Tips and Tricks > File types and paths > Recorded stream files

 

Recorded stream files

When you use methods that record audio, video, or data streams (for example, NetStream.publish), Flash Communication Server creates two files—filename.flv and filename.idx—where filename is the string that was passed to the method that recorded the stream. These files are the recorded stream and its associated index file. For example, if you issue the command NetStream.publish("me", "record"), files named me.flv and me.idx will be created.

When Flash Communication Server generates stream files for an application, it creates a streams directory with application-instance subdirectories. For example, if the application instance ChatApp/MondayChat records a stream named chat, the chat.flv and chat.idx files will be stored in the following location: /applications/ChatApp/streams/MondayChat. If you run an instance of ChatApp called TuesdayChat, its files will be stored in /applications/ChatApp/streams/TuesdayChat.

If you want to play back an FLV file that was created by a specialized video application, such as Sorenson Squeeze, place it in the directory where the Flash Communication Server expects to find it—that is, a subdirectory of a /streams directory as discussed in the preceding paragraph. When you run the application, Flash Communication Server will create an IDX file and store it in the same subdirectory. You can create subdirectories to further organize FLV files, as long as the subdirectories are in the correct application-instance subdirectory. For example, within /streams/TuesdayChat, you could create additional subdirectories /streams/TuesdayChat/morning and streams/TuesdayChat/afternoon and store FLV files in those subdirectories.

If you want to play back MP3 audio files, see the Playing MP3 files.

To avoid overwriting streams, consider using unique names for users, streams, and so on. For example, when recording a new stream, you could provide an incremental value:

outStream.publish("myRecording" + numSnaps, "record");

For information on deleting recorded stream files, see Stream object. For more information on instance names and file storage, see NetConnection.connect and NetStream.publish in the Client-Side Communication ActionScript Dictionary.