camerastream instructions (#31326)

* camerastream instructions

* Update README.md

* Update tools/README.md

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
pull/31331/head
dzid26 1 year ago committed by GitHub
parent 88b635c4e1
commit 0af62eb3b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      tools/README.md
  2. 66
      tools/camerastream/README.md
  3. 4
      tools/camerastream/compressed_vipc.py

@ -68,6 +68,7 @@ Learn about the openpilot ecosystem and tools by playing our [CTF](/tools/CTF.md
├── ubuntu_setup.sh # Setup script for Ubuntu
├── mac_setup.sh # Setup script for macOS
├── cabana/ # View and plot CAN messages from drives or in realtime
├── camerastream/ # Cameras stream over the network
├── joystick/ # Control your car with a joystick
├── lib/ # Libraries to support the tools and reading openpilot logs
├── plotjuggler/ # A tool to plot openpilot logs

@ -0,0 +1,66 @@
# Camera stream
`compressed_vipc.py` connects to a remote device running openpilot, decodes the video streams, and republishes them over VisionIPC.
## Usage
### On the device
SSH into the device and run following in separate terminals:
`cd /data/openpilot/cereal/messaging && ./bridge`
`cd /data/openpilot/system/loggerd && ./encoderd`
`cd /data/openpilot/system/camerad && ./camerad`
Note that both the device and your PC must be on the same openpilot commit.
Alternatively paste this as a single command:
```
(
cd /data/openpilot/cereal/messaging/
./bridge &
cd /data/openpilot/system/camerad/
./camerad &
cd /data/openpilot/system/loggerd/
./encoderd &
wait
) ; trap 'kill $(jobs -p)' SIGINT
```
Ctrl+C will stop all three processes.
### On the PC
Decode the stream with `compressed_vipc.py`:
```cd ~/openpilot/tools/camerastream && ./compressed_vipc.py <ip>```
To actually display the stream, run `watch3` in separate terminal:
```cd ~/openpilot/selfdrive/ui/ && ./watch3```
## compressed_vipc.py usage
```
$ python compressed_vipc.py -h
usage: compressed_vipc.py [-h] [--nvidia] [--cams CAMS] [--silent] addr
Decode video streams and broadcast on VisionIPC
positional arguments:
addr Address of comma three
options:
-h, --help show this help message and exit
--nvidia Use nvidia instead of ffmpeg
--cams CAMS Cameras to decode
--silent Suppress debug output
```
## Example:
```
cd ~/openpilot/tools/camerastream && ./compressed_vipc.py comma-ffffffff --cams 0
cd ~/openpilot/selfdrive/ui/ && ./watch3
```

@ -12,6 +12,10 @@ from cereal.visionipc import VisionIpcServer, VisionStreamType
V4L2_BUF_FLAG_KEYFRAME = 8
# start encoderd
# also start cereal messaging bridge
# then run this "./compressed_vipc.py <ip>"
ENCODE_SOCKETS = {
VisionStreamType.VISION_STREAM_ROAD: "roadEncodeData",
VisionStreamType.VISION_STREAM_WIDE_ROAD: "wideRoadEncodeData",

Loading…
Cancel
Save