查看: 535|回复: 0

[RTMP] 树莓派4B 使用Onenet 视频能力(下)

[复制链接]

1

主题

9

帖子

26

积分

新手上路

Rank: 1

积分
26
发表于 2021-10-17 14:07:24 | 显示全部楼层 |阅读模式
本帖最后由 QXPY5UCLYI 于 2021-10-17 14:17 编辑

四、创建Onenet视频服务并部署1.创建Onenet视频服务
我们打开Onenet视频服务平台,添加产品即可:
2.部署到树莓派
首先我们先启动RPOS服务,可以看到服务启动在http://192.168.31.196:8081/onvif/device_service
pi@raspberrypi:~/Desktop/rpos $ sudo node rpos.js
Read IP address 192.168.31.196 from wlan0
Manufacturer : Raspberry Pi
Model : 4 B
HardwareId :
SerialNumber : 100000007458e142
FirmwareVersion : 2.1.0
Starting camera settings webserver on http://192.168.31.196:8081/
unknown control 'h264_profile'
Could not retrieve Controlvalue 'red_balance'
Could not retrieve Controlvalue 'blue_balance'
Could not retrieve Controlvalue 'horizontal_flip'
Could not retrieve Controlvalue 'vertical_flip'
Could not retrieve Controlvalue 'color_effects'
Could not retrieve Controlvalue 'rotate'
Could not retrieve Controlvalue 'color_effects_cbcr'
Could not retrieve Controlvalue 'video_bitrate_mode'
Could not retrieve Controlvalue 'video_bitrate'
Could not retrieve Controlvalue 'repeat_sequence_header'
Could not retrieve Controlvalue 'h264_i_frame_period'
Could not retrieve Controlvalue 'h264_level'
Could not retrieve Controlvalue 'h264_profile'
Could not retrieve Controlvalue 'auto_exposure'
Could not retrieve Controlvalue 'exposure_time_absolute'
Could not retrieve Controlvalue 'exposure_dynamic_framerate'
Could not retrieve Controlvalue 'auto_exposure_bias'
Could not retrieve Controlvalue 'white_balance_auto_preset'
Could not retrieve Controlvalue 'image_stabilization'
Could not retrieve Controlvalue 'iso_sensitivity'
Could not retrieve Controlvalue 'exposure_metering_mode'
Could not retrieve Controlvalue 'scene_mode'
Could not retrieve Controlvalue 'compression_quality'
Binding DeviceService to http://192.168.31.196:8081/onvif/device_service
Binding MediaService to http://192.168.31.196:8081/onvif/media_service
Binding PTZService to http://192.168.31.196:8081/onvif/ptz_service
Binding ImagingService to http://192.168.31.196:8081/onvif/imaging_service
discovery_service started
Starting Live555 rtsp server
media_service started
ptz_service started
device_service started
imaging_service started
rtspServer: INFO:root:StreamServer initialized


rtspServer: INFO:root:Video settings loaded from v4l2ctl.json


rtspServer: DEBUG:root:StreamServer.launch
INFO:root:USB camera ignored most of the parameters
DEBUG:root v4l2src device=/dev/video0 brightness=0 contrast=32 saturation=64 ! image/jpeg,width=640,height=480,framerate=25/1 ! jpegdec ! clockoverlay ! omxh264enc target-bitrate=10000000 control-rate=variable ! video/x-h264,profile=baseline ! h264parse ! rtph264pay name=pay0 pt=96 )


rtspServer: INFO:root:Starting service on port 8554 at url /h264


rtspServer: INFO:root:Running RTSP Server
接着我们配置Onenet服务:打开Onenet_sdk,进入bin文件,进行如下配置:
{
    "profile":{
                "productid":45xx26,  # 产品ID 需删除注释
                "deviceid":xx,  # 设备ID,未用 需删除注释
                "pass":"VUHPxxxxjt1k", # "设备注册码" 需删除注释
                "id":"xxx"  # "设备标识" 需删除注释
    },
   
    "onvif":
    [
        {
                "title":"Channl1",
                "channel_id":1,
                "url": "http://192.168.31.196:8081/onvif/device_service",
                "user": "admin",
                "passwd": "admin",
                "desc":"Machine 1",
                "defaultlevel": 1
        }
    ],
   
    "rvod":
    [
        {
           "channel_id":1,
           "location":"./test1.mp4",
           "beginTime":"2010-12-08 00:00:00",
           "endTime":"2010-12-08 00:22:59",
           "videoTitle":"title1"
        }
    ]
}


先给文件加可执行权限,然后启动Onenet服务:
pi@raspberrypi:~/Desktop/video_sdk/bin $ sudo chmod +x sample_video_s
pi@raspberrypi:~/Desktop/video_sdk/bin $ ./sample_video_s
INFO: [info]:url=http://192.168.31.196:8081/onvif/device_service has profiles-------------------------------------------------------:

INFO: profile [0: level=1 bitrate=10000 framterate=25]

no this level 4
no this level 3
no this level 2
8554INFO: ip 47.106.46.251 port 9201 token
INFO: 3c 82 11 8b f2 c7 39 7a 90 64 6a 76 04 c4 20 81
INFO: 70 9d a4 3a 17 a6 7d ff 82 a7 d9 01 e3 3f 73 8d
INFO: get dev id 769789491


最后在Onenet视频服务界面中播放实时视频即可:
五、参考资料


回复

举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表