DroidCam Virtual Camera is a Rust-based application designed to display live camera streams using the egui
GUI framework. It connects to a remote video stream URL, decodes incoming frames in real-time, and renders them in a user-friendly interface.
- Real-Time Video Streaming: Streams video from a specified URL.
- Automatic Reconnection: Automatically attempts to reconnect if the connection drops.
- Efficient Frame Decoding: Processes JPEG frames from a multipart stream efficiently.
- Customizable UI: Leverages the
eframe
andegui
frameworks for a responsive and modern user interface. - Performance Optimized: Supports TCP keep-alive and adjustable connection timeouts for optimal performance.
- Rust Toolchain: Ensure that Rust and Cargo are installed. Install Rust
- Dependencies: The project relies on the following crates:
eframe
andegui
for GUI.reqwest
for HTTP requests.tokio
for asynchronous runtime.image
for image processing.futures-util
for handling asynchronous streams.
-
Clone the repository:
git clone https://github.com/muratdemirci/droidcam-virtual-camera.git cd droidcam-virtual-camera
-
Install dependencies:
cargo build
-
Run the application:
cargo run
The application connects to the following default stream URL:
http://192.168.0.101:4747/video
You can modify the url
field in the App
struct to connect to a different stream.
- Start the Application: Launch the app using
cargo run
. - View the Stream: If the stream is reachable, the application will display the video frames in real-time.
- Reconnect Logic: If the connection drops, the app will retry with an exponential backoff mechanism.
- Adjust Window Size: Resize the application window to fit your screen.
- Main Application (
App
):- Manages the video stream, connection logic, and frame decoding.
- Frame Decoding:
- Extracts JPEG frames from a multipart stream.
- User Interface:
- Displays video frames using
egui
's image widget.
- Displays video frames using
- Stream Task:
- Runs in a separate asynchronous task for continuous streaming.
- Connection Issues:
- Ensure the URL is correct and reachable.
- Verify the device providing the stream is active.
- Decoding Errors:
- Check the stream format; the application expects JPEG frames.
- Review error messages for specific issues with data format.
- Support for multiple camera streams.
- Adjustable resolution and quality settings.
- Integration with additional video formats (e.g., MJPEG).
- Improved error handling and diagnostics.
This project is licensed under the MIT License. See the LICENSE
file for details.
Contributions are welcome! Feel free to open issues or submit pull requests.
Developed by [Murat Demirci].