Documentation B101 15p - Google Groups

5 downloads 4 Views 533KB Size Report
Courier. Used to indicate commands, commands parameters, code examples, and file and directory names. ... For Mac OS X:
Version 1.0


 B101 HDMI to CSI-2 Bridge (15 p) January 2016

Auvidea GmbH

Raspberry Pi

1

Version 1.0 Paragraph Number

Content

Page

Chapter 1 About this guide 1.1

Overview

3

1.2

Converntions

3

1.3

Requirement

3 Chapter 2 Image

2.1

Image

4

2.2

Writing image on SD card

4

Chapter 3 Raspberry Pi 3.1

Raspi-Config

6

3.2

FFmpeg

6

3.3

UDP Stream and recording

7

3.4

PyCA — Matterhorn Capture Agent

8

Chapter 4 Opencast Matterhorn 4.1

Auvidea GmbH

Opencast Matterhorn

Raspberry Pi

9

2

Version 1.0

Chapter 1 About this guide 1.1 Overview This book is written for users having minimum experience with the Linux operating system. It provides information in handing with Raspberry Pi, B100 and FFmpeg. At evasion from documentation, you do it at own risk. We do not bear any damage liability, caused as a result of your actions.

1.2 Conventions This document is uses the following notational conventions Courier Used to indicate commands, commands parameters, code examples, and file and directory names.

1.3 Requirement

- Raspberry Pi - B100 Board from Auvidea GmbH. You can buy it on our official webpage http:// www.auvidea.eu/index.php/theme-styles/2014-12-30-22-32-06/b101. At present we work over the second version of this product where you any more will not need Raspberry Pi

- micro SD card 4G or larger. Formatted in FAT32.


Auvidea GmbH

Raspberry Pi

3

Version 1.0

Chapter 2 Image 2.1 Image During writing of this documentation, we used Linux Rapsberry Jessie Lite 4.1.13-v7+ version, which was released on 2015-11-21. First you need to download an official image from https://www.raspberrypi.org/downloads/raspbian/.

2.2 Writing image on SD card With the image file of of your choice, you need to use an image writing tool to install it on your SD card. For every system it’s different. For Linux: Please note that the use of the dd tool can overwrite any partition of your machine. If you specify the wrong device in the instructions below you could delete your primary Linux partition. Please be careful. First run df in terminal to see what device is currently mounted. Remember, the shown devices can significantly will cause a stir from used by you.

The left column gives the device name of you mounted SD card. For us it’s /dev/sdb1. The last part is the partition number, but we want to write whole SD card. First run sudo umount /dev/sdb1 to unmount the partition. Remember you can have a different number of partition.

Auvidea GmbH

Raspberry Pi

4

Version 1.0 Next in terminal write image with command below. Do not forget to replace if= with the name of downloaded image and b1 with you partition of SD card. dd bs=4M if=path_of_your_image.img of=/dev/sdb1 Wait till the image is successful written on you SD card. Unmount SD card an insert it in your RPi. For Windows: Download Win32DiskImager http://sourceforge.net/projects/win32diskimager/. Extract it for example on you desktop and run the executable as administrator.

Select you device, downloaded image file and press „Write“. Wait till the image is successful written on you SD card. Unmount SD card an insert it in you RPi. For Mac OS X: From the Apple menu, choose About This Mac, then click on More info...; if you are using Mac OS X 10.8.x Mountain Lion or newer then click on System Report. Click on USB (or Card Reader if using a built-in SD card reader) then search for your SD card in the upper right section of the window. Click on it, then search for the BSD name in the lower right section; it will look something like 'diskn' where n is a number (for example, disk4). Make sure you take a note of this number. Open terminal and type sudo dd bs=1m if=path_of_your_image.img of=/dev/diskn Remember to replace n with the number you note before and replace the name of you downloaded image. Wait till the image is successful written on you SD card. Unmount SD card an insert it in you RPi.

Auvidea GmbH

Raspberry Pi

5

Version 1.0

Charter 3 Raspberry Pi 3.1 Raspi-Config Raspberry Pi is included a lot of settings for advanced users. You can found more information on official webpage https://www.raspberrypi.org/documentation/configuration/ raspi-config.md. For our use we need the camera module. Start the „Raspberry Pi Software Configuration Tool“ with sudo raspi-config from terminal. Now we need to enable camera module.

Choose the option „Enable Camera“ and hit Enter key. Now choose „Enable“ and hit Enter key again. Exit this configuration tool and reboot you Raspberry Pi. Now camera module is activated, you can test it type raspivid -p in terminal. We’ll use this for our B100 board.

3.2 FFmpeg Now we need to install FFmpeg. Open terminal and run commands below. Installing H.264 support cd /usr/src sudo git clone git://git.videolan.org/x264 cd x264 sudo ./configure --host=arm-unknown-linux-gnueabi —enable-static --disable-opencl sudo make -j4 sudo make install If you need another libraries/formats you should do it now, before compiling FFmpeg.

Auvidea GmbH

Raspberry Pi

6

Version 1.0 Installing FFmpeg cd /usr/src sudo git clone git://source.ffmpeg.org/ffmpeg.git cd ffmpeg sudo ./configure --arch=armel --target-os=linux --enable-gpl -enable-libx264 --enable-nonfree sudo make -j4 sudo make install The compilation of FFmpeg will take long time, be patient. When the compilation and installation is done, test FFmpeg, just run the command ffmpeg in you terminal.

3.3 UDP Stream and recording After installing FFmpeg you can start for example permanently UDP stream with command below and watch it in for example in VLC Player, use udp:// 239.239.2.1:1234 . raspivid -t 0 -fps 25 -hf -b 2000000 -o - | ffmpeg -i - -vcodec copy -an -r 30 -g 30 -bufsize 2000000 -pix_fmt yuv420p -f mpegts udp://@239.239.2.1:1234 After UDP stream is successful started, you will receive information for example like on picture below.

Auvidea GmbH

Raspberry Pi

7

Version 1.0 While UDP stream is started, you can record video. For example to record a .mp4 video ffmpeg -i udp://@239.239.2.1:1234 -vcodec copy -an -r 25 -t time_in_seconds -pix_fmt yuv420p -f mp4 path_for_save_video.mp4 Remember to edit time_in_seconds and path_for_save_video.mp4 as it is necessary for you. Note you can edit FFmpeg configuration of stream and recording.

3.4 PyCA – Matterhorn Capture Agent Installation git clone https://github.com/lkiesow/pyCA.git cd pyCA sudo apt-get install python-virtualenv python-dev libcurl4-gnutlsdev virtualenv venv . ./venv/bin/activate pip install icalendar python-dateutil pycurl configobj nano etc/pyca.conf