javacv icon indicating copy to clipboard operation
javacv copied to clipboard

FFmpegFrameRecorder to push stream to Nginx multithreads

Open mqm-slice opened this issue 2 years ago • 5 comments

bde7631d7ff6a9cb19d3810890b11f4 When using FFmpegFrameRecorder to push stream to Nginx multithreads, this error occurs after a while and causes the program to crash. I saw no significant increase in the memory used by the Java threads, and no other Java errors were reported in the terminal. It's confusing to me.

mqm-slice avatar Aug 17 '22 03:08 mqm-slice

hs_err_pid25476.log

This is the error log file.

mqm-slice avatar Aug 17 '22 03:08 mqm-slice

FFmpeg is not too thread-safe. Please don't try to use the same instance of FFmpegFrameRecorder across threads.

saudet avatar Aug 17 '22 07:08 saudet

I created a new FrameRecorder instance in each thread, and the program crashed over a period of time, but at random.

FFmpeg is not too thread-safe. Please don't try to use the same instance of FFmpegFrameRecorder across threads.

mqm-slice avatar Aug 17 '22 11:08 mqm-slice

The codecs that you are using might not be thread-safe, even across different instances. Try to use other codecs.

saudet avatar Aug 17 '22 12:08 saudet

The codecs that you are using might not be thread-safe, even across different instances. Try to use other codecs. I will try. Thank you.

mqm-slice avatar Aug 17 '22 12:08 mqm-slice