You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Current »

Introduction

This page dedicated to bringing up and validation of Continuous video recording functionality in RPI-0/RPI-3 B+. 

CVR uses Kinesis Video Streams and supporting 24/7 video recording support.Allows the feature of storing the recorded content locally or in any AWS server.

Build and Flash Procedure

Refer below link to build camera image

Morty:

RDK-C Build Instruction for RPI-0

RDK-C Build Instruction for RPI-3


Dunfell:

RDK-C rdk-next Yocto 3.1 dunfell build for Raspberrypi

AWS Account creation steps

STEP 1:

Can't able to validate without AWS account. so,Refer below link to create AWS account.

Procedure To Create AWS Account

After AWS account creation ,Refer same link to create Access key ID ,Secret Access Key and Region Name.


STEP 2:

Follow below steps to create kinese video stream or refer below link.

https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/gs-createstream.html

Video Stream creation step
1.Sign in to the AWS Management Console and open the Kinesis console at https://ap-south-1.console.aws.amazon.com/console/home?region=ap-south-1#
2.On the Video streams page, choose Create video stream.
3.On the Create a new video stream page, type ExampleStream for the stream name. Leave the Default configuration radio button selected.
4.Choose Create video stream.
5.After Kinesis Video Streams creates the stream, review the details on the ExampleStream page.

CVR Validation Procedure

STEP 1:

Add require SSID and PSK in /etc/wpa_supplicant.conf file in below format

network={

ssid="username"

psk="password"

}

Console output
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
ssid="RDK"
psk="Comcast1"
}


STEP 2:

This step only needed for Libcamera validation

Add  below configuration in end of the /boot/config.txt file

dtoverlay=imx219

core_freq_min=250

Console output
vi /boot/config.txt

dtoverlay=imx219
core_freq_min=250 


STEP 3:

  1. CVR validation using v4l2 & Pipewire

If the below configuration there in config.txt file then please disable for this v4l2 and pipewire validation

v4l2 : Console output
vi /boot/config.txt

#dtoverlay=imx219
#core_freq_min=250 


        2. CVR validation using libcamera

Enable dtoverlay and minimum freq configuration in config.txt file

libcamera : Console output
vi /boot/config.txt

dtoverlay=imx219
core_freq_min=250 


STEP 4:

Reboot the Target

After Reboot don't do step 1 and 2.

Note : Step 1 & 2 is only applicable for fresh target boot-up with new image.


STEP 5:

WiFi connection is must needed for CVR-AWS validation.

Check WiFi connection by using below command.

ifconfig

Console output
root@raspberrypi0-rdk-camera:~# ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:87 errors:0 dropped:0 overruns:0 frame:0
          TX packets:87 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4552 (4.4 KiB)  TX bytes:4552 (4.4 KiB)

wlan0     Link encap:Ethernet  HWaddr B8:27:EB:2E:72:2B  
          inet addr:192.168.43.246  Bcast:192.168.43.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:23 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2893 (2.8 KiB)  TX bytes:5887 (5.7 KiB)


STEP 6:

Export Created Stream Name,Access key id, Secret access key and Region name in RPI target.

export STREAM_NAME="samplestream"

export ACCESS_KEY="XXXXXXXXXXXXXX"

export SECRET_KEY="yyyyyyyyyyyyyyyyyyyyyyyy"

export AWS_DEFAULT_REGION="eu-west-1"

Console output
root@raspberrypi0-rdk-camera:~# export STREAM_NAME="Samplestream"
root@raspberrypi0-rdk-camera:~# export ACCESS_KEY="XXXXXXXXXXXXX"
root@raspberrypi0-rdk-camera:~# export SECRET_KEY="yyyyyyyyyyyyyyyyyyyyyyyyy"
root@raspberrypi0-rdk-camera:~# export AWS_DEFAULT_REGION="eu-west-1"


STEP 7:

Check exported Access key id,Secret access key,Stream name and Region name by using below command.

printenv

Console output
root@raspberrypi0-rdk-camera:~# printenv
PLAYERSINKBIN_USE_WESTEROSSINK=1
WAYLAND_DISPLAY=wayland-0
SHELL=/bin/sh
TERM=xterm
LD_PRELOAD=/usr/lib/libopenmaxil.so:/usr/lib/libwayland-client.so.0
HUSHLOGIN=FALSE
USER=root
SYSTEMD_PAGER=/bin/cat
ACCESS_KEY=XXXXXXXXXXXXXX
STREAM_NAME=samplestream
MAIL=/var/spool/mail/root
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
AWS_DEFAULT_REGION=eu-west-1
SECRET_KEY=yyyyyyyyyyyyyyyyyyyyyyyy
PWD=/home/root
EDITOR=vi
PS1=\u@\h:\w\$ 
SHLVL=1
HOME=/home/root
LOGNAME=root
XDG_RUNTIME_DIR=/run
_=/usr/bin/printenv


