> For the complete documentation index, see [llms.txt](https://german-m-garcia.gitbook.io/mk-ros/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://german-m-garcia.gitbook.io/mk-ros/software/streaming-on-board.md).

# Streaming on board

```
sudo apt-get install vainfo
```

Next, will checkout the FFmpeg repository:

```
git clone git@github.com:FFmpeg/FFmpeg.git
```

Now we will configure and compile it with vaapi support. We will install it in /opt/ffmpeg so that it doesn't eventually conflict with the Ubuntu ffmpeg package:

```
PKG_CONFIG_PATH="/opt/ffmpeg/lib/pkgconfig" ./configure --enable-shared --prefix=/opt/ffmpeg --enable-vaapi --enable-gpl
PATH="/opt/ffmpeg/:$PATH" make -j$(nproc) 
sudo make install
```

Update the LD\_*LIBRARY\_PATH* before compiling *nimbro\_cam\_transport* so that it finds the libraries. Add it to your .bashrc file:

```
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ffmpeg/lib
```

### Testing the vaapi encoding

Run the node of your realsense camera and the camera encoder:

```
roslaunch realsense2_camera rs_camera.launch
roscd nimbro_cam_transport
cd launch
roslaunch vaapisender.launch
```

You can monitor the actual usage of the graphics card by running *sudo intel-gpu-top* :

```
~$ intel-gpu-top 
  - ----/ 107 MHz;   87% RC6; ----- (null);      244 irqs/s

      IMC reads:   ------ (null)/s
     IMC writes:   ------ (null)/s

          ENGINE      BUSY                                                                                                                                                                                                                                                MI_SEMA MI_WAIT
     Render/3D/0    5.32% |████████████▌                                                                                                                                                                                                                                |      0%      0%
       Blitter/0    0.00% |                                                                                                                                                                                                                                             |      0%      0%
         Video/0    4.21% |█████████▉                                                                                                                                                                                                                                   |      0%      0%
  VideoEnhance/0    0.00% | 
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://german-m-garcia.gitbook.io/mk-ros/software/streaming-on-board.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
