hey all , i want to do the following open a Named pipe using java , and extract the content of that archive (rar / zip /etc..) to a named pipe the run mplayer with the location of that pipe and play the movie ,
i tried open the IPC in java using this project CLIPC but , my code is freezing in the fifo.openWriter(); line
FIFO fifo = new FIFO("jtpc_fifo");
fifo.create();
fifo.openWriter();
i tried , to create a small server Socket in java that wait for a connection and send the video file content as raw data , but i dont know how to tell mplayer to get raw data over the network.
i want to use a pipe , cause i think its the best solution no physical and large file to handle ,its volatile and most flexible
thank you
This is what i am trying now , to use sockets but the java server socket accept the connection only after mplayer fail on timeout
mplayer http://localhost:5555/file.raw
try{
String file = "D:\\tmp\\lie.to.me.201.the.core.of.it-sitv.mkv";
ServerSocket socket = new ServerSocket(5555);
System.out.println("UnrarTest.main() START");
Socket s = socket.accept();
System.out.println("UnrarTest.main() ACCEPT");
final InputStream sin = s.getInputStream();
new Thread(){
public void run(){
try{
while(true){
if(sin.available() > 0){
int read = sin.read();
System.out.println((char)read);
}
}
}catch(Exception ee){
ee.printStackTrace();
}
}
}.start();
final OutputStream sout = s.getOutputStream();
final FileInputStream fin = new FileInputStream(file);
new Thread(){
public void run(){
try{
while(fin.available() > 0){
int in = fin.read();
System.err.println(in);
sout.write(in);
}
}catch(Exception ee){
ee.printStackTrace();
}
}
}.start();
}catch(Exception e){
e.printStackTrace();
}