Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The RDKC Media Server is much more than a multi-format, multi-protocol server that delivers your media rich content across multiple screens and platforms. The RDK camera software runs on RPi-0/RPI-3 device. With this RTSP streaming we can able to play live streaming content in VLC player. This page dedicated to bringing up and validation of RMS functionality with RTSP streaming in RPI-0/RPI-3. 

...

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

Image Flash Procedure

Code Block
languagebash
titleImage Flash step
$ sudo dd if="Image Name" of="Device Name" bs=4M

Example:
sudo dd if=rdk-generic-camera-image_default_20200130060729.rootfs.rpi-sdimg of=/dev/sdb bs=4M

Validation Procedure of RMS with RTSP streaming

STEP 1:

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

network={

ssid="username"

psk="password"

}


Dunfell:

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

Validation Procedure of RMS with RTSP streaming

STEP 1:

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

network={

ssid="username"

psk="password"

}

Code Block
languagebash
titleConsole output
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
ssid="XXXX"
psk="YYYYYYYYY"
}


STEP 2:

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

dtoverlay=imx219

core_freq_min=250

Code Block
language
Code Block
languagebash
titleConsole output
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
ssid="XXXX"
psk="YYYYYYYYY"
}

STEP 2:

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 3:

Modify needed resolution in rms configuration file

Supported Resolution:

SD:

Width - 640 , Height - 480

Width - 720 , Height - 576

HD:

Width - 1280 , Height - 720

FULL HD  :

...

vi /boot/config.txt

dtoverlay=imx219
core_freq_min=250 


STEP 3:

  1. RMS with RTSP validation using v4l2

Disable dtoverlay and minimum freq configuration in config.txt file

Code Block
languagebash
titlev4l2 : Console output
vi /boot/config.txt

#dtoverlay=imx219
#core_freq_min=250 


Run mediastreamer binary with v4l2src configuration.

Code Block
languagebash
titlev4l2 : Console output
vi /lib/rdk/startMST.sh

#Run mediastreamer binary in background
# 1. To validate streaming with v4l2 need to give "mediastreamer v4l2src &"
# 2. To validate streaming with libcamera need to give "mediastreamer libcamerasrc &"
# If we change 1 and 2, need to reboot the target and validate streaming.

mediastreamer v4l2src &


        2. RMS with RTSP validation using libcamera

Enable dtoverlay and minimum freq configuration in config.txt file

Modify resolution in below configuration file

cd /usr/local/rms/bin

vi rms.conf

Code Block
languagebash
titleConsole output
RRSIP=XXX.XXX.XXX.XXX
RRSPORT=81
ROOMID=rpi0
RRSSSL=0
WIDTH=1280
HEIGHT=72

After resolution modification need to reboot the target.

Note: This step is not necessary,it is depends on your resolution validation.

STEP 4:

WiFi connection is must needed for RMS validation.

Check WiFi connection by using below command.

ifconfig

Code Block
languagebash
titlelibcamera : Console output
vi /boot/config.txt

dtoverlay=imx219
core_freq_min=250 


Run mediastreamer binary with libcamerasrc configuration.

Code Block
languagebash
titlelibcamera : Console output
vi /lib/rdk/startMST.sh

#Run mediastreamer binary in background
# 1. To validate streaming with v4l2 need to give "mediastreamer v4l2src &"
# 2. To validate streaming with libcamera need to give "mediastreamer libcamerasrc &"
# If we change 1 and 2, need to reboot the target and validate streaming.

mediastreamer libcamerasrc &


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:

Modify needed resolution in rms configuration file

Supported Resolution:

SD:

Width - 640 , Height - 480

Width - 720 , Height - 576

HD:

Width - 1280 , Height - 720

FULL HD  :

Width - 1920 , Height - 1080


Modify resolution in below configuration file

cd /usr/local/rms/bin

vi rms.conf

Code Block
languagebash
titleConsole output
RRSIP=XXX.XXX.XXX.XXX
RRSPORT=81
ROOMID=rpi0
RRSSSL=0
WIDTH=1280
HEIGHT=72

After resolution modification need to reboot the target.

Note: This step is not necessary,it is depends on your resolution validation.


STEP 6:

