Fix readme

This commit is contained in:
Sam Armstrong 2018-09-28 10:43:46 +10:00
parent bb59884bf1
commit 9948cdb999

View File

@ -13,8 +13,21 @@ This is still very much a work in progress. Developing on Ubuntu 16.04 and 18.04
sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev libgstrtspserver-1.0-dev sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev libgstrtspserver-1.0-dev
``` ```
## Build into your catkin workspace
Navigate to your catkin workspace `src` folder. I.e. `cd ~/catkin_ws/src`.
Clone this package to the repository:
```bash
git clone https://github.com/CircusMonkey/ros_rtsp.git
```
Navigate back to the catkin workspace root and make the package:
```bash
cd ..
catkin_make pkg:=ros_rtsp
```
## Stream Setup ## Stream Setup
Change the config/stream_setup.yaml to suit your required streams. Change the `config/stream_setup.yaml` to suit your required streams.
```yaml ```yaml
# Set up your streams to rtsp here. # Set up your streams to rtsp here.
@ -35,12 +48,14 @@ streams: # Cannot rename - must leave this as is.
caps: video/x-raw,framerate=10/1,width=640,height=480 # Set the caps to be applied after getting the ROS Image and before the x265 encoder. caps: video/x-raw,framerate=10/1,width=640,height=480 # Set the caps to be applied after getting the ROS Image and before the x265 encoder.
bitrate: 500 # bitrate for the h264 encoding. bitrate: 500 # bitrate for the h264 encoding.
``` ```
Notes: Add as many streams as you require.
- Add as many streams as you need. If too much latency is encounted with multiple streams running, the server computer may be maxing out its processor trying to encode all the streams. Try reducing the resolution of the source caps.
- The ROS Image topic stream may be buggy with framerates too fast for the Image publisher and the buffer writing. Stick with 10/1 fps unless you want to debug? :)
- If too many frames are being dropped, it is likely due to network bandwidth. Try dropping the bitrate.
## Checking the streams ## Checking the streams
Launch the streams from the ROS launch file:
```bash
roslaunch ros_rtsp rtsp_streams.launch
```
### gstreamer ### gstreamer
The best way to check a stream is working is to use `gst-launch-1.0`. You will need to install gstreamer for your client system. See https://gstreamer.freedesktop.org/documentation/installing/index.html The best way to check a stream is working is to use `gst-launch-1.0`. You will need to install gstreamer for your client system. See https://gstreamer.freedesktop.org/documentation/installing/index.html
```bash ```bash
@ -53,3 +68,10 @@ The command I've had the lowest latency with is:
```bash ```bash
vlc --no-audio --avcodec-hw=any --sout-rtp-proto=udp --network-caching=300 --sout-udp-caching=0 --clock-jitter=0 --rtp-max-misorder=0 rtsp://<server_ip>:8554/<your_stream_mountpoint> :udp-timeout=0 vlc --no-audio --avcodec-hw=any --sout-rtp-proto=udp --network-caching=300 --sout-udp-caching=0 --clock-jitter=0 --rtp-max-misorder=0 rtsp://<server_ip>:8554/<your_stream_mountpoint> :udp-timeout=0
``` ```
## Debugging
- If too much latency is encounted with multiple streams running, the server computer may be maxing out its processor trying to encode all the streams. Try reducing the resolution of the source caps.
- The ROS Image topic stream may be buggy with framerates too fast for the Image publisher and the buffer writing. Stick with 10/1 fps unless you want to debug? :)
- If too many frames are being dropped, it is likely due to network bandwidth. Try dropping the bitrate.
- If the ROS topic isn't available, you will get a `can't prepare media` error after a delay.