google-code-export / red5

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

Stream recording is not finalized #494

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Publish a video/audio stream from a flash client
2. On the server, record the stream using stream.saveAs() method
3. Close the stream (or use stream.stopRecording() method)

What is the expected output? What do you see instead?
The stream is correctly flushed to disk but not finalized. There are two files, 
stream.flv and stream.flv.ser, and the first one is empty.

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

Please provide any additional information below.
Investigating through the code, I have found a potential bug in 
org.red5.io.flv.impl.FLVWriter class, method "close()" at line 584: the

lock.acquire(2000);

call locks the thread as the lock cannot be acquired 2000 times. The problem is 
solved by using

lock.acquire();

or

lock.tryAcquire(2000, TimeUnit.MILLISECONDS);

Original issue reported on code.google.com by alagna.f...@gmail.com on 4 Apr 2014 at 2:14

GoogleCodeExporter commented 9 years ago
This should no longer be an issue with red5-io-1.0.3 in the server release. You 
can also fix any .ser files by using the FLVWriter from the command line, 
instructions may be found here: 
https://github.com/Red5/red5-server/wiki/Repairing-Recordings

Original comment by mondain on 10 Apr 2014 at 4:56