Posts

Showing posts with the label javafx

Play H.264 Encoded Stream in JavaFX

Play H.264 Encoded Stream in JavaFX I have a Raspberry Pi getting video data from raspivid and piping that to netcat , which sends it to my PC where I can read each frame like this: raspivid netcat ServerSocketChannel serverChannel = ServerSocketChannel.open(); serverChannel.socket().bind(new InetSocketAddress(Main.config.getInt("VIDEO_STREAM_PORT"))); serverChannel.configureBlocking(true); SocketChannel channel = serverChannel.accept(); InetSocketAddress remoteAddress = (InetSocketAddress) channel.getRemoteAddress(); int BUFFER_SIZE = 2 << 16 - 1; ByteBuffer buff = ByteBuffer.allocate(BUFFER_SIZE); while (channel.read(buff) != -1) { buff.flip(); if (buff.hasRemaining()) { buff.compact(); } else { buff.clear(); } } What is the optimal way of playing these frames as video in JavaFX? Is there any way to do it besides decoding each frame as a BufferedImage and rendering that? Or is there another approach altogether that I'm missing? On Linux yo...

LSOpenURLsWithRole() failed for the application with error -10810. javaFX file

LSOpenURLsWithRole() failed for the application with error -10810. javaFX file I am writing an app on Intellij Idea and it works fine inside the environment, but today I've tried to build artifact and got this error: LSOpenURLsWithRole() failed for the application with error -10810. LSOpenURLsWithRole() I have tried to open .jar on mac and on windows 10 - doesn't work anywhere. .jar By partial cutting the code I've come to the conclusion, that there is a problem with images. After that, I've deleted any strings of code, working with images and .jar file compiled and works. .jar What could be wrong and how to fix it? I didn't anything extraordinary with images, all the lines of code that work with images looks like: Image Print=new Image("images/Print.png"); ClassIcon.setFitHeight(0.35*x); ClassIcon.setFitWidth(0.8*y); ClassIcon.setLayoutX(0.25d*x); ClassIcon.setLayoutY(0.065*y); does "images/Print.png" exists in you...

Not able to run my JavaFX jar file on Raspberry Pi 3(Raspbian)

Image
Not able to run my JavaFX jar file on Raspberry Pi 3(Raspbian) I am trying to run my JavaFX program (Aiish_GUI.jar) on Raspberry Pi 3 B+, And I get an error which looks like this: When i run command with sudo: When i run command without sudo As can be seen in the first image, my JavaFX project includes exteral library jar files(Apache POI to read and write excel files) The project was done in IntelliJ IDE and artifacts created from the same. It works as Expected in Windows 10 and Ubuntu 16.04 but i get these problems on Raspbian Extra details I am totally new to Raspberry Pi as well as Raspbian OS. Hope i can get my program running soon. Thanks in advance :) Have you tried running the app without X Windows? Just logout to the shell, and run it there again. – José Pereda Jun 30 at 13:55 Thanks for the reply @JoséP...