Search Box

Google
 

Thursday, January 31, 2008

Streams not being Saved or saved with zero file size.

I am currently playing around with Flash Media Server based applications using RED 5(Amazing tool I would say.) and encountered a very very strange Bug. When I tried to record voice over the web using my application url I found that a FLV file is being created but it does not appear to have a valid file size. I have been struggling over this from changing my code from AS3 - AS2 and vice versa but with no luck. But one thing that constantly came to my notice during this struggle was that in other applications (that came along with red 5 server as demo files ) whenever I tried to record my voice I was able to see a setting window invoked by the flash player asking for user's confirmation to allow data to be recorded. And in my application whenever i clicked record this setting window never showed. Maybe it was my bad luck that stopped me from thinking or analyzing in this line of thought i was busy thinking about other problems which resulted in failure to make my application work correctly until today morning when tried the red 5 applications native demo swf file to record my voice using my app's url. Amazingly my voice was starting to be recorded and i could see the flv's file size constantly increasing with voice data being stored.

I did not know why or how it occured to me but i once again opened my own application fla file and changed its stage size to 250 x 250 then published it to test.

Guess what happened ??? when i connected to the RED 5 server and clicked the record button i was able to see the flash setting window being opened asking for the request to allow my url to record data. And happily saw the size of flv file increasing being saved in my streams folder.

Concluding i guess it was the stage size that was giving problem all this time. My guess is that if the stage size needs to be big enough to accommodate the flash player setting box to be shown (in my case i found it to work perfectly with 250 x 250 px).

Regards,

Ashok Srinivasan.

2 comments:

Unknown said...

yep that movie size thing is well hidden into the help file:

showSettings (System.showSettings method)
public static showSettings([tabID:Number]) : Void

Shows the specified Flash Player Settings panel. The panel lets users do any of the following actions:

Allow or deny access to the camera and microphone
Specify the local disk space available for shared objects
Select a default camera and microphone
Specify microphone gain and echo suppression settings
For example, if your application requires the use of a camera, you can tell the user to select Allow in the Privacy Settings panel and then issue a System.showSettings(0) command. (Ensure that your Stage size is at least 215 x 138 pixels )

Availability: ActionScript 1.0; Flash Player 6

Ashok Srinivasan said...

Hello Chris,

if you want your microphone or camera data to be saved over the web then it needs to use a Media Server technology at the backend which can accept incoming media data. But if it is a standalone application then there are quite few chances by writing a C/C++ based wrapper to the swf and directly link with the flash based microphone class. But over the web i am doubtful if you can save microphone data without FMS or RED5. Moreover in my opinion RED5 is a better solution and there are many solutions that are free and opensource available online. Maybe MILGRA will help u for that.