Skip to content

This repository contains an Android application for live streaming camera footage via RTSP and a Python script for processing the stream using OpenCV.

Notifications You must be signed in to change notification settings

oaslananka/CamStreamAndroidToPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CamStreamAndroidToPython

Project Description

This project demonstrates how to stream live camera footage from an Android device using RTSP and perform object detection on the stream using YOLO (You Only Look Once) in Python. The Android application captures the camera feed and streams it over RTSP, while the Python script processes this stream to detect objects using the YOLO model.

Features

  • Android Application:

    • Captures live camera feed.
    • Streams the camera feed via RTSP.
    • Uses CameraX for camera functionalities.
    • Implements ViewModel, LiveData, and Snackbar for error and success messages, following the MVVM architecture.
  • Python Script:

    • Connects to the RTSP stream from the Android application.
    • Uses YOLO for object detection.
    • Captures a 5-second GIF from the stream.
    • Displays real-time object detection with bounding boxes and labels.

Prerequisites

  • Android:

    • Android Studio
    • Minimum SDK version 21
    • Recommended target SDK version 34
  • Python:

    • Python 3.6 or higher
    • OpenCV
    • Ultralytics YOLO
    • PyTorch
    • imageio

Installation

Android

  1. Clone the repository:
git clone https://github.com/yourusername/CamStreamAndroidToPython.git
cd CamStreamAndroidToPython/android/CameraXRTSPStreaming
  1. Open the project in Android Studio:

  2. Build the project:

  • Android Studio will automatically download the necessary dependencies.

Python

  1. Navigate to the Python project directory:
cd ../python/stream_processing
  1. Install the required Python packages:
pip install -r requirements.txt
  1. Run the Python script:
python main.pyxt

Acknowledgements

About

This repository contains an Android application for live streaming camera footage via RTSP and a Python script for processing the stream using OpenCV.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages