To remotely play a media file I have used UDP datagram. I'm sending packet of 40 kb to clients, but to synchronize all the clients I need to find duration of each packet so that if a packet is lost I can pause player at client side using SocketTimeOutExcpetion. To calculate duration of each packet I have used following equation
duration of packet= (duration of whole file)/SizeOfPacket
where,
duration of file = (length of file)/bitrate *8
Currently I'm calculating Bitrate using mediainfo package in ubuntu.
How can I get Bitrate of a Audio or Video File using VLCJ API ?