I'm using Adobe Media Server 4.5 and the FLEX 4.6.0 sdk.
I have an .swf application that connects to Adobe Media Server over RMTP, takes audio and video input from the user's webcam and mic, and does a NetStream.publish() to stream the file to the server. The file grows in size as the user records the video. On occasion, the resulting file will end up with a size of 1kb.
What's causing this and how can I prevent it, or otherwise end the session and inform the user that something went wrong?
Some additional questions/comments/opinions that might help identify the problem:
This only happens 1% of the time, and I'm not sure what I can use to troubleshoot this. I've never been able to catch when this happens before the log files generated by AMS expire.
My theory is that it happens when the client loses connection somewhere.
As long as the NetStream is publishing correctly, the file will grow in size. If the file doesn't grow, it should mean that the NetStream lost connection. Seeing as the file is 1kb, the stream must have lost connection immediately after starting to publish.
I also opened the file in Notepad++ and got this:
FLV [SOH][NUL][NUL][NUL][NUL] [NUL][NUL][NUL][NUL]
Another theory is that something has a chance to overwrite my file, but this is unlikely
Have the same problem, but 0.001% of the cases.
The most common problem occurs because of a microphone. Need to check the microphone before publishing a stream.
Another possible problem:
NetStream.Record.Stop
onDisconnect
Can warn if called onUnpublish
event on the server.
I also use the timer after the publish ()
method on the client side, if after 3-5 seconds NetStream.Record.Start
event is not called, then the client has a problem and it should be prevented.