当前位置:网站首页>How does easyplayer RTSP configure sending heartbeat information to the server?

How does easyplayer RTSP configure sending heartbeat information to the server?

2022-06-24 06:26:00 Tsingsee green rhino video

EasyPlayer The player family already supports H265 Play of encoded video , According to the different needs of users in different scenarios , We already have EasyPlayer-RTSP、EasyPlayer- RTMP、EasyPlayerPro and EasyPlayer.js Equal Edition .

Recently, I met a customer who is using EasyPlayer-rtsp WIN Version player plays a video camera of xiongmai , About after broadcasting 30 Seconds will not flow , The player will not work properly ;

Through communication with customers , Find a situation that can be repeated , Every time I start broadcasting, I make an appointment 30 Seconds cannot be played , Or you can start broadcasting again after disconnecting 30 second , The preliminary inference should be about the survival mechanism ; Try to fix this problem with guesswork ; Everybody knows EasyPlayer-rtsp The bottom layer of the player depends on EasyRTSPClient Pull flow realized , Open the pull action interface as follows :

/* Turn on network flow */

Easy_API int Easy_APICALL EasyRTSP_OpenStream(Easy_RTSP_Handle handle, int _channelid, char *_url, EASY_RTP_CONNECT_TYPE _connType, unsigned int _mediaType, char *_username, char *_password, void *userPtr, int _reconn/*1000 Long connection , That is, if the network is disconnected, it will be automatically reconnected , Other values are the number of connections */, int outRtpPacket/* The default is 0, That is, the callback outputs the complete frame , If 1, The output RTP package */, int heartbeatType/*0x00: Do not send heartbeat 0x01:OPTIONS 0x02:GET_PARAMETER*/, int _verbosity/* Log printout level ,0 No output */);

EasyRTSPClient The design of command interaction has been defined at the beginning of design , Look at the function above heartbeatType Parameters are defined :

int heartbeatType/*0x00: Do not send heartbeat 0x01:OPTIONS 0x02:GET_PARAMETER*

When heartbeatType Pass on 1 when , Will be timed to Server Send heartbeat message ;

Encounter this kind of RTSPSERVER need Session Keep the detection mechanism alive , We need to heartbeatType Parameter value transmission 1.

But what is worth noting here is , Not all RTSPServer All done so well , For example, some of Haikang's IPC/NVR model , When RTSPClient In the process of pulling the flow , Send suddenly OPTIONS Alive message , It's like sending a piece of junk data ,RTSPServer The whole line will be automatically RTSP The connection is broken , Lead to RTP The flow taking also stops , We can only use this kind of equipment , Choose not to send OPTIONS Live bag .

原网站

版权声明
本文为[Tsingsee green rhino video]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/07/20210719185951876s.html