google-code-export / red5

Automatically exported from code.google.com/p/red5
0 stars 0 forks source link

Live recording using 1.0.2 only plays back split second of audio #480

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Record audio/video using Flash Builder 4.6
2. Stop video 
3. Playback using netStream
4. Playback first time works
5. Playback on all subsequent attempts fail

What is the expected output? What do you see instead?

Expect to see/hear recorded file as created.  I see/hear file fine the "first" 
time it's played after recording.  However, all subsequent attempts fail and 
produce a still frame and a split second of audio.  

What version of the product are you using? On what operating system?

Red5 1.0.2RC3 from trunk although the 1.0.1 and 1.0.2 snapshot do the same 
thing.  Flash Builder 4.6, Flash Debugger 11.9

Please provide any additional information below.

If I play it from the server itself, I can see that the entire audio/video was 
recorded... and matches the duration reported by the Metadata event.  The code:

[code]
//Recording
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS,recordingStatus);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR,asyncErrorHandler);
ns.addEventListener(IOErrorEvent.IO_ERROR,IOErrorHandler);
if (cam != null) ns.attachCamera(cam);  // set previously
if (mic != null) ns.attachAudio(mic);   // set previously
ns.publish(rtmpSession,"record");   

//Stop Recording 
ns.attachAudio(null);
ns.attachCamera(null);
ns.close();  // have put this on timer as well

//Playback
nsp = new NetStream(nc);
nsp.client = this;
nsp.addEventListener(NetStatusEvent.NET_STATUS,playBack);
nsp.play(rtmpSession);  // and tried rtmpSession + ".flv"
...
  private function playBack(e:NetStatusEvent):void {
    switch (e.info.code.toString()) {
     case "NetStream.Play.Start":
      videoWindow.attachNetStream(nsp);  // have put this right after nsp.play() too
[/code]

The netStatus event reports the following:

NetConnection.Connect.Success
playback:NetStream.Play.Reset
playback:NetStream.Play.Start
METADATA: duration=18.279
playback:NetStream.Buffer.Full
playback:NetStream.Video.DimensionChange
playback:NetStream.Buffer.Empty

If I run the program in the debugger and put a breakpoint on 
videoWindow.attachNetStream(nsp) and resume execution... the video plays every 
time.  

If I switch the IP address in the code to a 0.9 server, the code works 
correctly.  When I switch back to the 1.0.2 server and it doesn't.

I've restarted Red5, doesn't play.  Exited and got back into Flash Builder 4.6, 
doesn't play.

There are no errors in the logs.  The only entry that seems odd is:
Logger context selector method found

Original issue reported on code.google.com by veloce...@gmail.com on 18 Jan 2014 at 4:18

GoogleCodeExporter commented 9 years ago
I ran the code on my Win7 laptop with FB 4.6 and Flash 12.0 debugger.  I 
started by trying to play the file created with the Win8 system and had 
trouble.  Recorded a new file with Win7 and it played fine.  Tried different 
debuggers (11.1, 11.9) and it still played correctly.   Went back to the Win8 
box and it still had the original problem... would play the first time but 
never after that.  

So, it would appear that there is a slight difference between the .flv's 
created by each machine using the same code, just a different OS and Flash 
debugger.   But the problem exists on Win8 regardless of where the file was 
created.

Original comment by veloce...@gmail.com on 19 Jan 2014 at 6:15

GoogleCodeExporter commented 9 years ago
I'm fairly certain there were issues in Flash Player 11 or 12 with Audio 
capture on windows 8 / 8.1. 

Original comment by mondain on 2 Apr 2014 at 3:43

GoogleCodeExporter commented 9 years ago
Use a larger recording queue on the server and ensure that the buffers are 
empty on the client before you close the netstream. There and possibly still 
are issues with even the newest FP versions with or without throwing Win 8/8.1 
into the mix.

Original comment by mondain on 10 Apr 2014 at 5:12