ossrs / srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
25.57k stars 5.37k forks source link

GB28181: The SRS deployment is in the cloud. After completing the configuration of the Hikvision camera for GB28181, it shows online. However, when querying all sessions, the devices are empty. #2417

Closed oaup closed 2 years ago

oaup commented 3 years ago

Migrate to https://github.com/ossrs/srs-gb28181/issues/30

GB has been moved to a separate repository srs-gb28181, please refer to #2845. For any issues, please submit them to the GB repository bug, or pr. Make sure to maintain the markdown structure.

TRANS_BY_GPT3

zhengjieyuan commented 3 years ago

Encountered the same problem. Using the srs branch feature/gb28181. Tested with 2 camera models, both from Dahua and Hikvision. DS-2DC4420IW works fine, but DS-2DC4223IW registers successfully but the devices are empty. Thought it was a 4G transmission issue, so added the server IP to the camera's whitelist, but still unable to use it even when using an Ethernet cable.

TRANS_BY_GPT3

oaup commented 3 years ago
  1. The camera can work under a local area network.
  2. This phenomenon occurs with cloud cameras.
  3. It is also possible to use a camera from another location with GB28181 protocol on the cloud. Preliminary investigation suggests that the cloud port is correctly open and the camera protocol header is correct. The issue may be caused by the internal network preventing the camera's packets from penetrating to the external network.

------------------ Original Email ------------------ Sender: "ossrs/srs" @.>; Sent: June 18, 2021 (Friday) 1:07 PM @.>; @.**@.>; Subject: Re: [ossrs/srs] After deploying SRS in the cloud, when the GB28181 configuration of the Hikvision camera is completed, it shows online, but when querying all sessions, devices are empty. (#2417)

Encountered the same problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

TRANS_BY_GPT3

xander-os commented 3 years ago

I also encountered the same problem. My SRS is deployed in the local area network. The national standard devices can register, but when querying the session, there are sessions but no devices, and the channel cannot be seen either.

TRANS_BY_GPT3

oaup commented 3 years ago

Record the subsequent troubleshooting:

  1. It is possible that the issue was caused by not enabling the ONVIF protocol in the web management interface of the Hikvision camera under Network > Advanced Configuration > Inherit Protocol. This needs further verification. Surprisingly, after enabling ONVIF, the GB28181 streaming started working normally.
  2. After 24 hours of continuous streaming testing, it was found that the camera was still online, but the video stream (streams) in the SRS console showed no flow status. Restarting the Hikvision camera did not resolve the issue. Querying the session showed that devices were empty.
  3. The code continuously prints within a condition in the do_cycle() function. srs_trace("gb28181: 222222222222222222222222222222222 "); This log indicates that there might be an issue with a certain condition in the device here.

     if (_register_status == SrsGb28181SipSessionRegisterOk &&
                _alive_status == SrsGb28181SipSessionAliveOk)
            {
                std::list<std::string> auto_play_list;
               // srs_trace("gb28181: 1111111111111111111111111111111111 ");  
                std::map<std::string, SrsGb28181Device*>::iterator it;
                for (it = _device_list.begin(); it != _device_list.end(); it++) {
                    SrsGb28181Device *device = it->second;
                    std::string chid = it->first;
                    srs_trace("gb28181: 222222222222222222222222222222222 "); 
                    //update device invite time
                    srs_utime_t invite_duration = 0;
                    if (device->invite_time != 0){
                        invite_duration = srs_get_system_time() - device->invite_time;
                    }
            //It is possible that the camera head keeps pushing and opening, 
            //and the duration will be very large. It will take 1 day to update
            if (invite_duration > 24 * SRS_UTIME_HOURS){
                device->invite_time = srs_get_system_time();
            }
    
            if (device->invite_status == SrsGb28181SipSessionTrying &&
                invite_duration > config->sip_ack_timeout){
                device->invite_status = SrsGb28181SipSessionUnkonw;
            }
    
            if (!config->sip_auto_play) continue;
    
            //offline or already invite device does not need to send invite
            if (device->device_status != "ON" ||
                device->invite_status != SrsGb28181SipSessionUnkonw) continue;
    
            auto_play_list.push_back(chid);
        }//end for (it) 

TRANS_BY_GPT3

Cyaim commented 3 years ago

I also encountered this problem. After registration, the server occasionally does not send Invite to the device.

TRANS_BY_GPT3

qisunpeng commented 3 years ago

I initially used a certain model of Hikvision camera, which could be registered but couldn't generate a media channel. However, when I used a camera from another brand, it could be registered and automatically generate a media channel. Therefore, it was determined that the compatibility issue lies with this particular camera model.

TRANS_BY_GPT3

winlinvip commented 2 years ago

Migrate to https://github.com/ossrs/srs-gb28181/issues/30

GB has been moved to a separate repository srs-gb28181, please refer to #2845. For any issues, please submit them to the GB repository bug, or pr. Make sure to maintain the markdown structure.

TRANS_BY_GPT3