Repository metrics
- Stars
- (6,985 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
I tried this for record sample data
PipedOutputStream pos=new PipedOutputStream();
FFMpegFrameRecorder recorder=new FFmpegFrameRecorder(pos,channels);
PipedInputStream pis=new PipedInputStream(pos,640000);
...setRecorder...
recorder.start();
....get frame from somewhere...
while((frame!=null){
recorder.record(frame);
while(pis.avaliable()>0){
pis.read(new byte[2048]);
}
frame.close();
}
I run this code for a while and the JVM crushed. Location is swr_convert called by recordSample()
As I known. the data in frame won't be put in the stream immediately when the recorder.record(sample) is called.
Usually I can only get the date from pis after several frame is recorded(for example 10frames)
So I think this problem may be caused by I closing the frame before the data is dump into the stream actually.
But I have to close this frame.
some flush methods from recorder、pos、pis. I alse tried these. but no effect.
Do you have some idea on how to flush the frame data into pis immediately?
Looking forward to your reply