Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.5%) to scientific vocabulary
Repository
ROS2 version of the ros_rtsp ROS package
Basic Info
- Host: GitHub
- Owner: maladzenkau
- License: bsd-3-clause
- Language: C++
- Default Branch: master
- Size: 83 KB
Statistics
- Stars: 30
- Watchers: 1
- Forks: 11
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Acknowledgement
This project is a migration from ROS1 to ROS2. The original code was developed by CircusMonkey. I would like to express my gratitude for his contribution.
image2rtsp
This project enables the conversion of a selected ROS2 topic of type sensor_msgs::msg::Image or sensor_msgs::msg::CompressedImage into an RTSP stream, with an anticipated delay of approximately 0,3-0,4s. It also supports usb camera as a direct source. The generated stream can be utilized for various purposes such as remote control, object detection tasks, monitoring and more.
Currently supported and tested sensor_msgs::msg::Image formats: "rgb8", "rgba8", "rgb16", "rgba16", "bgr8", "bgra8", "bgr16", "bgra16", "mono8", "mono16", "yuv422_yuy2".
Supported and tested sensor_msgs::msg::CompressedImage formats: "rgb8; jpeg compressed bgr8". Other formats may work as well with some color scheme deviations. Please open an issue in this case and attach your ros2 bag, so i can fix it. If you need some specific unsupported format, create an issue and i will try to add it as soon as possible, but normally it takes pretty long, so dont hesitate to create a PR.
The development is being carried out on Ubuntu 22.04 with ROS2 Humble. Tested with Intel RealSense d435i.
You are reading now the README for a default ROS2 package. If you want to use this package written as a ROS2 component, checkout ros2_component branch.
Dependencies
ROS2 Humble
gstreamer libs:
bash sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev libgstrtspserver-1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-plugins-badInstall
- Navigate to the root directory, create a new directory named
ros2_ws/src, and then change the current working directory toros2_ws/src:bashrc cd mkdir -p ros2_ws/src cd ros2_ws/src/ - Clone the package and then navigate into the directory
image2rtsp:bashrc git clone https://github.com/maladzenkau/image2rtsp.git --single-branch - Adjust
parameters.yamlaccording to your needs:bashrc gedit ~/ros2_ws/src/image2rtsp/config/parameters.yaml# Example ROS2 Image topic stream # If the source is a ros2 topic (default case) compressed: False topic: "color/imageraw" defaultpipeline: | ( appsrc name=imagesrc do-timestamp=true min-latency=0 max-latency=0 max-bytes=1000 is-live=true ! videoconvert ! videoscale ! video/x-raw, framerate=30/1, width=640, height=480 ! x264enc tune=zerolatency bitrate=500 key-int-max=30 ! video/x-h264, profile=baseline ! rtph264pay name=pay0 pt=96 )
# Notice: The framerate setting does not affect the RTSP stream — it entirely depends on the ros2 topic frequency. # It is included in the pipeline and code for structural reasons. You can likely remove it from the pipeline without impacting the package's behavior.
# If camera serves as a source camera: False
camera_pipeline: | ( v4l2src device=/dev/video0 ! videoconvert ! videoscale ! video/x-raw, framerate=30/1, width=640, height=480 ! x264enc tune=zerolatency bitrate=500 key-int-max=30 ! video/x-h264, profile=baseline ! rtph264pay name=pay0 pt=96 )# Notice: Here the framerate might be set to the camera framerate, otherwise "503 Service Unavailable" error will appear.
# RTSP setup mountpoint: "/back" port: "8554" localonly: True # True = rtsp://127.0.0.1:portAndMountpoint (The stream is accessible only from the local machine) # False = rtsp://0.0.0.0:portAndMountpoint (The stream is accessible from the outside) # For example, to access the stream running on the machine with IP = 192.168.20.20, # use rtsp://192.186.20.20:portAndMountpoint - Save your configuration and navigate to `ros2ws
colcon root, source and build the package:bashrc cd ~/ros2_ws/ colcon build --packages-select image2rtsp`Run
- Source
installand launch the package:bashrc source install/setup.bash ros2 launch image2rtsp image2rtsp.launch.pyDon't useros2 run!
- Navigate to the root directory, create a new directory named
Check the stream
To check the stream, follow the instructions for gstreamer, mpv or VLC provided by CircusMonkey or use python script provided in this package (ensure before that the open-cv library is installed, if not pip install opencv-python). Open new terminal, ensure that the topic to be converted exists and the RTSP stream is running. Then:
bash
gedit ~/ros2_ws/src/image2rtsp/python/rtsp.py
Replace the rtsp://127.0.0.1:8554/back with your server's IP address, port and mount point rtsp://YOUR_IP:PORT/MOUNT_POINT. Save and run:
bash
cd ~/ros2_ws/
source install/setup.bash
ros2 launch image2rtsp rtsp.launch.py
Note
- The YAML configuration allows you to fully customize the pipeline according to your needs (Useful insights can be found, for example, here). This package does not provide any built-in acceleration. As its stability has not been validated across a wide range of Linux systems using advanced hardware or software techniques, support for such configurations is left to the user. There are no plans to update the package to support GPU/CPU acceleration. Please do not open issues related to software/hardware acceleration if they are directly related to the GStreamer pipeline itself.
Owner
- Name: Dzmitry Maladzenkau
- Login: maladzenkau
- Kind: user
- Company: RPTU (TU Kaiserslautern)
- Repositories: 2
- Profile: https://github.com/maladzenkau
M.Sc. in Automation and Control
Citation (CITATION.cff)
cff-version: 1.2.0
preferred-citation:
type: software
message: If you use this software, please cite it as below.
authors:
- family-names: Maladzenkau
given-names: Dzmitry
title: "image2rtsp"
version: 1.0
date-released: 2023-27-11
license: BSD 3-Clause
url: "https://github.com/45kmh/image2rtsp"
GitHub Events
Total
- Issues event: 3
- Watch event: 13
- Delete event: 1
- Issue comment event: 5
- Push event: 6
- Pull request event: 3
- Fork event: 5
- Create event: 1
Last Year
- Issues event: 3
- Watch event: 13
- Delete event: 1
- Issue comment event: 5
- Push event: 6
- Pull request event: 3
- Fork event: 5
- Create event: 1
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 2
- Total pull requests: 2
- Average time to close issues: 5 months
- Average time to close pull requests: 7 minutes
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 1.5
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 2
- Average time to close issues: 5 months
- Average time to close pull requests: 7 minutes
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 1.5
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- kam45x (1)
- xiaotaozide (1)
- langlangtianhq (1)
- obliviate1230 (1)
- AlexanderStatkevich (1)
Pull Request Authors
- maladzenkau (3)
- gstorer (1)
- dustydins (1)