You could probably just use ffmpeg both for capturing and streaming with the help of the jshell library.
Also VLC should be able to do it. Search for my VLC wrapper here on the forum but you will probably need to call some extra functionality using Java object or inline Java code.