WiFi connection is must needed for RMS validation.

Check WiFi connection by using below command.

ifconfig

Code Block
languagebash
titleConsole output
root@raspberrypi3-rdk-camera:~# ifconfig
eth0      Link encap:Ethernet  HWaddr B8:27:EB:87:67:91  root@raspberrypi3-rdk-camera:~# ifconfig
eth0      Link encap:Ethernet  HWaddr B8:27:EB:87:67:91  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:89842 errors:0 dropped:0 overruns:0 frame:0
          TX packets:89842 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX bytespackets:25639748 (24.4 MiB)  TX bytes:25639748 (24.4 MiB)

wlan00 errors:0 dropped:0 overruns:0 frame:0
       Link encap:Ethernet  HWaddrTX B8packets:27:EB:D2:32:C4  0 errors:0 dropped:0 overruns:0 carrier:0
          inet addr:192.168.43.146  Bcast:192.168.43.255  Mask:255.255.255.0
collisions:0 txqueuelen:1000 
          RX UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link  RX packets:44 errors:0 dropped:0 overruns:0 frame:0encap:Local Loopback  
          TXinet packets:103 errors:0 dropped:0 overruns:0 carrier:0
addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK collisions:0 txqueuelen:1000 RUNNING  MTU:65536  Metric:1
          RX bytes:4484 (4.3 KiB) packets:89842 errors:0 dropped:0 overruns:0 frame:0
          TX bytespackets:10216 (9.9 KiB)

STEP 5:

check loaded module by using below command

lsmod

Code Block
languagebash
titleConsole output
root@raspberrypi3-rdk-camera:~# lsmod
Module89842 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
      Size  Used by
bcm2835_v4l2 RX bytes:25639748 (24.4 MiB)  TX bytes:25639748 (24.4 MiB)

wlan0   40563  0
v4l2_common Link encap:Ethernet  HWaddr B8:27:EB:D2:32:C4  
       4809  1 bcm2835_v4l2
videobuf2_vmalloc    inet addr:192.168.43.146  Bcast:192.168.43.255  Mask:255.255.255.0
    6264  1 bcm2835_v4l2
videobuf2_memops   UP BROADCAST RUNNING MULTICAST  1528MTU:1500  Metric:1 videobuf2_vmalloc
videobuf2_v4l2
          RX 12640  1 bcm2835_v4l2
videobuf2_corepackets:44 errors:0 dropped:0 overruns:0 frame:0
         27389 TX 2 bcm2835_v4l2,videobuf2_v4l2
videodev   packets:103 errors:0 dropped:0 overruns:0 carrier:0
           154457  4 v4l2_common,videobuf2_core,bcm2835_v4l2,videobuf2_v4l2
mediacollisions:0 txqueuelen:1000 
          RX bytes:4484 (4.3 KiB)  TX bytes:10216 (9.9 KiB)


STEP 7:

check loaded module by using below command

lsmod

Code Block
languagebash
titleConsole output
root@raspberrypi3-rdk-camera:~# lsmod
Module 23307  1 videodev
brcmfmac              258239  0
brcmutil   Size  Used by
bcm2835_v4l2          7590 40563 1 brcmfmac0
sndv4l2_bcm2835common            21405 4809 0
cfg80211 1 bcm2835_v4l2
videobuf2_vmalloc       6264  1 bcm2835_v4l2
videobuf2_memops  492836  1 brcmfmac
snd_pcm   1528  1 videobuf2_vmalloc
videobuf2_v4l2          7987212640  1 sndbcm2835_bcm2835v4l2
rfkillvideobuf2_core         27389  2 bcm2835_v4l2,videobuf2_v4l2
videodev      19936  3 cfg80211
snd_timer     154457  4 v4l2_common,videobuf2_core,bcm2835_v4l2,videobuf2_v4l2
media       20294  1 snd_pcm
snd        23307  1 videodev
brcmfmac         52949  3 snd_timer,snd_bcm2835,snd_pcm
lirc_rpi  258239  0
brcmutil            6840  0
lirc_dev  7590  1 brcmfmac
snd_bcm2835           7533 21405 1 lirc_rpi
uio_pdrv_genirq0
cfg80211          3469  0
uio  492836  1 brcmfmac
snd_pcm                870379872  1 uiosnd_pdrv_genirqbcm2835
fixedrfkill                 19936  28763  0cfg80211
sch_fq_codelsnd_timer              20294  1 snd_pcm
snd                    52949 9662  2
ipv63 snd_timer,snd_bcm2835,snd_pcm
lirc_rpi                6840  384101  18

