Setting up a VideoCoin Worker on RaspberryPi

Raspberry Pi is equipped with H.264 HW Codec that supports up to Full HD either 30fps. We will show you how to run a VideoCoin Worker on Raspberry Pi that used HW Codec

Setup

VideoCoin workers can be run with different Raspberry PI supported OS options, where hardware accelerated H264 encoding is supported through ffmpeg. Running with a Ubuntu 18.04 armhf version is recommended where all the system resources can be allocated to transcoding. It can also run on Raspbian versions where memory can be split and allocate maximum memory for the system and minimum required for GPU.

Option-1: Ubuntu 18.04

Download Ubuntu 18.04 armhf from the following site and flash the microsd card:

https://wiki.ubuntu.com/ARM/RaspberryPi
Install the following repos as specified in “Optional PPAs” section
sudo add-apt-repository ppa:ubuntu-raspi2/ppa

sudo apt-get update

Install the following repos as specified in “VideoCore” section

sudo apt-get install libraspberrypi-bin libraspberrypi-dev

sudo ln -s /usr /opt/vc

Option-2: Raspberry Pi OS(Raspbian) Lite

Use the Raspberry Pi OS Lite.

It will come preinstalled with VideoCore libraries.

Download and setup Ffmpeg for Raspberry Pi

Compile ffmpeg with H264 Hardware encoder

sudo apt-get update

sudo apt-get install build-essential

sudo apt-get install libomxil-bellagio-dev -y

git clone https://github.com/FFmpeg/FFmpeg.git

cd FFmpeg

sudo ./configure --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree

sudo make -j4

sudo make install

Test h264 HW Encoder is active

ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 -c:v h264_omx test.mp4

Starting the worker

Download the binary “worker-linux-arm” from the link to Raspberry Pi

Use the following command to start the worker in a terminal window

/worker-linux-arm64 start -k \<worker key file> -s \<password> -c \<client-id>

<worker key file> : Worker wallet file in UTC/JSON format. This wallet should be self staked

before using it with the worker.

<password>: Password for the <worker key file>.

<client-id>: Client ID created for the worker using VideoCoin Console( worker page )

Example:

./worker-linux-arm start -k worker_key.json -s test123 -c 26cfe429-4479-4c5c-b988-d7c82991cd75

When the worker is running, you should see the messages something as follows:

Please note that you can use a utility such as systemd or start-stop-daemon to run the worker as a background process:

http://manpages.ubuntu.com/manpages/trusty/man8/start-stop-daemon.8.html

http://manpages.ubuntu.com/manpages/xenial/man1/systemctl.1.html

I purchased a Raspberry Pi 4B with 8GB of Ram. Do i need to get an external hard drive for optimal performance? Also what size do you recommend? Thanks.

The Raspberry Pi itself is good to go. Work on the network does not use hard drive resources.

Thank you for the quick response! Im guessing the 8GB version is better than the other Raspberry Pi 4B’s variants?

I’d get the 8gb version, although both would work.

My board would not let me run Ubuntu 18.04 so I installed 20.04 and that worked. But now I can’t install the Optional PPAs, what should I do? Thanks.

@CSColl
You can run the worker on Raspberry Pi OS also. Ubuntu 18.04 is not a must. It is recommended so that more system memory is is available for transcoding in low RAM configurations. You can try on Raspberry Pi OS. If you see any memory related issues while running ffmpeg, reduce the gpu_mem. Look at the following document for description of the memory option configuration.

https://www.raspberrypi.org/documentation/configuration/config-txt/memory.md

Hello.
Working on raspberrypi4 + ubuntu18.04 64bit os,
I got an error while compiling process which is that
sudo ./configure --enable ~~~.

ERROR: OpenMAX IL headers from raspberrypi/firmware not found

is there any answer?

@Chan_Phil_Jeong
Use “Ubuntu 18.04 armhf” version instead of 64bit os.

thank you …
and I am working on jetson-nano right now.
I will try to set up raspberrypi 4 later again, it’s so tough for newbee…