What steps will reproduce the problem?
1.Publish a stream for 10 seconds (0 - 10 secs)
2.Then publish again by appending to the same file (another 10 seconds)
3.When playing the flv file the timer show the file lendth is only 10 seconds
even though the video will play past 10 seconds
What is the expected output? What do you see instead?
The timer should show that the file is 20 seconds
What version of the product are you using? On what operating system?
Red5 revision 4710
Please provide any additional information below.
In FLVWriter.java file there's a comment "update duration" with no
implementation. Here's an implementation that do the duration update but that
sometimes corrupt the file and I can't play it.
File hdr = new File(filePath + ".hdr");
RandomAccessFile hdrfile = new RandomAccessFile(hdr, "rws");
writeHeader(hdrfile);
duration = FLVReader.getDuration(file);
System.out.println("xFile: " + filePath + " - Duration: " + duration);
writeMetadataTag(duration * 0.001d, videoCodecId, audioCodecId, hdrfile);
if(file != null)
{
file.seek(0);
hdrfile.seek(0);
file.getChannel().transferFrom(hdrfile.getChannel(), 0, hdrfile.length());
}
hdrfile.close();
if (hdr.exists()) {
hdr.delete();
}
Original issue reported on code.google.com by jdn...@gmail.com on 19 Sep 2013 at 11:10
Original issue reported on code.google.com by
jdn...@gmail.com
on 19 Sep 2013 at 11:10