96SEO 2026-02-20 08:36 3
备到平台侧平台侧发calalog过来获取设备信息然后设备侧和国标平台侧维持心跳如果有位置订阅信息按照订阅时间间隔实时上报设备位置信息。

如果本地没有录像诉求或者国标平台侧不发起invite请求Android平台GB28181设备接入端不做视频编码甚至可以连摄像头都不打开等有实时录像或国标平台侧视频预览播放请求的时候再打开摄像头毕竟摄像头单纯的打开设备都有性能损耗甚至一些中低端记录仪还没编码就开始发热。
本文以大牛直播SDK的Android平台GB28181设备接入侧为例先启动GB28181启动后直接注册到国标平台侧整体设计架构图如下
{stopAudioPlayer();destoryRTPReceiver();gb_broadcast_source_id_
null;btnGB28181AudioBroadcast.setText(GB28181语音广播);btnGB28181AudioBroadcast.setEnabled(false);stopGB28181Stream();destoryRTPSender();if
{gb28181_agent_.terminateAllPlays(true);//
目前测试下来,发送BYE之后,有些服务器会立即发送INVITE,是否发送BYE根据实际情况看gb28181_agent_.stop();btnGB28181Agent.setText(启动GB28181);}else
{btnGB28181Agent.setText(停止GB28181);}}}
true;getLocation(context_);String
IPAddrUtils.getIpAddress(context_);Log.i(TAG,
GBSIPAgentFactory.getInstance().create();if
false;}gb28181_agent_.addListener(this);gb28181_agent_.addPlayListener(this);gb28181_agent_.addAudioBroadcastListener(this);gb28181_agent_.addDeviceControlListener(this);gb28181_agent_.addQueryCommandListener(this);//
必填信息gb28181_agent_.setLocalAddress(local_ip_addr);gb28181_agent_.setServerParameter(gb28181_sip_server_addr_,
gb28181_sip_domain_);gb28181_agent_.setUserInfo(gb28181_sip_username_,
gb28181_sip_password_);//gb28181_agent_.setUserInfo(gb28181_sip_username_,
可选参数gb28181_agent_.setUserAgent(gb28181_sip_user_agent_filed_);gb28181_agent_.setTransportProtocol(gb28181_sip_trans_protocol_0?UDP:TCP);//
GB28181配置gb28181_agent_.config(gb28181_reg_expired_,
gb28181_heartbeat_count_);com.gb.ntsignalling.Device
com.gb.ntsignalling.Device(34020000001380000001,
{com.gb.ntsignalling.DevicePosition
com.gb.ntsignalling.DevicePosition();device_pos.setTime(mLocationTime);device_pos.setLongitude(mLongitude);device_pos.setLatitude(mLatitude);gb_device.setPosition(device_pos);gb_device.setSupportMobilePosition(true);
设置支持移动位置上报}gb28181_agent_.addDevice(gb_device);if
(!gb28181_agent_.createSipStack())
(gb28181_agent_.bindLocalPort(i))
{gb28181_agent_.releaseSipStack();gb28181_agent_
{gb28181_agent_.unBindLocalPort();gb28181_agent_.releaseSipStack();gb28181_agent_
OK时带的时间返回上来便于Android平台GB28181设备侧做校时如有注册异常也会返回
ntsRegisterTransportError(String
(lastExceptionInfo!null?lastExceptionInfo:));//
gb28281_heart_beart_timeout);stopAudioPlayer();destoryRTPReceiver();if
null)gb28181_agent_.byeAudioBroadcast(gb_broadcast_source_id_,
gb_broadcast_target_id_);gb_broadcast_source_id_
null;btnGB28181AudioBroadcast.setText(GB28181语音广播);btnGB28181AudioBroadcast.setEnabled(false);stopGB28181Stream();destoryRTPSender();if
{gb28181_agent_.terminateAllPlays(true);Log.i(TAG,
stop);gb28181_agent_.stop();String
IPAddrUtils.getIpAddress(context_);if
local_ip_addr);gb28181_agent_.setLocalAddress(local_ip_addr);}Log.i(TAG,
start);gb28181_agent_.start();}}},0);
ntsOnDevicePositionRequest(String
{com.gb.ntsignalling.DevicePosition
com.gb.ntsignalling.DevicePosition();device_pos.setTime(mLocationTime);device_pos.setLongitude(mLongitude);device_pos.setLatitude(mLatitude);if
{gb28181_agent_.updateDevicePosition(device_id_,
先振铃响应下gb28181_agent_.respondPlayInvite(180,
device_id_);MediaSessionDescription
视频使用PS打包VectorMediaSessionDescription
session_des_.getVideoPSDescriptions();if
video_des.getPSRtpMapAttribute();break;}}}if
{gb28181_agent_.respondPlayInvite(488,
{gb28181_agent_.respondPlayInvite(488,
libPublisher.CreateRTPSender(0);if
{gb28181_agent_.respondPlayInvite(488,
device_id_);return;}gb28181_rtp_payload_type_
ps_rtpmap_attr.getPayloadType();gb28181_rtp_encoding_name_
ps_rtpmap_attr.getEncodingName();libPublisher.SetRTPSenderTransportProtocol(rtp_sender_handle,
video_des.isRTPOverUDP()?0:1);libPublisher.SetRTPSenderIPAddressType(rtp_sender_handle,
video_des.isIPv4()?0:1);libPublisher.SetRTPSenderLocalPort(rtp_sender_handle,
0);libPublisher.SetRTPSenderSSRC(rtp_sender_handle,
video_des.getSSRC());libPublisher.SetRTPSenderSocketSendBuffer(rtp_sender_handle,
设置到2MlibPublisher.SetRTPSenderClockRate(rtp_sender_handle,
ps_rtpmap_attr.getClockRate());libPublisher.SetRTPSenderDestination(rtp_sender_handle,
libPublisher.InitRTPSender(rtp_sender_handle)
{gb28181_agent_.respondPlayInvite(488,
device_id_);libPublisher.DestoryRTPSender(rtp_sender_handle);return;}int
libPublisher.GetRTPSenderLocalPort(rtp_sender_handle);if
{gb28181_agent_.respondPlayInvite(488,
device_id_);libPublisher.DestoryRTPSender(rtp_sender_handle);return;}Log.i(TAG,get
IPAddrUtils.getIpAddress(context_);MediaSessionDescription
MediaSessionDescription(video_des.getType());local_video_des.addFormat(String.valueOf(ps_rtpmap_attr.getPayloadType()));local_video_des.addRtpMapAttribute(ps_rtpmap_attr);local_video_des.setAddressType(video_des.getAddressType());local_video_des.setAddress(local_ip_addr);local_video_des.setPort(local_port);local_video_des.setTransportProtocol(video_des.getTransportProtocol());local_video_des.setSSRC(video_des.getSSRC());if
(!gb28181_agent_.respondPlayInviteOK(device_id_,local_video_des)
{libPublisher.DestoryRTPSender(rtp_sender_handle);Log.e(TAG,
failed.);return;}gb28181_rtp_sender_handle_
{InitAndSetConfig();}libPublisher.SetGB28181RTPSender(publisherHandle,
gb28181_rtp_encoding_name_);//libPublisher.SetGBTCPConnectTimeout(publisherHandle,
10*60*1000);//libPublisher.SetGBInitialTCPReconnectInterval(publisherHandle,
1000);//libPublisher.SetGBInitialTCPMaxReconnectAttempts(publisherHandle,
libPublisher.StartGB28181MediaStream(publisherHandle);if
publisherHandle;publisherHandle
0;libPublisher.SmartPublisherClose(handle);}}destoryRTPSender();Log.e(TAG,
{CheckInitAudioRecorder();}startLayerPostThread();isGB28181StreamRunning
除此之外还有语音广播和语音对讲这里不再赘述GB28181规范普及之前要想从外网远程访问局域网内的监控设备非常麻烦一般要么RTSP转RTMP推到RTMP服务器此外还要单独构建信令。
GB28181规范让远程、跨网访问监控设备更方便把GB28181平台部署到外网后前端设备只要注册到国标服务器就可以被远程访问、管理和调取视频。
但由于设备侧性能并不是非常好如果要有好的稳定性和性能要求需尽可能的减少性能消耗按需打开摄像头、按需编码等。
作为专业的SEO优化服务提供商,我们致力于通过科学、系统的搜索引擎优化策略,帮助企业在百度、Google等搜索引擎中获得更高的排名和流量。我们的服务涵盖网站结构优化、内容优化、技术SEO和链接建设等多个维度。
| 服务项目 | 基础套餐 | 标准套餐 | 高级定制 |
|---|---|---|---|
| 关键词优化数量 | 10-20个核心词 | 30-50个核心词+长尾词 | 80-150个全方位覆盖 |
| 内容优化 | 基础页面优化 | 全站内容优化+每月5篇原创 | 个性化内容策略+每月15篇原创 |
| 技术SEO | 基本技术检查 | 全面技术优化+移动适配 | 深度技术重构+性能优化 |
| 外链建设 | 每月5-10条 | 每月20-30条高质量外链 | 每月50+条多渠道外链 |
| 数据报告 | 月度基础报告 | 双周详细报告+分析 | 每周深度报告+策略调整 |
| 效果保障 | 3-6个月见效 | 2-4个月见效 | 1-3个月快速见效 |
我们的SEO优化服务遵循科学严谨的流程,确保每一步都基于数据分析和行业最佳实践:
全面检测网站技术问题、内容质量、竞争对手情况,制定个性化优化方案。
基于用户搜索意图和商业目标,制定全面的关键词矩阵和布局策略。
解决网站技术问题,优化网站结构,提升页面速度和移动端体验。
创作高质量原创内容,优化现有页面,建立内容更新机制。
获取高质量外部链接,建立品牌在线影响力,提升网站权威度。
持续监控排名、流量和转化数据,根据效果调整优化策略。
基于我们服务的客户数据统计,平均优化效果如下:
我们坚信,真正的SEO优化不仅仅是追求排名,而是通过提供优质内容、优化用户体验、建立网站权威,最终实现可持续的业务增长。我们的目标是与客户建立长期合作关系,共同成长。
Demand feedback