Git Product home page Git Product logo

java-socket-videostream-wifi's Introduction

Intranet based Video over Wi-Fi (VoWi-Fi) system within a single access point using socket programming

In the provided code, the client (ClientViewer) needs to know the IP address of the machine running the server (CameraServer).

Server (CameraServer): who wants to share his screen

  1. ServerSocket is created on a specified Port. (we have used, 9999)
  • The ServerSocket class is part of the Java standard library and is used to create a socket that listens for incoming connections from clients. It provides a way to establish a server on a specified port, waiting for clients to connect.

  • A socket is a software endpoint that establishes a communication link between two processes running on a network.

  • A software endpoint refers to a specific location in a software application where communication begins or terminates.

  1. Once a client connects, a new Socket is created for communication with that client.

  2. The sendVideo method continuously captures screen frames using the Robot class and sends them to the client over the socket.

  • The Robot class is part of the java.awt package. In the context of the provided code, the Robot class is used to capture the screen.
  1. The video frames are sent as JPEG images. The server converts the BufferedImage to a byte array using ImageIO.write.
  • BufferedImage is a class that represents an image, it be converted to a byte array to represent the image data in a raw format

Client (ClientViewer): who wants to view the shared screen

  1. The client creates a Socket and connects to the server's IP address and port.

  2. The receiveAndDisplayVideo method continuously receives the video frames from the server over the socket.

  3. The received byte stream is converted back to a BufferedImage using ImageIO.read.

  4. The BufferedImage is then displayed in a Swing JLabel within a JFrame.

  • JLabel and JFrame are two Swing components commonly used for displaying text or image and creating the main window, managing the overall appearance and behaviorof an application.
  1. The DataOutputStream on the server side writes the size of the image data followed by the actual image data, and the DataInputStream on the client side reads this information.

java-socket-videostream-wifi's People

Contributors

anuragjain-git avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.