STEP 8:

Before triggering CVR binary we should stop rms binary and mediastreamer binary with below command because currently we can't able to validate RMS and CVR feature at the same time.

systemctl stop rms-launcher

systemctl stop mst-launcher


STEP 9:

Preload the below library files for omxh264enc plugin.

export LD_PRELOAD=/usr/lib/libwayland-client.so.0:/usr/lib/libwayland-egl.so:/usr/lib/libopenmaxil.so


STEP 10:

Before start the CVR binary please check the current date and time in RPI with "date" command, If you get wrong date and time please manually set current date and time with the below command.

date -s "Mon Nov 30 03:42:44 UTC 2020"

Console output
root@raspberrypi3-rdk-camera:~# date -s "Mon Nov 30 03:42:44 UTC 2020"
Mon Nov 30 03:42:44 UTC 2020
root@raspberrypi3-rdk-camera:~# date
Mon Nov 30 03:43:55 UTC 2020


STEP 11:

Run cvr-gst-rpi binary with v4l2src/libcamerasrc configuration to transmit data into AWS server.

  1. CVR validation using v4l2
v4l2:Console output
root@raspberrypi0-rdk-camera:~# cvr-gst-rpi v4l2src
Conf file /etc/debug.ini open success
rdk_logger_init /etc/debug.ini Already Stack Level Logging processed... not processing again.
200430-10:37:21.578891 [mod=GSTREAMER, lvl=DEBUG] [tid=7305] /usr/src/debug/cvr/git-r0/git/cvr-gst-rpi/cvr_gst_rpi.c(176):Element linking succes
s for pipelin


         2. CVR validation using libcamera

libcamera:Console output
root@raspberrypi0-rdk-camera:~# cvr-gst-rpi libcamerasrc
Conf file /etc/debug.ini open success
rdk_logger_init /etc/debug.ini Already Stack Level Logging processed... not processing again.
200430-10:37:21.578891 [mod=GSTREAMER, lvl=DEBUG] [tid=7305] /usr/src/debug/cvr/git-r0/git/cvr-gst-rpi/cvr_gst_rpi.c(176):Element linking succes
s for pipelin


         3. CVR validation using Pipewire

pipewire:Console output
root@raspberrypi3-rdk-camera:~# pipewire &
[1] 1293
root@raspberrypi3-rdk-camera:~# [W][000000041.142031][module-rtkit.c:185 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][000000041.142413][module-rtkit.c:519 set_nice()] could not set nice-level to -11: No such file or directory
[W][000000041.144184][module-rtkit.c:185 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][000000041.145666][module-rtkit.c:185 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][000000041.147096][module-rtkit.c:185 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][000000041.147259][module-rtkit.c:506 idle_func()] could not make thread realtime: No such file or directory
[E][000000041.171692][dbus.c:319 impl_get_connection()] Failed to connect to system bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
[E][000000041.171900][module-portal.c:304 pipewire__module_init()] Failed to connect to system bus: Connection refused
pipewire-media-session:Console output
root@raspberrypi3-rdk-camera:~# pipewire-media-session &
[2] 2146
root@raspberrypi3-rdk-camera:~# [W][000000107.473341][module-rtkit.c:185 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][000000107.473707][module-rtkit.c:519 set_nice()] could not set nice-level to -11: No such file or directory
[W][000000107.475498][module-rtkit.c:185 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][000000107.477043][module-rtkit.c:185 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][000000107.478619][module-rtkit.c:185 translate_error()] RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
[W][000000107.478785][module-rtkit.c:506 idle_func()] could not make thread realtime: No such file or directory
[E][000000107.480804][dbus.c:319 impl_get_connection()] Failed to connect to system bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
[W][000000107.480985][media-session.c:2464 main()] no dbus connection
[W][000000107.482123][access-portal.c:605 sm_access_portal_start()] no dbus connection, portal access disabled
[W][000000107.487444][alsa-monitor.c:1056 sm_alsa_monitor_start()] no dbus connection, device reservation disabled
pipewiresrc:Console output
root@raspberrypi0-rdk-camera:~# cvr-gst-rpi pipewiresrc
Conf file /etc/debug.ini open success
rdk_logger_init /etc/debug.ini Already Stack Level Logging processed... not processing again.
200430-10:37:21.578891 [mod=GSTREAMER, lvl=DEBUG] [tid=7305] /usr/src/debug/cvr/git-r0/git/cvr-gst-rpi/cvr_gst_rpi.c(176):Element linking succes
s for pipelin


STEP 12:

Enter into AWS account and select the corresponding video stream service which was we created for streaming.

Press "Media Playback" option on the video stream player.

Streaming video content should decode properly on AWS.

Limitations

     CVR Support in AWS cloud through gstreamer kvs sink.

     CVR validation with libcamera works only with SD resolution.

  • No labels