This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
projects:farmrobot:steuerungs-kamera [2021/02/26 11:34] nicolas-leon created |
projects:farmrobot:steuerungs-kamera [2021/03/14 17:51] jonas [Authors] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== FPV Camera ===== | + | ====== FPV Camera |
The FPV Camera serves a video stream as the first person view (FPV) of the Robot. This makes it possible to see the position of the Robot and anything in its way. | The FPV Camera serves a video stream as the first person view (FPV) of the Robot. This makes it possible to see the position of the Robot and anything in its way. | ||
- | ==== Hardware ==== | + | ===== Hardware |
- | A 3d Printed mount for the bosh40x40 | + | A 3d Printed mount for the Bosch40x40 |
- | [picture of 40x40 clip and camera case] | + | {{: |
- | ==== Software ==== | + | [picture of 40x40 clip with pole and camera case(n/a)] |
+ | The following hardware is used for capturing and broadcasting the video stream: | ||
+ | * Raspberry Pi 4B (8GB) by element14 | ||
+ | * element14 Raspberry Pi CSI camera v.2 NoIR | ||
+ | * USB-C cable | ||
+ | * Heatsinks | ||
+ | * Fan | ||
+ | * Case | ||
+ | * SD-Card | ||
+ | ===== Software ===== | ||
+ | |||
+ | The SD-Card has been flashed with an Ubuntu 20.10 arm64-raspi OS. | ||
+ | The Pi is configured with the following user: | ||
+ | * user name: pi | ||
+ | * password: farmrobot | ||
+ | |||
+ | Its connectable via ethernet or build in wifi module. | ||
+ | |||
+ | An initial update has been run: | ||
+ | |||
+ | '' | ||
+ | |||
+ | Also some config changes have been made: | ||
+ | |||
+ | '' | ||
+ | |||
+ | ==== Setup ==== | ||
+ | |||
+ | sudo apt install v4l-utils | ||
+ | sudo apt install ffmpeg | ||
+ | sudo apt install openssh-server sudo ufw allow ssh ssh pi@farmrobot | ||
+ | | ||
+ | === ffmpeg stream === | ||
+ | Bash script '' | ||
+ | ffmpeg -f v4l2 -input_format h264 -video_size 852x480 -framerate 5 -i / | ||
+ | -c:v h264 -preset veryfast -b:v 500k -maxrate 500k -bufsize 10k \ | ||
+ | -pix_fmt yuv420p -g 10 \ | ||
+ | -f flv " | ||
+ | |||
+ | |||
+ | ==== Optional v4l2m2m encoder on arm 64 bit OS ==== | ||
+ | |||
+ | Using v4l2m2m encoder to have arm64 hardware support to efficiently encode a efficient h.265 stream which is sent via rtmp to a server which reencodes to hls to view video stream in a browser. | ||
+ | |||
+ | Building ffmpeg from source for the newest release and support for v4l_m2m hardware encoding on 64 bit arm. | ||
+ | |||
+ | '' | ||
+ | |||
+ | (installing to / | ||
+ | |||
+ | According to [[https:// | ||
+ | |||
+ | sudo apt-get update -qq && sudo apt-get -y install \ | ||
+ | autoconf \ | ||
+ | automake \ | ||
+ | build-essential \ | ||
+ | cmake \ | ||
+ | git-core \ | ||
+ | libass-dev \ | ||
+ | libfreetype6-dev \ | ||
+ | libgnutls28-dev \ | ||
+ | libsdl2-dev \ | ||
+ | libtool \ | ||
+ | libva-dev \ | ||
+ | libvdpau-dev \ | ||
+ | libvorbis-dev \ | ||
+ | libxcb1-dev \ | ||
+ | libxcb-shm0-dev \ | ||
+ | libxcb-xfixes0-dev \ | ||
+ | meson \ | ||
+ | ninja-build \ | ||
+ | pkg-config \ | ||
+ | texinfo \ | ||
+ | wget \ | ||
+ | yasm \ | ||
+ | zlib1g-dev \ | ||
+ | libunistring-dev | ||
+ | | ||
+ | installing libaries, chosing wich are needed: | ||
+ | | ||
+ | NASM (An assembler used by some libraries.) | ||
+ | | ||
+ | cd ~/ | ||
+ | wget https:// | ||
+ | tar xjvf nasm-2.15.05.tar.bz2 && | ||
+ | cd nasm-2.15.05 && | ||
+ | ./ | ||
+ | PATH=" | ||
+ | make -j 4 && | ||
+ | make install | ||
+ | |||
+ | libx264 (H.264 video encoder, fallback) | ||
+ | | ||
+ | cd ~/ | ||
+ | git -C x264 pull 2> /dev/null || git clone --depth 1 https:// | ||
+ | cd x264 && | ||
+ | PATH=" | ||
+ | PATH=" | ||
+ | make install | ||
+ | |||
+ | libx265 (H.265/HEVC video encoder) | ||
+ | |||
+ | sudo apt-get install libnuma-dev && | ||
+ | cd ~/ | ||
+ | git -C x265_git pull 2> /dev/null || git clone https:// | ||
+ | cd x265_git/ | ||
+ | PATH=" | ||
+ | PATH=" | ||
+ | make install | ||
+ | |||
+ | libvpx (VP8/VP9 video encoder/ | ||
+ | | ||
+ | cd ~/ | ||
+ | git -C libvpx pull 2> /dev/null || git clone --depth 1 https:// | ||
+ | cd libvpx && | ||
+ | PATH=" | ||
+ | PATH=" | ||
+ | make install | ||
+ | |||
+ | libaom (AV1 video encoder/ | ||
+ | |||
+ | cd ~/ | ||
+ | git -C aom pull 2> /dev/null || git clone --depth 1 https:// | ||
+ | mkdir -p aom_build && | ||
+ | cd aom_build && | ||
+ | PATH=" | ||
+ | PATH=" | ||
+ | make install | ||
+ | |||
+ | libsvtav (AV1 video encoder/ | ||
+ | |||
+ | cd ~/ | ||
+ | git -C SVT-AV1 pull 2> /dev/null || git clone https:// | ||
+ | mkdir -p SVT-AV1/ | ||
+ | cd SVT-AV1/ | ||
+ | PATH=" | ||
+ | PATH=" | ||
+ | make install | ||
+ | |||
+ | libdav1d (AV1 decoder, much faster than the one provided by libaom Users whose distributions don't provide a recent enough version of meson (0.49.0 or newer) will need to install a more up-to-date version. This is easily done via the Python Package Index: | ||
+ | '' | ||
+ | |||
+ | cd ~/ | ||
+ | git -C dav1d pull 2> /dev/null || git clone --depth 1 https:// | ||
+ | mkdir -p dav1d/build && | ||
+ | cd dav1d/build && | ||
+ | meson setup -Denable_tools=false -Denable_tests=false --default-library=static .. --prefix " | ||
+ | ninja && | ||
+ | ninja install | ||
+ | |||
+ | Audio libaries are probably needed for building, especially libfdk_aac for vpx libfdk-aac (AAC audio encoder) | ||
+ | |||
+ | cd ~/ | ||
+ | git -C fdk-aac pull 2> /dev/null || git clone --depth 1 https:// | ||
+ | cd fdk-aac && | ||
+ | autoreconf -fiv && ./configure --prefix=" | ||
+ | make -j 4 && | ||
+ | make install | ||
+ | |||
+ | libmp3lame libopus | ||
+ | |||
+ | Building FFmpeg | ||
+ | |||
+ | cd ~/ | ||
+ | wget -O ffmpeg-snapshot.tar.bz2 https:// | ||
+ | tar xjvf ffmpeg-snapshot.tar.bz2 && | ||
+ | cd ffmpeg && | ||
+ | PATH=" | ||
+ | --prefix=" | ||
+ | --pkg-config-flags=" | ||
+ | --extra-cflags=" | ||
+ | --extra-ldflags=" | ||
+ | --extra-libs=" | ||
+ | --bindir=" | ||
+ | --enable-gpl | ||
+ | --arch=aarch64 | ||
+ | --enable-gnutls | ||
+ | --enable-libaom | ||
+ | --enable-libsvtav1 | ||
+ | --enable-libdav1d | ||
+ | --enable-libvpx | ||
+ | --enable-libx264 | ||
+ | --enable-libx265 | ||
+ | --enable-nonfree && | ||
+ | PATH=" | ||
+ | make install && | ||
+ | hash -r | ||
+ | | ||
+ | source ~/.profile | ||
+ | |||
+ | ===== Authors ===== | ||
+ | * Jonas Geßmann, Environment & Energy, jonas.gessmann@protonmail.com \\ | ||
+ | * Nicolas Wiehe |