reading a emdia file byte by byet and forward to VLC + JAVA

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
sepi_1982
Blank Cone
Blank Cone
Posts: 22
Joined: 21 Aug 2006 13:02

reading a emdia file byte by byet and forward to VLC + JAVA

Postby sepi_1982 » 07 Nov 2006 14:33

Hello i am trying to read a media file byte by byte, build UDP datagram and send this over my machine on port 5000. I started VLC player to listen on port 5000 UDP, VLC does receive something but does not display anything.
here is my java code:

I read an .avi file by chunck of 1024 bytes:

System.out.println("opening file: "+path+filename);
File file = new File(path+filename);
FileInputStream fin = new FileInputStream(file);
DatagramSocket udpsocket = new DatagramSocket();
udpsocket.setSendBufferSize(1024);
DatagramPacket packet;
byte b[] = new byte[1024];
int i = 0;
while(fin.read(b) != -1){
i++;
packet = new DatagramPacket(b,b.length);
packet.setAddress(InetAddress.getByName("localhost"));
packet.setPort(5000);
System.out.println("send packet "+ i);
udpsocket.send(packet);
b = new byte[1024];

}
udpsocket.close();


Could you please explain me what can be wrong in this?

thanks a lot
sebastien

Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 34 guests