javacv
javacv copied to clipboard
is grabber's startUnsafe have any risk?
Hi, I met a problem when grab local video file and remote rtmp concurrent, when the rtmp is no stream, the rtmp's grabber's start method will block in the start method by rw_timeout,in this time, if local file 's grabber's start called, this call will block by the code in start method : synchronized (org.bytedeco.ffmpeg.global.avcodec.class)
So, I found the no synchronized version: startUnsafe and releaseUnsafe,I use them in the unstable rtmp situation and start/stop in local file, there is no problem found.
But, I worried about the "unsafe", Can you tell me is there some risk about the startunsafe/releaseUnsafe ? thank you!
Some codecs are not thread-safe, but if the codecs you are using are thread-safe, then we don't need the extra synchronization.
In my scene, the libx264 and libacc are used, do you know and can you tell me they are thread safe? thank you @saudet