I’m trying to find ways to stream a live video generated in a Java application. The application needs to take screenshots of itself and encode these into a video stream and publish the stream.
So far I have been using Xuggler (a Java library on top of FFMPEG) to encode the screenshots into a video file. This works great. Xuggler claims to be able to transmit live video via RTMP but I have not found any documentation on how to do this programmatically.
- Does anyone know how to stream RTMP video programmatically from Xuggler?
- Does anyone have a suggestion on other libraries I could use to achieve the same results? I’d prefer to stream the video in MPEG2 over RTP.
I did find someone else asking a very similar question on the Xuggler forums here with no response.
I have looked into JMF and it is not an option for other reasons.
Honestly don’t waste your time with JMF, you can consider that offering dead. Here is how you would do screen shotting to an rtmp stream using h.264 (thanks to tyreus@gmail.com for the example). If the code doesn’t show up here’s pastebin for it: http://pastebin.com/sJHwj0nW