STEP 6:

check camera device there or not by using below command

0
lirc_dev                7533  1 lirc_rpi
uio_pdrv_genirq         3469  0
uio                     8703  1 uio_pdrv_genirq
fixed                   2876  0
sch_fq_codel            9662  2
ipv6                  384101  18


STEP 8:

check camera device there or not by using below command

ls /dev/video0

Code Block
languagebash
titleConsole output
root@raspberrypi0-rdk-camera:~# ls /dev/video0 
/dev/video0


STEP 9:

Need to stop below service file to validate gstreamer based live streaming

systemctl stop rms-launcher.service

systemctl stop pipewire-launcher.service

systemctl stop mst-launcher.service


Need to do below changes in config.lua file

vi /usr/local/rms/config/config.lua

Code Block
languagebash
titleConsole output: Config.lua change
-
+	]]--
 				-- RTSP
 				{
-					ip="127.0.0.1",
+					ip="0.0.0.0",
 					port=5544,
 					protocol="inboundRtsp",
 				},
-
+	--[[


After stoping those service file, then we need to start/trigger below service and binaries.

Code Block
languagebash
titleConsole output: Trigger mediastreamer
root@raspberrypi3-rdk-camera:~# systemctl start mst-launcher


To start RMS binary , We need to go cd /usr/local/rms/bin directoryls /dev/video0

Code Block
languagebash
titleConsole output: Trigger RMS
root@raspberrypi0root@raspberrypi3-rdk-camera:~# lscd /dev/video0 
/dev/video0

STEP 7:

Check mediastreamer and rms binaries are running or not before RTSP streaming validation.

/usr/local/rms/bin/
root@raspberrypi3-rdk-camera:/usr/local/rms/bin# ./rdkcmediaserver ../config/config.lua &


Need to check mediastreamer and RMS running status with below commandps -Af | grep media

Code Block
languagebash
titleConsole output: Check status
root@raspberrypi3-rdk-camera:~# ps -Af | grep media
root      2396  197   1  1 13 1015:5730 ?        00:0400:4000 mediastreamer v4l2src
root      10072555  1613   1  3 10:57 ?   30 15:31 pts/0     00:00:01:05 ./rdkcmediaserver ../config/config.lua
root      109592574  19431613  0 1115:3231 ttyS0pts/0    00:00:00 grep media

STEP 810:

Enter into the Telnet console with telnet command

...

Code Block
languagebash
titleConsole output
listconfig
Command entered successfully!
Run-time configuration

    dash: []
    hds: []
    hls: []
    metalistener: []
    mss: []
    process: []
    pull: 
      -- 
        configId: 1
        localStreamName: stream2
        status: 
          current: 
            description: Streaming
            uniqueStreamId: 1
        uri: sercom://0
    push: []
    record: []
    webrtc: []


STEP 911:

At that same telnet console,need to give the below command for RTSP  streaming

pushStream uri=rtsp://camera_ip:5544 localStreamName=stream2

Example:

pushStream uri=rtsp://192.168.43.146:5544 localStreamName=stream2

Code Block
languagebash
titleConsole output
pushStream uri=rtsp://192.168.43.146:5544 localStreamName=stream2
Command entered successfully!
Local stream stream2 enqueued for pushing to rtsp://192.168.43.146:5544 as stream2

    configId: 4
    forceTcp: false
    keepAlive: true
    localStreamName: stream2
    targetStreamName: stream2
    targetStreamType: live
    targetUri: 
      fullUri: rtsp://192.168.43.146:5544
      port: 5544
      scheme: rtsp


STEP 1012:

On VLC player, for RTSP streaming

...

Note: VLC player available PC and RPI target should run in same network.

Limitations

  •  RMS validation with libcamera works only with SD resolution.
  • Observed 2 to 3 sec's of glitches in RMS with RTSP validation using both v4l2 and libcamera