recording flv broken red5
Asked Answered
G

0

6

I am using red5 server 1.0.6

Some of my recorded files are broken, I have read in some articles that if a stream is closed before the bufferLength of the stream is greater than 0, the recorded file will be broken. This is my code for saving and closing the stream.

@Override public void streamPublishStart(IBroadcastStream stream) {
    try {
        /* My script to save started stream details in database */
        stream.saveAs("audio/"+username, true);
    }
    catch (Exception e) {
        e.printStackTrace(); 
    }
}

@Override public void streamBroadcastClose(IBroadcastStream stream) {
    /* My script to save closed stream details in database */
    stream.close();
}

Is the stream.close() reason for broken recordings? What happens if I don't close the stream?

Giarla answered 29/12, 2015 at 13:24 Comment(16)
Hi! What do you mean with broken? Can you open the file but the quality is bad?Endow
It's not playing at allGiarla
If I execute ffmpeg command it is giving invalid data found while processing inputGiarla
flvmeta author here. flvmeta --check can be used to diagnose such problems. It might tell you exactly how the file is broken.Iceman
Do you need to use the isAppend flag in true? Did you get the same result doing stream.saveAs("audio/"+username, false)?Endow
No, I haven't tried that.Giarla
I want to save all the data in same fileGiarla
During your transmission, do you have any suscriber listening the audio? Only to check if the problem is maybe on the client. Do you have this problem always?Endow
Do you have some .ser files with the same name on your streams folder when this happens?Endow
Yes I have 2 subscribers listening to that stream.Giarla
Nope, no .ser or .info files in my folderGiarla
Let us continue this discussion in chat.Giarla
@Iceman I will try that tomorrow and ping youGiarla
@Iceman it is show 0x00000000: fatal F11002: FLV signature not found in header 1 error(s), 0 warning(s)Giarla
Well, the file is not a valid FLV file then. That's pretty much all I can say, unfortunately.Iceman
It played well in live stream. file metadata is shown if I use flvreader(Java). is it possible to add FLV signature to the file?Giarla

© 2022 - 2024 — McMap. All rights reserved.