I am doing a VCL streaming and I need to get the frames or the video from a java multicast.
I join the multicast group and I receive these datagram packets, but I do not know how to handle them.
Any code advices? Or any library to convert these packets into frames in kind of real time?
public static void main(String[] args) throws UnknownHostException {
InetAddress address = InetAddress.getByName(INET_ADDR);
byte[] buffer = new byte[256];
try (MulticastSocket clientSocket = new MulticastSocket(PORT)){
clientSocket.joinGroup(address);
while (true) {
DatagramPacket msgPacket = new DatagramPacket(buffer, buffer.length);
clientSocket.receive(msgPacket);
}
} catch (IOException exception) {
exception.printStackTrace();
} System.out.println(i);
}
p.s I can not modify the way of sending the streaming packets
Thanks