How can I access the IPTV server programmatically?

My university is currently testing IPTV. To access the service, you will be asked to install VLC Media Player and run files downloaded from the university’s intranet, each of which represents a channel, through it.

Files have the format:

#EXTM3U
#EXTINF:0,ITV2
udp://@238.255.0.6:2001

What I learn as an M3U playlist file. Fortunately, the file displays the IP address of the server hosting the service, the port to access it, and the protocol, in this case UDP.

My question is: how can I access the service programmatically? Is there a specific handshake that the client does with the server? Seeing how accessible this is through VLC Media Player, of course, access to data will be trivial, since the proprietary protocol is not used?

I do not understand Internet access too much; I know that in Java can be built Portthat models UDP. I would appreciate Java answers, but any such language is more than enough.

Thanks!

+3
source share
2 answers

This is a special handshake at the switch level, indicating to the switch that you are part of a multicast group so that you also receive packets. Below is an example of registering and accepting into an udp socket in java

   // join a Multicast group and send the group salutations

 InetAddress group = InetAddress.getByName("228.5.6.7");
 MulticastSocket s = new MulticastSocket(6789);
 s.joinGroup(group);
 // get their responses!
 byte[] buf = new byte[1000];
 DatagramPacket recv = new DatagramPacket(buf, buf.length);
 s.receive(recv);
 ...
 // OK, I'm done talking - leave the group...
 s.leaveGroup(group);

http://www.j2ee.me/j2se/1.4.2/docs/api/java/net/MulticastSocket.html

j2ee example

, , , , mpeg2, mpeg4 , , , , .

+5

, VLC Java. VLC Java. VLC Java! , API VLC.

+4

Source: https://habr.com/ru/post/1710700/


All Articles