[go: up one dir, main page]

CN108259815B - Video key frame forwarding method, device and live video system - Google Patents

Video key frame forwarding method, device and live video system Download PDF

Info

Publication number
CN108259815B
CN108259815B CN201810229537.3A CN201810229537A CN108259815B CN 108259815 B CN108259815 B CN 108259815B CN 201810229537 A CN201810229537 A CN 201810229537A CN 108259815 B CN108259815 B CN 108259815B
Authority
CN
China
Prior art keywords
video
forwarding
key frame
source terminal
video source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810229537.3A
Other languages
Chinese (zh)
Other versions
CN108259815A (en
Inventor
田建超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shizhen Information Technology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shizhen Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shizhen Information Technology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201810229537.3A priority Critical patent/CN108259815B/en
Publication of CN108259815A publication Critical patent/CN108259815A/en
Application granted granted Critical
Publication of CN108259815B publication Critical patent/CN108259815B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/15Conference systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26208Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists the scheduling operation being performed under constraints
    • H04N21/26216Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists the scheduling operation being performed under constraints involving the channel capacity, e.g. network bandwidth

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本发明涉及一种视频关键帧转发方法、装置和视频直播系统,其中方法包括:获取转发视频的视频源终端的下一关键帧到达所需的到达时间,其中,所述关键帧为视频源终端周期性发送的关键帧;若所述到达时间超出允许超时的时间阈值,则向所述视频源终端发送关键帧请求,并等待关键帧到达;在所述关键帧到达时,接收到达的关键帧并将接收的所述关键帧转发至视频请求终端。上述视频关键帧转发方法,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则发送关键帧请求至该视频源终端,避免关键帧等待时间过长,从而有效提升关键帧的转发效率。

Figure 201810229537

The present invention relates to a video key frame forwarding method, device and live video system, wherein the method includes: obtaining the arrival time required for the arrival of the next key frame of a video source terminal that forwards the video, wherein the key frame is the video source terminal The key frame sent periodically; if the arrival time exceeds the time threshold that allows timeout, send a key frame request to the video source terminal and wait for the key frame to arrive; when the key frame arrives, receive the arrived key frame and forward the received key frame to the video requesting terminal. The above video key frame forwarding method sends a key frame request to the video source terminal when the arrival time required to obtain the next key frame exceeds the time threshold of the allowable timeout, so as to avoid the key frame waiting time being too long, thereby effectively improving the key frame. Frame forwarding efficiency.

Figure 201810229537

Description

视频关键帧转发方法、装置和视频直播系统Video key frame forwarding method, device and live video system

技术领域technical field

本发明涉及视频直播技术领域,特别是涉及一种视频关键帧转发方法、装置、视频直播系统、计算机设备和计算机存储介质。The present invention relates to the technical field of live video, in particular to a video key frame forwarding method, device, live video system, computer equipment and computer storage medium.

背景技术Background technique

在进行视频直播例如视频会议时,播放视频的终端通常需要通过服务器调用对应的视频源终端的视频数据,而视频数据一般包括带有完整信息的关键帧(I帧)、前向预测帧(P帧)和双向预测帧(B帧)。而在播放视频的终端第一次获取某一视频源终端的直播视频时,只有在接收到关键帧数据后,才能正常显示视频画面开始直播。When performing live video, such as a video conference, the terminal that plays the video usually needs to call the video data of the corresponding video source terminal through the server, and the video data generally includes a key frame (I frame) with complete information, a forward prediction frame (P frame) and bidirectionally predicted frame (B frame). However, when the terminal that plays the video acquires the live video of a video source terminal for the first time, it can display the video screen normally and start the live broadcast only after receiving the key frame data.

传统的关键帧处理方法,一般是视频源终端周期性地发送关键帧,通过服务器将关键帧转发至播放视频的终端实现关键帧的获取,可通过提升关键帧转发频率保证播放视频的终端的画面显示质量,然而关键帧相比于预测帧占用资源大得多,提升转发频率会导致对资源占用大大提升,导致对视频关键帧的转发效率较低。The traditional key frame processing method is generally that the video source terminal periodically sends key frames, and the server forwards the key frames to the terminal playing the video to achieve the acquisition of the key frames. By increasing the forwarding frequency of the key frames, the screen of the terminal playing the video can be guaranteed. However, compared with the predicted frame, the key frame occupies much more resources. Increasing the forwarding frequency will greatly increase the resource occupation, resulting in a lower forwarding efficiency of the video key frame.

发明内容SUMMARY OF THE INVENTION

基于此,有必要针对上述问题,提供一种能够减少关键帧转发的资源占用率,有效提升关键帧的转发效率的视频关键帧转发方法、装置、视频直播系统、计算机设备和计算机存储介质。Based on this, it is necessary to provide a video key frame forwarding method, device, video live broadcast system, computer equipment and computer storage medium that can reduce the resource occupancy rate of key frame forwarding and effectively improve the forwarding efficiency of key frames.

一种视频关键帧转发方法,包括以下步骤:A video key frame forwarding method, comprising the following steps:

获取转发视频的视频源终端的下一关键帧到达所需的到达时间,其中,所述关键帧为视频源终端周期性发送的关键帧;Obtain the arrival time required for the arrival of the next key frame of the video source terminal that forwards the video, wherein the key frame is a key frame periodically sent by the video source terminal;

若所述到达时间超出允许超时的时间阈值,则向所述视频源终端发送关键帧请求,并等待关键帧到达;If the arrival time exceeds the time threshold that allows timeout, send a key frame request to the video source terminal, and wait for the key frame to arrive;

在所述关键帧到达时,接收到达的关键帧并将接收的所述关键帧转发至视频请求终端。When the key frame arrives, the arrived key frame is received and the received key frame is forwarded to the video requesting terminal.

上述视频关键帧转发方法,通过监测该视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。The above video key frame forwarding method, by monitoring the arrival time of the next key frame of the video source terminal, when the arrival time required to obtain the next key frame exceeds the time threshold of the allowable timeout, it will actively send a key frame request to the video The source terminal can effectively avoid too long waiting time for key frames, thereby effectively improving the forwarding efficiency of key frames.

在一个实施例中,所述获取待转发视频的视频源终端的下一关键帧到达所需的到达时间的步骤之后,还包括:若所述到达时间未超出允许超时的时间阈值,则等待关键帧到达。服务器在请求关键帧之前,会先比较下一次关键帧到达的时间以及服务器允许关键帧超时时间,从而选择继续等待下一帧关键帧还是主动请求关键帧,可以有效减少关键帧到达前实际等待的时间,提升关键帧的转发效率。In one embodiment, after the step of obtaining the arrival time required for the arrival of the next key frame of the video source terminal of the video to be forwarded, the step further includes: if the arrival time does not exceed the time threshold allowed for overtime, waiting for the key frame frame arrives. Before requesting a key frame, the server will first compare the arrival time of the next key frame and the server's allowable key frame timeout time, so as to choose whether to continue waiting for the next key frame or actively request the key frame, which can effectively reduce the actual waiting time before the key frame arrives. time to improve the forwarding efficiency of key frames.

在一个实施例中,本发明实施例的视频关键帧转发方法还包括步骤:在等待关键帧到达时,记录关键帧到达前等待的等待时间;若所述等待时间超出允许超时的时间阈值,则从备选的视频源终端中选择一个替换当前的视频源终端进行关键帧转发。In one embodiment, the video key frame forwarding method of the embodiment of the present invention further comprises the steps of: when waiting for the arrival of the key frame, recording the waiting time before the arrival of the key frame; if the waiting time exceeds the time threshold of the allowable timeout, then Select one of the alternative video source terminals to replace the current video source terminal for key frame forwarding.

上述实施例的技术方案,在等待当前视频源终端关键帧到达的等待时间超出时间阈值时,则选择其它备选的视频源终端替换当前视频源终端进行关键帧转发操作,可以有效避免由于当前视频源终端线路故障等等因素导致的等待时间过长,视频请求终端需要长期等待该视频源终端关键帧的转发,不能及时的完成关键帧转发的问题,可提升关键帧的转发效率。In the technical solution of the above embodiment, when the waiting time for the arrival of the key frame of the current video source terminal exceeds the time threshold, other alternative video source terminals are selected to replace the current video source terminal to perform the key frame forwarding operation, which can effectively avoid the current video source terminal. The source terminal line failure and other factors cause the waiting time to be too long. The video request terminal needs to wait for a long time for the forwarding of the key frame of the video source terminal, and cannot complete the key frame forwarding in time, which can improve the key frame forwarding efficiency.

在一个实施例中,所述获取转发视频的视频源终端的下一关键帧到达所需的到达时间之前,还包括:接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;按照所述转发优先级列表的优先级顺序,选择优先级最高的视频源终端作为转发视频的视频源终端进行关键帧到达时间监测。In one embodiment, before the required arrival time of the next key frame of the video source terminal for obtaining the forwarded video, the method further includes: receiving a video forwarding request from the video requesting terminal, and obtaining the video forwarding request according to the video forwarding request. The information of the video source terminal that matches the video forwarding request, and according to the information of the video source terminal, the forwarding priority of each video source terminal is sorted, and a forwarding priority list is generated; according to the priority order of the forwarding priority list, select The video source terminal with the highest priority is used as the video source terminal to forward the video to monitor the arrival time of key frames.

上述实施例的技术方案,根据接收视频请求终端的视频转发请求,对服务器接入的视频源终端进行转发优先级排序,按照顺序首先选择优先级最高的视频源终端转发视频的视频源终端进行关键帧到达时间监测,并转至步骤S201进行关键帧转发操作,可以在有接入多个匹配的视频源终端时,根据视频请求终端的需求选择最优的视频源终端进行关键帧转发,有效提升视频关键帧转发的质量和效率。According to the technical solution of the above embodiment, according to the video forwarding request received by the video requesting terminal, the forwarding priority of the video source terminals accessed by the server is sorted, and the video source terminal with the highest priority is first selected in order to forward the video. The frame arrival time is monitored, and go to step S201 to perform the key frame forwarding operation. When multiple matching video source terminals are connected, the optimal video source terminal can be selected according to the needs of the video requesting terminal to perform key frame forwarding, which can effectively improve the Quality and efficiency of video keyframe forwarding.

在一个实施例中,所述获取转发视频的视频源终端的下一关键帧到达所需的到达时间之前,还包括步骤:获取所述视频请求终端的视频转发路数;所述选择优先级最高的视频源终端作为转发视频的视频源终端进行关键帧转发的步骤包括:按照所述转发优先级列表的优先级顺序,选择优先级最高的所述视频转发路数对应个数的视频源终端分别作为转发视频的视频源终端进行关键帧转发。In one embodiment, before the required arrival time of the next key frame of the video source terminal for obtaining the forwarded video, the method further includes the steps of: obtaining the number of video forwarding paths of the video requesting terminal; the selection priority is the highest The step of performing key frame forwarding by the video source terminal as the video source terminal that forwards the video includes: according to the priority order of the forwarding priority list, selecting the video source terminals corresponding to the number of the video forwarding paths with the highest priority respectively. As the video source terminal that forwards the video, it performs key frame forwarding.

上述实施例的技术方案,视频请求终端可同时接收多个视频源终端的视频数据,相应的,在对各个视频源终端按照转发优先级排序选择视频源终端进行关键帧转发时,进一步选择与视频转发路数对应个数的视频源终端作为转发视频的视频源终端进行关键帧转发,可实现对多路视频源终端的关键帧同步转发。In the technical solutions of the above embodiments, the video request terminal can simultaneously receive video data from multiple video source terminals, and accordingly, when selecting the video source terminal for key frame forwarding for each video source terminal according to the forwarding priority, it further selects the same video source terminal. The number of video source terminals corresponding to the number of forwarding channels is used as the video source terminal for forwarding video to perform key frame forwarding, which can realize the synchronous forwarding of key frames to multiple video source terminals.

在一个实施例中,所述获取转发视频的视频源终端的下一关键帧到达所需的到达时间之前,还包括:接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;所述若所述等待时间超出允许超时的时间阈值,则从备选的视频源终端中选择一个替换当前的视频源终端进行关键帧转发的步骤包括:若所述等待时间超出允许超时的时间阈值,则按照所述转发优先级列表的优先级顺序,在所述转发优先级列表中选择备选的视频源终端替换当前的视频源终端进行关键帧转发。In one embodiment, before the required arrival time of the next key frame of the video source terminal for obtaining the forwarded video, the method further includes: receiving a video forwarding request from the video requesting terminal, and obtaining the video forwarding request according to the video forwarding request. The information of the video source terminal matched by the video forwarding request, according to the information of the video source terminal, carry out forwarding priority sorting to each video source terminal, and generate a forwarding priority list; , then the step of selecting a replacement video source terminal from the alternative video source terminal to perform key frame forwarding includes: if the waiting time exceeds the time threshold of the allowable timeout, then according to the priority order of the forwarding priority list , select an alternative video source terminal in the forwarding priority list to replace the current video source terminal to perform key frame forwarding.

上述实施例的技术方案,根据接收视频请求终端的视频转发请求,对服务器接入的视频源终端进行转发优先级排序,并根据该转发优先级的顺序,依次选择视频源终端进行关键帧转发,在当前视频源终端关键帧转发超出时间阈值时,则按照所述转发优先级列表的优先级顺序,依次选择备选的视频源终端进行等待或请求关键帧,这样可以按照优先级顺序进行关键帧转发,提升关键帧的转发质量,且可以避免一直等待同一个客户端关键帧的情况,同时提升关键帧的转发效率。According to the technical solution of the above embodiment, according to the video forwarding request received by the video requesting terminal, the forwarding priority is sorted for the video source terminal accessed by the server, and the video source terminal is sequentially selected to perform key frame forwarding according to the order of the forwarding priority, When the key frame forwarding of the current video source terminal exceeds the time threshold, the alternative video source terminal is selected in turn according to the priority order of the forwarding priority list to wait for or request the key frame, so that the key frame can be carried out according to the priority order. Forwarding, improving the forwarding quality of key frames, avoiding the situation of waiting for the same client key frame all the time, and improving the forwarding efficiency of key frames.

在一个实施例中,所述根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表的步骤包括:根据获取的各个所述视频源终端的音频能量大小顺序进行优先级排序,生成视频源终端的转发优先级列表,根据视频源终端的音频能量大小顺序进行优先级排序,可优先选择当前音频能量较大的视频源终端进行视频转发,在实际应用中,可实现优先转发当前正在通话的视频源终端的视频数据,提升视频转发的质量。In an embodiment, the step of performing forwarding priority sorting on each video source terminal according to the information of the video source terminal, the step of generating a forwarding priority list includes: according to the obtained audio energy size order of each of the video source terminals Perform priority sorting to generate a forwarding priority list of the video source terminal, and perform priority sorting according to the order of the audio energy of the video source terminal. The video data of the video source terminal currently being called can be preferentially forwarded, and the quality of video forwarding can be improved.

在另一个实施例中,所述根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表的步骤包括:根据视频请求终端指定的视频源终端优先级信息进行优先级排序,生成视频源终端的转发优先级列表,该实施例的技术方案,视频请求终端可以指定特定的视频源终端优先进行视频转发。In another embodiment, the step of performing forwarding priority ordering on each video source terminal according to the information of the video source terminal, the step of generating a forwarding priority list includes: performing the forwarding priority according to the video source terminal priority information specified by the video requesting terminal. The priority is sorted, and a forwarding priority list of the video source terminal is generated. In the technical solution of this embodiment, the video requesting terminal can designate a specific video source terminal to perform video forwarding preferentially.

在又一个实施例中,所述根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表的步骤包括:根据视频源终端接入的时间顺序进行优先级排序,生成视频源终端的转发优先级列表,该实施例的技术方案,可根据视频源终端接入服务器的顺序进行转发优先级的排序,例如可以优先选择新接入的视频源终端进行视频转发,提升视频转发效率。In yet another embodiment, the step of performing forwarding priority sorting on each video source terminal according to the information of the video source terminals, the step of generating a forwarding priority list includes: performing priority sorting according to the temporal order of video source terminals access , to generate a forwarding priority list of the video source terminal. The technical solution of this embodiment can sort the forwarding priority according to the order in which the video source terminal accesses the server. For example, the newly accessed video source terminal can be preferentially selected for video forwarding. Improve video forwarding efficiency.

在一个实施例中,所述并获取所述视频请求终端的视频转发路数的步骤包括:根据视频请求终端的下行带宽获取所述视频请求终端可接收的视频转发路数,该实施例的技术方案,可根据视频请求终端当前的下行带宽承受能力获取合适的视频转发路数,在实现多线程转发视频,提升视频转发效率的同时,保证当前视频转发数据传输的稳定性,避免转发线程过多超出视频请求终端可接收的带宽而导致的视频直播卡顿。In one embodiment, the step of obtaining the video forwarding paths of the video requesting terminal includes: acquiring the video forwarding paths that the video requesting terminal can receive according to the downlink bandwidth of the video requesting terminal. The solution can obtain the appropriate number of video forwarding channels according to the current downlink bandwidth capacity of the video requesting terminal. While realizing multi-threaded video forwarding and improving video forwarding efficiency, it ensures the stability of current video forwarding data transmission and avoids too many forwarding threads. Live video freezes caused by exceeding the bandwidth that the video requesting terminal can receive.

在另一个实施例中,所述并获取所述视频请求终端的视频转发路数的步骤包括:根据视频请求终端的解码能力获取所述视频请求终端可接收的视频转发路数,该实施例的技术方案,可根据视频请求终端的解码能力获取合适的视频转发路数,在实现多线程转发视频,提升视频转发效率的同时,保证当前视频转发数据传输的稳定性,避免转发线程过多超出视频请求终端解码能力而导致的视频直播卡顿。In another embodiment, the step of acquiring the number of video forwarding paths of the video requesting terminal includes: acquiring the number of video forwarding paths that can be received by the video requesting terminal according to the decoding capability of the video requesting terminal. The technical solution can obtain the appropriate number of video forwarding paths according to the decoding capability of the video requesting terminal, realize multi-threaded video forwarding, improve the video forwarding efficiency, and at the same time ensure the stability of the current video forwarding data transmission, and avoid too many forwarding threads exceeding the video. Live video freezes caused by requesting the terminal's decoding capability.

一种视频关键帧转发装置,包括:A video key frame forwarding device, comprising:

关键帧监测模块,用于获取转发视频的视频源终端的下一关键帧到达所需的到达时间,其中,所述关键帧为视频源终端周期性发送的关键帧;A key frame monitoring module, used to obtain the arrival time required for the arrival of the next key frame of the video source terminal that forwards the video, wherein the key frame is a key frame periodically sent by the video source terminal;

关键帧请求模块,用于若所述到达时间超出允许超时的时间阈值,则向所述视频源终端发送关键帧请求,并等待关键帧到达;A key frame request module, configured to send a key frame request to the video source terminal if the arrival time exceeds the time threshold that allows timeout, and wait for the key frame to arrive;

关键帧转发模块,用于在所述关键帧到达时,接收到达的关键帧并将接收的所述关键帧转发至视频请求终端。A key frame forwarding module is configured to, when the key frame arrives, receive the arrived key frame and forward the received key frame to the video requesting terminal.

上述视频关键帧转发装置,通过监测该视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。The above video key frame forwarding device, by monitoring the arrival time of the next key frame of the video source terminal, actively sends a key frame request to the video when the arrival time required to obtain the next key frame exceeds the time threshold allowed for timeout The source terminal can effectively avoid too long waiting time for key frames, thereby effectively improving the forwarding efficiency of key frames.

一种计算机设备,该计算机设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现如上述各实施例中的任意一种视频关键帧转发方法。A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein, when the processor executes the program, any video as described in the above embodiments is implemented Keyframe forwarding method.

上述计算机设备,通过所述处理器上运行的计算机程序,实现了通过监测视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。The above-mentioned computer equipment, through the computer program running on the processor, realizes that by monitoring the arrival time of the next key frame of the video source terminal, when the arrival time required to obtain the next key frame will exceed the time threshold of the allowable timeout, Then, the key frame request is actively sent to the video source terminal, which effectively avoids a long waiting time for the key frame, thereby effectively improving the forwarding efficiency of the key frame.

一种计算机存储介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如上述各实施例中的任意一种视频关键帧转发方法。A computer storage medium on which a computer program is stored, wherein when the program is executed by a processor, any one of the video key frame forwarding methods in the foregoing embodiments is implemented.

上述计算机存储介质,通过其存储的计算机程序,实现了通过监测视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。The above-mentioned computer storage medium, through the computer program stored in it, realizes that by monitoring the arrival time of the next key frame of the video source terminal, when the arrival time required to obtain the next key frame exceeds the time threshold of the allowable timeout, it will actively send the The key frame request is sent to the video source terminal, which effectively avoids the long waiting time for the key frame, thereby effectively improving the forwarding efficiency of the key frame.

此外,本发明还提供一种视频直播系统,包括:视频请求终端、视频源终端以及服务器设备;其中,所述视频请求终端和视频源终端分别与服务器设备通信连接;所述视频请求终端用于发送视频转发请求至服务器设备,并接收服务器设备转发的来自所述视频源终端的视频数据;所述视频源终端用于周期性向所述服务器设备发送关键帧,接收服务器设备的视频数据请求,并转发对应的视频数据至所述服务器设备;所述服务器设备用于执行如上任意一个实施例的视频关键帧转发方法,并用于在将接收的所述关键帧转发至请求转发视频的视频请求终端时,还用于将对应的视频源终端的视频数据转发至请求转发视频的视频请求终端。In addition, the present invention also provides a live video system, including: a video request terminal, a video source terminal, and a server device; wherein, the video request terminal and the video source terminal are respectively connected in communication with the server device; the video request terminal is used for Send a video forwarding request to the server device, and receive video data from the video source terminal forwarded by the server device; the video source terminal is used to periodically send key frames to the server device, receive the video data request from the server device, and Forwarding the corresponding video data to the server device; the server device is configured to execute the video key frame forwarding method of any one of the above embodiments, and is used to forward the received key frame to the video requesting terminal that requests to forward the video. , and is also used to forward the video data of the corresponding video source terminal to the video requesting terminal that requests to forward the video.

上述视频直播系统,视频源终端周期性向所述服务器发送关键帧,服务器接收视频请求终端的视频转发请求,监测视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。In the above-mentioned live video system, the video source terminal periodically sends key frames to the server, and the server receives the video forwarding request from the video requesting terminal, monitors the arrival time of the next key frame of the video source terminal, and obtains the arrival time required for the next key frame after obtaining the next key frame. When the allowable timeout time threshold is exceeded, it will actively send a key frame request to the video source terminal, which can effectively prevent the key frame from waiting too long, thereby effectively improving the key frame forwarding efficiency.

附图说明Description of drawings

图1为一个实施例的视频关键帧请求方法的应用环境示意图;1 is a schematic diagram of an application environment of a method for requesting a video key frame according to an embodiment;

图2为一个实施例的视频关键帧请求方法的流程示意图;2 is a schematic flowchart of a method for requesting a video key frame according to an embodiment;

图3为一个实施例的视频关键帧请求方法的流程示意图;3 is a schematic flowchart of a method for requesting a video key frame according to an embodiment;

图4为一个实施例的视频关键帧请求方法的流程示意图;4 is a schematic flowchart of a method for requesting a video key frame according to an embodiment;

图5为一个实施例的视频关键帧请求方法的流程示意图;5 is a schematic flowchart of a method for requesting a video key frame according to an embodiment;

图6为一个实施例的视频关键帧请求装置的结构示意图;6 is a schematic structural diagram of a video key frame request apparatus according to an embodiment;

图7为一个实施例的视频关键帧请求系统的结构示意图。FIG. 7 is a schematic structural diagram of a video key frame request system according to an embodiment.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.

本发明实施例的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或(模块)单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "comprising" and "having" and any variations thereof in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example a process, method, system, product or device comprising a series of steps or (module) units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or alternatively It also includes other steps or units inherent to these processes, methods, products or devices.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

本发明提供的视频关键帧转发方法,可以应用于如图1所示的应用环境中。其中,视频请求终端101和视频源终端102分别通过网络与服务器103进行通信。视频请求终端101发送视频转发请求至服务器103,服务器103根据接收的视频转发请求将视频源终端102的视频数据转发至视频请求终端101,其中,视频请求终端101为具有视频播放功能的终端设备,视频源终端102为具有提供视频源的终端设备,视频请求终端101和视频源终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备,视频源终端102可以包括一个或多个,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The video key frame forwarding method provided by the present invention can be applied to the application environment shown in FIG. 1 . The video request terminal 101 and the video source terminal 102 respectively communicate with the server 103 through the network. The video requesting terminal 101 sends a video forwarding request to the server 103, and the server 103 forwards the video data of the video source terminal 102 to the video requesting terminal 101 according to the received video forwarding request, wherein the video requesting terminal 101 is a terminal device with a video playback function, The video source terminal 102 is a terminal device that provides a video source. The video request terminal 101 and the video source terminal 102 can be, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices. The video source terminal 102 It may include one or more, and the server 104 may be implemented by an independent server or a server cluster composed of multiple servers.

本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器或者设备的限定,具体的服务器或者设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 1 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the server or device to which the solution of the present application is applied. A device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.

在一个实施例中,如图2所示,提供了一种视频关键帧转发方法,以该方法应用于图1中的服务器103为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2 , a video key frame forwarding method is provided, and the method is applied to the server 103 in FIG. 1 as an example for description, including the following steps:

S201,获取转发视频的视频源终端的下一关键帧到达所需的到达时间,其中,所述关键帧为视频源终端周期性发送的关键帧。S201: Obtain the arrival time required for the arrival of the next key frame of the video source terminal that forwards the video, where the key frame is a key frame periodically sent by the video source terminal.

其中,转发视频的视频源终端是当前服务器选定的,用于进行关键帧到达时间监测并执行视频转发的视频源终端,所述视频源终端按照预定的时间周期周期性地向服务器发送关键帧。The video source terminal that forwards the video is selected by the current server and is used to monitor the arrival time of key frames and perform video forwarding. The video source terminal periodically sends key frames to the server according to a predetermined time period. .

在此步骤中,服务器对当前选中的用于转发视频的视频源终端进行关键帧到达时间监测,获取该视频源终端下一关键帧到达所需要的到达时间。In this step, the server monitors the arrival time of the key frame on the video source terminal currently selected for forwarding the video, and obtains the arrival time required for the arrival of the next key frame of the video source terminal.

S202,若所述到达时间超出允许超时的时间阈值,则向所述视频源终端发送关键帧请求,并等待关键帧到达。S202, if the arrival time exceeds a time threshold that allows timeout, send a key frame request to the video source terminal, and wait for the key frame to arrive.

其中,所述允许超时的时间阈值,为预设的可接受的关键帧转发耗时上限时间值。Wherein, the time threshold for allowing timeout is a preset acceptable time-consuming upper limit time value of key frame forwarding.

在此步骤中,当判定到达时间会超出允许超时的时间阈值时,服务器则向视频源终端发送关键帧请求,请求视频源终端发送关键帧至服务器,并等待关键帧的到达。In this step, when it is determined that the arrival time will exceed the allowable timeout time threshold, the server sends a key frame request to the video source terminal, requesting the video source terminal to send the key frame to the server, and wait for the arrival of the key frame.

S203,在所述关键帧到达时,接收到达的关键帧并将接收的所述关键帧转发至视频请求终端。S203, when the key frame arrives, receive the arrived key frame and forward the received key frame to the video requesting terminal.

在此步骤中,服务器将接收到达的关键帧并将接收的所述关键帧转发至视频请求终端,完成对视频关键帧的转发。In this step, the server receives the received key frame and forwards the received key frame to the video requesting terminal to complete the forwarding of the video key frame.

上述视频关键帧转发方法,通过监测该视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。The above video key frame forwarding method, by monitoring the arrival time of the next key frame of the video source terminal, when the arrival time required to obtain the next key frame exceeds the time threshold of the allowable timeout, it will actively send a key frame request to the video The source terminal can effectively avoid too long waiting time for key frames, thereby effectively improving the forwarding efficiency of key frames.

在一个实施例中,在步骤S201所述获取待转发视频的视频源终端的下一关键帧到达所需的到达时间的步骤之后,还包括:若所述到达时间未超出允许超时的时间阈值,则等待关键帧到达。服务器在请求关键帧之前,会先比较下一次关键帧到达的时间以及服务器允许关键帧超时时间,从而选择继续等待下一帧关键帧还是主动请求关键帧,可以有效减少关键帧到达前实际等待的时间,提升关键帧的转发效率。In one embodiment, after the step of obtaining the arrival time required for the arrival of the next key frame of the video source terminal of the video to be forwarded in step S201, the method further includes: if the arrival time does not exceed the time threshold for allowing timeout, Then wait for the keyframe to arrive. Before requesting a key frame, the server will first compare the arrival time of the next key frame and the server's allowable key frame timeout time, so as to choose whether to continue waiting for the next key frame or actively request the key frame, which can effectively reduce the actual waiting time before the key frame arrives. time to improve the forwarding efficiency of key frames.

参见图3所示,图3为一个实施例的视频关键帧转发方法的流程示意图,该实施例的视频关键帧转发方法包括步骤:Referring to FIG. 3, FIG. 3 is a schematic flowchart of a video key frame forwarding method according to an embodiment. The video key frame forwarding method in this embodiment includes steps:

S301,获取转发视频的视频源终端的下一关键帧到达所需的到达时间,其中,所述关键帧为视频源终端周期性发送的关键帧;S301, obtaining the arrival time required for the arrival of the next key frame of the video source terminal that forwards the video, wherein the key frame is a key frame periodically sent by the video source terminal;

S302,判断所述到达时间是否超出允许超时的时间阈值;S302, judging whether the arrival time exceeds the time threshold that allows timeout;

S303,若所述到达时间未超出允许超时的时间阈值,则等待关键帧到达;S303, if the arrival time does not exceed the time threshold that allows timeout, wait for the key frame to arrive;

S304,若所述到达时间超出允许超时的时间阈值,则向所述视频源终端发送关键帧请求,并等待关键帧到达;S304, if the arrival time exceeds the time threshold that allows timeout, send a key frame request to the video source terminal, and wait for the key frame to arrive;

S308,在所述关键帧到达时,接收到达的关键帧并将接收的所述关键帧转发至视频请求终端。S308, when the key frame arrives, receive the arrived key frame and forward the received key frame to the video requesting terminal.

在一个实施例中,参见图4所示,在步骤S303或步骤S304之后,还包括步骤:In one embodiment, as shown in FIG. 4 , after step S303 or step S304, it further includes steps:

S305,在等待关键帧到达时,记录关键帧到达前等待的等待时间;S305, when waiting for the key frame to arrive, record the waiting time before the key frame arrives;

S306,判断所述等待时间是否超出允许超时的时间阈值;S306, judging whether the waiting time exceeds the time threshold that allows timeout;

S307,若所述等待时间超出允许超时的时间阈值,则从备选的视频源终端中选择一个替换当前的视频源终端进行关键帧转发。S307, if the waiting time exceeds the time threshold for allowing timeout, select one of the alternative video source terminals to replace the current video source terminal to perform key frame forwarding.

其中,步骤S306所述的进行关键帧转发,可以是依照步骤S301至S307进行的关键帧转发操作。The key frame forwarding described in step S306 may be the key frame forwarding operation performed according to steps S301 to S307.

其中,所述备选的视频源终端为当前接入服务器的与视频请求终端发送的视频请求匹配的视频源终端中,除了当前转发视频的视频源终端之外的其余的视频源终端。The alternative video source terminals are the video source terminals currently accessing the server that match the video request sent by the video requesting terminal, and the remaining video source terminals except the video source terminal currently forwarding the video.

关键帧的传输的过程中,可能由于网络故障等原因,导致当前的视频源终端的关键帧到达延时,上述实施例的技术方案,在等待当前视频源终端关键帧到达的等待时间超出时间阈值时,则选择其它备选的视频源终端替换当前视频源终端进行关键帧转发操作,可以有效避免由于当前视频源终端线路故障等等因素导致的等待时间过长,视频请求终端需要长期等待该视频源终端关键帧的转发,不能及时的完成关键帧转发的问题,可提升关键帧的转发效率。During the transmission of the key frame, the arrival of the key frame of the current video source terminal may be delayed due to reasons such as network failure. The technical solution of the above embodiment, the waiting time for the arrival of the key frame of the current video source terminal exceeds the time threshold. When the video source terminal is selected, another alternative video source terminal is selected to replace the current video source terminal for the key frame forwarding operation, which can effectively avoid the long waiting time caused by the current video source terminal line failure and other factors, and the video request terminal needs to wait for the video for a long time. For the forwarding of key frames of the source terminal, the problem that the forwarding of key frames cannot be completed in time can improve the forwarding efficiency of key frames.

在一个实施例中,在步骤S201所述获取转发视频的视频源终端的下一关键帧到达所需的到达时间之前,还包括:接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;按照所述转发优先级列表的优先级顺序,选择优先级最高的视频源终端作为转发视频的视频源终端进行关键帧到达时间监测。In an embodiment, before the required arrival time of the next key frame of the video source terminal for acquiring the forwarded video in step S201, the method further includes: receiving a video forwarding request from the video requesting terminal, and according to the video forwarding request, Obtain the information of the video source terminal that matches the video forwarding request, perform forwarding priority sorting on each video source terminal according to the information of the video source terminal, and generate a forwarding priority list; according to the priority of the forwarding priority list In order, the video source terminal with the highest priority is selected as the video source terminal for forwarding the video to monitor the arrival time of key frames.

上述实施例的技术方案,根据接收视频请求终端的视频转发请求,对服务器接入的视频源终端进行转发优先级排序,按照顺序首先选择优先级最高的视频源终端转发视频的视频源终端进行关键帧到达时间监测,并转至步骤S201进行关键帧转发操作,可以在有接入多个匹配的视频源终端时,根据视频请求终端的需求选择最优的视频源终端进行关键帧转发,有效提升视频关键帧转发的质量和效率。According to the technical solution of the above embodiment, according to the video forwarding request received by the video requesting terminal, the forwarding priority of the video source terminals accessed by the server is sorted, and the video source terminal with the highest priority is first selected in order to forward the video. The frame arrival time is monitored, and go to step S201 to perform the key frame forwarding operation. When multiple matching video source terminals are connected, the optimal video source terminal can be selected according to the needs of the video requesting terminal to perform key frame forwarding, which can effectively improve the Quality and efficiency of video keyframe forwarding.

进一步地,在一个实施例中,在步骤S201所述获取转发视频的视频源终端的下一关键帧到达所需的到达时间之前,还包括步骤:获取所述视频请求终端的视频转发路数;所述选择优先级最高的视频源终端作为转发视频的视频源终端进行关键帧转发的步骤包括:按照所述转发优先级列表的优先级顺序,选择优先级最高的所述视频转发路数对应个数的视频源终端分别作为转发视频的视频源终端进行关键帧转发。Further, in one embodiment, before the required arrival time of the next key frame of the video source terminal for acquiring the forwarded video in step S201, the method further includes the step of: acquiring the video forwarding path number of the video requesting terminal; The step of selecting the video source terminal with the highest priority as the video source terminal for forwarding the video to perform key frame forwarding includes: according to the priority order of the forwarding priority list, selecting a corresponding number of the video forwarding paths with the highest priority. A number of video source terminals are respectively used as video source terminals for forwarding video to perform key frame forwarding.

上述实施例的技术方案,视频请求终端可同时接收多个视频源终端的视频数据,相应的,在对各个视频源终端按照转发优先级排序选择视频源终端进行关键帧转发时,进一步选择与视频转发路数对应个数的视频源终端作为转发视频的视频源终端进行关键帧转发,可实现对多路视频源终端的关键帧同步转发。In the technical solutions of the above embodiments, the video request terminal can simultaneously receive video data from multiple video source terminals, and accordingly, when selecting the video source terminal for key frame forwarding for each video source terminal according to the forwarding priority, it further selects the same video source terminal. The number of video source terminals corresponding to the number of forwarding channels is used as the video source terminal for forwarding video to perform key frame forwarding, which can realize the synchronous forwarding of key frames to multiple video source terminals.

在一个实施例中,在步骤S201所述获取转发视频的视频源终端的下一关键帧到达所需的到达时间之前,还包括:接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;所述若所述等待时间超出允许超时的时间阈值,则从备选的视频源终端中选择一个替换当前的视频源终端进行关键帧转发的步骤包括:若所述等待时间超出允许超时的时间阈值,则按照所述转发优先级列表的优先级顺序,在所述转发优先级列表中选择备选的视频源终端替换当前的视频源终端进行关键帧转发。In an embodiment, before the required arrival time of the next key frame of the video source terminal for acquiring the forwarded video in step S201, the method further includes: receiving a video forwarding request from the video requesting terminal, and according to the video forwarding request, Obtain the information of the video source terminal that matches the video forwarding request, perform forwarding priority sorting on each video source terminal according to the information of the video source terminal, and generate a forwarding priority list; if the waiting time exceeds the allowable timeout the time threshold value, then the step of selecting a replacement video source terminal to perform key frame forwarding from the alternative video source terminals includes: if the waiting time exceeds the time threshold that allows timeout, then according to the forwarding priority list Priority order, select an alternative video source terminal in the forwarding priority list to replace the current video source terminal to perform key frame forwarding.

上述实施例的技术方案,根据接收视频请求终端的视频转发请求,对服务器接入的视频源终端进行转发优先级排序,并根据该转发优先级的顺序,依次选择视频源终端进行关键帧转发,在当前视频源终端关键帧转发超出时间阈值时,则按照所述转发优先级列表的优先级顺序,依次选择备选的视频源终端进行等待或请求关键帧,这样可以按照优先级顺序进行关键帧转发,提升关键帧的转发质量,且可以避免一直等待同一个客户端关键帧的情况,同时提升关键帧的转发效率。According to the technical solution of the above embodiment, according to the video forwarding request received by the video requesting terminal, the forwarding priority is sorted for the video source terminal accessed by the server, and the video source terminal is sequentially selected to perform key frame forwarding according to the order of the forwarding priority, When the key frame forwarding of the current video source terminal exceeds the time threshold, the alternative video source terminal is selected in turn according to the priority order of the forwarding priority list to wait for or request the key frame, so that the key frame can be carried out according to the priority order. Forwarding, improving the forwarding quality of key frames, avoiding the situation of waiting for the same client key frame all the time, and improving the forwarding efficiency of key frames.

参见图5所示,图5为一个实施例的的流程示意图,该实施例的包括步骤:Referring to FIG. 5, FIG. 5 is a schematic flowchart of an embodiment, which includes steps:

S501,接收视频请求终端的视频转发请求;S501, receiving a video forwarding request from a video requesting terminal;

S502,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;S502, according to the video forwarding request, obtain the information of the video source terminal matching the video forwarding request, and perform forwarding priority sorting on each video source terminal according to the information of the video source terminal, and generate a forwarding priority list;

S503,获取所述视频请求终端的视频转发路数;S503, acquiring the number of video forwarding paths of the video requesting terminal;

S504,按照所述转发优先级列表的优先级顺序,选择优先级最高的所述视频转发路数对应个数的视频源终端分别作为转发视频的视频源终端进行关键帧到达时间监测;S504, according to the priority order of the forwarding priority list, select the video source terminals corresponding to the number of the video forwarding paths with the highest priority as the video source terminals for forwarding the video respectively to monitor the arrival time of key frames;

S505,获取转发视频的视频源终端的下一关键帧到达所需的到达时间,其中,所述关键帧为视频源终端周期性发送的关键帧;S505, obtaining the arrival time required for the arrival of the next key frame of the video source terminal that forwards the video, wherein the key frame is a key frame periodically sent by the video source terminal;

S506,判断所述到达时间是否超出允许超时的时间阈值;S506, judging whether the arrival time exceeds the time threshold that allows timeout;

S507,若所述到达时间未超出允许超时的时间阈值,则等待关键帧到达;S507, if the arrival time does not exceed the time threshold for allowing timeout, wait for the key frame to arrive;

S508,若所述到达时间超出允许超时的时间阈值,则向所述视频源终端发送关键帧请求,并等待关键帧到达;S508, if the arrival time exceeds the time threshold that allows timeout, send a key frame request to the video source terminal, and wait for the key frame to arrive;

S509,在等待关键帧到达时,记录关键帧到达前等待的等待时间;S509, when waiting for the key frame to arrive, record the waiting time before the key frame arrives;

S510,判断所述等待时间是否超出允许超时的时间阈值;S510, judging whether the waiting time exceeds the time threshold that allows timeout;

S511,若所述等待时间超出允许超时的时间阈值,则按照所述转发优先级列表的优先级顺序,在所述转发优先级列表中选择备选的视频源终端替换当前的视频源终端进行关键帧转发,并返回S505。S511, if the waiting time exceeds the time threshold that allows timeout, select an alternative video source terminal in the forwarding priority list to replace the current video source terminal according to the priority order of the forwarding priority list The frame is forwarded, and the process returns to S505.

S512,在所述关键帧到达时,接收到达的关键帧并将接收的所述关键帧转发至视频请求终端。S512, when the key frame arrives, receive the arrived key frame and forward the received key frame to the video requesting terminal.

其中,对于步骤S504中的任一个视频源终端,均可跳转至执行步骤S505至S512的步骤。Wherein, for any video source terminal in step S504, it can jump to the steps of executing steps S505 to S512.

上述实施例的技术方案,服务器在请求关键帧之前,会先比较下一次关键帧到达时间以及服务器允许关键帧超时时间,从而选择继续等待下一帧关键帧还是主动请求关键帧,这样,可以在最短的时间内获得关键帧。此外,由于可根据到达时间长短选择是否请求关键帧,视频源终端发送关键帧的周期可以设置的较长也能够保证视频直播的转发效率,避免了为了提升视频直播效果而提升关键帧发送频率导致的资源占用大和网络卡顿等等。关键帧的传输的过程中,可能由于网络等原因,如果未能在期望的时间内到达,则服务器会重新选择一个客户端,等待或请求其关键帧,这样可以避免一直等待同一个客户端关键帧的情况,有效提升了关键帧的转发效率。In the technical solution of the above embodiment, before requesting a key frame, the server will first compare the arrival time of the next key frame and the timeout time of the key frame allowed by the server, so as to choose whether to continue waiting for the next key frame or actively request the key frame. Get keyframes in the shortest time possible. In addition, since it is possible to select whether to request key frames according to the arrival time, the period for sending key frames by the video source terminal can be set to be longer, which can also ensure the forwarding efficiency of live video, and avoid the need to increase the frequency of sending key frames in order to improve the effect of live video. The resource consumption is large and the network is stuck, etc. During the transmission of key frames, possibly due to network and other reasons, if it fails to arrive within the expected time, the server will re-select a client and wait for or request its key frame, so as to avoid waiting for the same client key all the time. frame, which effectively improves the forwarding efficiency of key frames.

对于视频源终端的转发优先级排序,可以根据不同的评判方式进行优先级排序,例如可以参考视频请求终端的指定顺序或者各个视频源终端的音频能量大小,或者各个视频源终端的接入顺序等等。For the forwarding priority sorting of video source terminals, the priority sorting can be carried out according to different evaluation methods. For example, you can refer to the specified order of video requesting terminals, the audio energy size of each video source terminal, or the access order of each video source terminal, etc. Wait.

在一个实施例中,所述根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表的步骤包括:根据获取的各个所述视频源终端的音频能量大小顺序进行优先级排序,生成视频源终端的转发优先级列表,根据视频源终端的音频能量大小顺序进行优先级排序,可优先选择当前音频能量较大的视频源终端进行视频转发,在实际应用中,可实现优先转发当前正在通话的视频源终端的视频数据,提升视频转发的质量。In an embodiment, the step of performing forwarding priority sorting on each video source terminal according to the information of the video source terminal, the step of generating a forwarding priority list includes: according to the obtained audio energy size order of each of the video source terminals Perform priority sorting to generate a forwarding priority list of the video source terminal, and perform priority sorting according to the order of the audio energy of the video source terminal. The video data of the video source terminal currently being called can be preferentially forwarded, and the quality of video forwarding can be improved.

在另一个实施例中,所述根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表的步骤包括:根据视频请求终端指定的视频源终端优先级信息进行优先级排序,生成视频源终端的转发优先级列表,该实施例的技术方案,视频请求终端可以指定特定的视频源终端优先进行视频转发。In another embodiment, the step of performing forwarding priority sorting on each video source terminal according to the information of the video source terminal, the step of generating a forwarding priority list includes: performing a forwarding priority according to the video source terminal priority information specified by the video requesting terminal. The priority is sorted, and a forwarding priority list of the video source terminal is generated. In the technical solution of this embodiment, the video requesting terminal can designate a specific video source terminal to perform video forwarding preferentially.

在又一个实施例中,所述根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表的步骤包括:根据视频源终端接入的时间顺序进行优先级排序,生成视频源终端的转发优先级列表,该实施例的技术方案,可根据视频源终端接入服务器的顺序进行转发优先级的排序,例如可以优先选择新接入的视频源终端进行视频转发,提升视频转发效率。In yet another embodiment, the step of performing forwarding priority sorting on each video source terminal according to the information of the video source terminals, the step of generating a forwarding priority list includes: performing priority sorting according to the temporal order of video source terminals access , to generate a forwarding priority list of the video source terminal. The technical solution of this embodiment can sort the forwarding priority according to the order in which the video source terminal accesses the server. For example, the newly accessed video source terminal can be preferentially selected for video forwarding. Improve video forwarding efficiency.

对于视频请求终端可接收的视频转发路数,可以根据不同的评判方式获取,例如可以根据视频请求终端的下行带宽或解码能力等等计算得到当前视频请求终端的视频转发路数,或者视频请求终端也可以指定视频转发路数的数目等等。The number of video forwarding channels that can be received by the video requesting terminal can be obtained according to different evaluation methods. For example, the number of video forwarding channels of the current video requesting terminal can be calculated according to the downlink bandwidth or decoding capability of the video requesting terminal, or the video requesting terminal You can also specify the number of video forwarding channels and so on.

在一个实施例中,所述并获取所述视频请求终端的视频转发路数的步骤包括:根据视频请求终端的下行带宽获取所述视频请求终端可接收的视频转发路数,该实施例的技术方案,可根据视频请求终端当前的下行带宽承受能力获取合适的视频转发路数,在实现多线程转发视频,提升视频转发效率的同时,保证当前视频转发数据传输的稳定性,避免转发线程过多超出视频请求终端可接收的带宽而导致的视频直播卡顿。In one embodiment, the step of obtaining the video forwarding paths of the video requesting terminal includes: acquiring the video forwarding paths that the video requesting terminal can receive according to the downlink bandwidth of the video requesting terminal. The solution can obtain the appropriate number of video forwarding channels according to the current downlink bandwidth capacity of the video requesting terminal. While realizing multi-threaded video forwarding and improving video forwarding efficiency, it ensures the stability of current video forwarding data transmission and avoids too many forwarding threads. Live video freezes caused by exceeding the bandwidth that the video requesting terminal can receive.

在另一个实施例中,所述并获取所述视频请求终端的视频转发路数的步骤包括:根据视频请求终端的解码能力获取所述视频请求终端可接收的视频转发路数,该实施例的技术方案,可根据视频请求终端的解码能力获取合适的视频转发路数,在实现多线程转发视频,提升视频转发效率的同时,保证当前视频转发数据传输的稳定性,避免转发线程过多超出视频请求终端解码能力而导致的视频直播卡顿。In another embodiment, the step of acquiring the number of video forwarding paths of the video requesting terminal includes: acquiring the number of video forwarding paths that can be received by the video requesting terminal according to the decoding capability of the video requesting terminal. The technical solution can obtain the appropriate number of video forwarding paths according to the decoding capability of the video requesting terminal, realize multi-threaded video forwarding, improve the video forwarding efficiency, and at the same time ensure the stability of the current video forwarding data transmission, and avoid too many forwarding threads exceeding the video. Live video freezes caused by requesting the terminal's decoding capability.

在一个实施例中,参见图6所示,提供了一种视频关键帧转发装置,包括:In one embodiment, as shown in FIG. 6, a video key frame forwarding apparatus is provided, including:

关键帧监测模块601,用于获取转发视频的视频源终端的下一关键帧到达所需的到达时间,其中,所述关键帧为视频源终端周期性发送的关键帧;The key frame monitoring module 601 is used to obtain the arrival time required for the arrival of the next key frame of the video source terminal that forwards the video, wherein the key frame is the key frame periodically sent by the video source terminal;

关键帧请求模块602,用于若所述到达时间超出允许超时的时间阈值,则向所述视频源终端发送关键帧请求,并等待关键帧到达;A key frame request module 602, configured to send a key frame request to the video source terminal if the arrival time exceeds the time threshold that allows timeout, and wait for the key frame to arrive;

关键帧转发模块603,用于在所述关键帧到达时,接收到达的关键帧并将接收的所述关键帧转发至视频请求终端。The key frame forwarding module 603 is configured to, when the key frame arrives, receive the arrived key frame and forward the received key frame to the video requesting terminal.

上述视频关键帧转发装置,通过监测该视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。The above video key frame forwarding device, by monitoring the arrival time of the next key frame of the video source terminal, actively sends a key frame request to the video when the arrival time required to obtain the next key frame exceeds the time threshold allowed for timeout The source terminal can effectively avoid too long waiting time for key frames, thereby effectively improving the forwarding efficiency of key frames.

在一个实施例中,本发明实施例的视频关键帧转发装置还包括:关键帧等待模块,用于若所述到达时间未超出允许超时的时间阈值,则等待关键帧到达。In one embodiment, the video key frame forwarding apparatus of the embodiment of the present invention further includes: a key frame waiting module, configured to wait for the key frame to arrive if the arrival time does not exceed the time threshold allowed for timeout.

在一个实施例中,本发明实施例的视频关键帧转发装置还包括:In one embodiment, the video key frame forwarding apparatus according to the embodiment of the present invention further includes:

等待时间记录模块,用于在等待关键帧到达时,记录关键帧到达前等待的等待时间;The waiting time recording module is used to record the waiting time before the key frame arrives when waiting for the key frame to arrive;

视频源终端替换模块,用于若所述等待时间超出允许超时的时间阈值,则从备选的视频源终端中选择一个替换当前的视频源终端进行关键帧转发。A video source terminal replacement module, configured to select one alternative video source terminal to replace the current video source terminal to perform key frame forwarding if the waiting time exceeds the time threshold allowed for timeout.

在一个实施例中,本发明实施例的视频关键帧转发装置还包括:In one embodiment, the video key frame forwarding apparatus according to the embodiment of the present invention further includes:

优先级排序模块,用于接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;A priority sorting module is configured to receive a video forwarding request from a video requesting terminal, obtain information of a video source terminal matching the video forwarding request according to the video forwarding request, and perform a search for each video source terminal according to the information of the video source terminal. The terminal performs forwarding priority sorting and generates a forwarding priority list;

视频源终端选择模块,用于按照所述转发优先级列表的优先级顺序,选择优先级最高的视频源终端作为转发视频的视频源终端进行关键帧到达时间监测。The video source terminal selection module is configured to select the video source terminal with the highest priority as the video source terminal for forwarding video according to the priority order of the forwarding priority list to monitor the arrival time of key frames.

在一个实施例中,本发明实施例的视频关键帧转发装置还包括:In one embodiment, the video key frame forwarding apparatus according to the embodiment of the present invention further includes:

转发路数获取模块,用于获取所述视频请求终端的视频转发路数;a number of forwarding paths acquisition module, used for acquiring the number of video forwarding paths of the video requesting terminal;

所述视频源终端选择模块进一步用于按照所述转发优先级列表的优先级顺序,选择优先级最高的所述视频转发路数对应个数的视频源终端分别作为转发视频的视频源终端进行关键帧转发。The video source terminal selection module is further configured to, according to the priority order of the forwarding priority list, select the video source terminals corresponding to the number of the video forwarding paths with the highest priority as the video source terminals for forwarding the video respectively to perform key operations. Frame forwarding.

在一个实施例中,本发明实施例的视频关键帧转发装置还包括:In one embodiment, the video key frame forwarding apparatus according to the embodiment of the present invention further includes:

优先级排序模块,用于接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;A priority sorting module is configured to receive a video forwarding request from a video requesting terminal, obtain information of a video source terminal matching the video forwarding request according to the video forwarding request, and perform a search for each video source terminal according to the information of the video source terminal. The terminal performs forwarding priority sorting and generates a forwarding priority list;

所述视频源终端替换模块进一步用于若所述等待时间超出允许超时的时间阈值,则按照所述转发优先级列表的优先级顺序,在所述转发优先级列表中选择备选的视频源终端替换当前的视频源终端进行关键帧转发。The video source terminal replacement module is further configured to select an alternative video source terminal in the forwarding priority list according to the priority order of the forwarding priority list if the waiting time exceeds the time threshold that allows timeout Replace the current video source terminal for key frame forwarding.

在一个实施例中,所述优先级排序模块进一步用于根据获取的各个所述视频源终端的音频能量大小顺序进行优先级排序,生成视频源终端的转发优先级列表。In an embodiment, the priority sorting module is further configured to perform priority sorting according to the acquired audio energy size order of each of the video source terminals, and generate a forwarding priority list of the video source terminals.

在另一个实施例中,所述优先级排序模块进一步用于根据视频请求终端指定的视频源终端优先级信息进行优先级排序,生成视频源终端的转发优先级列表。In another embodiment, the priority sorting module is further configured to perform priority sorting according to the video source terminal priority information specified by the video request terminal to generate a forwarding priority list of the video source terminal.

在又一个实施例中,所述优先级排序模块进一步用于根据视频源终端接入的时间顺序进行优先级排序,生成视频源终端的转发优先级列表。In yet another embodiment, the priority sorting module is further configured to perform priority sorting according to the temporal order of video source terminal access, and generate a forwarding priority list of the video source terminal.

在一个实施例中,所述转发路数获取模块进一步用于根据视频请求终端的下行带宽获取所述视频请求终端可接收的视频转发路数。In one embodiment, the module for obtaining the number of forwarding channels is further configured to obtain the number of video forwarding channels that can be received by the video requesting terminal according to the downlink bandwidth of the video requesting terminal.

在另一个实施例中,所述转发路数获取模块进一步用于根据视频请求终端的解码能力获取所述视频请求终端可接收的视频转发路数。In another embodiment, the module for obtaining the number of forwarding channels is further configured to obtain the number of video forwarding channels that can be received by the video requesting terminal according to the decoding capability of the video requesting terminal.

本发明的视频关键帧转发系统与本发明的视频关键帧转发方法一一对应,在上述视频关键帧转发方法的实施例阐述的技术特征及其有益效果均适用于视频关键帧转发系统的实施例中,特此声明。The video key frame forwarding system of the present invention has a one-to-one correspondence with the video key frame forwarding method of the present invention, and the technical features and beneficial effects described in the embodiments of the video key frame forwarding method are applicable to the embodiments of the video key frame forwarding system , hereby declare.

基于如上所述的示例,在一个实施例中还提供一种计算机设备,该计算机设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现如上述各实施例中的任意一种视频关键帧转发方法。Based on the examples described above, in one embodiment there is also provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the During the program, any one of the video key frame forwarding methods in the foregoing embodiments is implemented.

上述计算机设备,通过所述处理器上运行的计算机程序,实现了通过监测视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。The above-mentioned computer equipment, through the computer program running on the processor, realizes that by monitoring the arrival time of the next key frame of the video source terminal, when the arrival time required to obtain the next key frame will exceed the time threshold of the allowable timeout, Then, the key frame request is actively sent to the video source terminal, which effectively avoids a long waiting time for the key frame, thereby effectively improving the forwarding efficiency of the key frame.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性的计算机可读取存储介质中,如本发明实施例中,该程序可存储于计算机系统的存储介质中,并被该计算机系统中的至少一个处理器执行,以实现包括如上述各睡眠辅助方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage In the medium, as in this embodiment of the present invention, the program may be stored in a storage medium of a computer system and executed by at least one processor in the computer system to implement the processes including the above-mentioned embodiments of the sleep assistance methods. The storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.

据此,在一个实施例中还提供一种存储介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如上述各实施例中的任意一种视频关键帧转发方法。Accordingly, in an embodiment, a storage medium is also provided, on which a computer program is stored, wherein, when the program is executed by a processor, any one of the video key frame forwarding methods in the foregoing embodiments is implemented.

上述计算机存储介质,通过其存储的计算机程序,实现了通过监测视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。The above-mentioned computer storage medium, through the computer program stored in it, realizes that by monitoring the arrival time of the next key frame of the video source terminal, when the arrival time required to obtain the next key frame exceeds the time threshold of the allowable timeout, it will actively send the The key frame request is sent to the video source terminal, which effectively avoids the long waiting time for the key frame, thereby effectively improving the forwarding efficiency of the key frame.

本领域的技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、随机存取存储器(RAM,Random Access Memory)、只读存储器(ROM,Read-Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Those skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by program instructions related to hardware, the aforementioned program may be stored in a computer-readable storage medium, and when the program is executed, execute Including the steps of the above method embodiment; and the aforementioned storage medium includes: a mobile storage device, a random access memory (RAM, Random Access Memory), a read-only memory (ROM, Read-Only Memory), a magnetic disk or an optical disk and other various A medium on which program code can be stored.

此外,本发明还提供一种视频直播系统,参见图7所示,包括:视频请求终端701、视频源终端702以及服务器设备703;其中,所述视频源终端702可以有一个或者多个,所述视频请求终端701和视频源终端702分别与服务器设备703通信连接;所述视频请求终端701用于发送视频转发请求至服务器设备703,并接收服务器设备703转发的来自所述视频源终端702的视频数据;所述视频源终端702用于周期性向所述服务器设备703发送关键帧,接收服务器设备703的视频数据请求,并转发对应的视频数据至所述服务器设备703;所述服务器设备703用于执行如上任意一个实施例的视频关键帧转发方法,并用于在将接收的所述关键帧转发至请求转发视频的视频请求终端701时,还用于将对应的视频源终端702的视频数据转发至请求转发视频的视频请求终端701。In addition, the present invention also provides a live video system, as shown in FIG. 7 , including: a video request terminal 701, a video source terminal 702, and a server device 703; wherein, the video source terminal 702 may have one or more, so The video request terminal 701 and the video source terminal 702 are respectively connected in communication with the server device 703; the video request terminal 701 is used to send a video forwarding request to the server device 703, and receive the video source terminal 702 forwarded by the server device 703. Video data; the video source terminal 702 is used to periodically send key frames to the server device 703, receive video data requests from the server device 703, and forward the corresponding video data to the server device 703; the server device 703 uses For executing the video key frame forwarding method of any one of the above embodiments, and for forwarding the received key frame to the video requesting terminal 701 requesting to forward the video, it is also used for forwarding the video data of the corresponding video source terminal 702. To the video request terminal 701 that requests to forward the video.

上述视频直播系统,视频源终端周期性向所述服务器发送关键帧,服务器接收视频请求终端的视频转发请求,监测视频源终端下一关键帧的到达时间,在获取到下一关键帧需要的到达时间会超出允许超时的时间阈值时,则主动发送关键帧请求至该视频源终端,有效避免关键帧等待时间过长,从而有效提升关键帧的转发效率。In the above-mentioned live video system, the video source terminal periodically sends key frames to the server, and the server receives the video forwarding request from the video requesting terminal, monitors the arrival time of the next key frame of the video source terminal, and obtains the arrival time required for the next key frame after obtaining the next key frame. When the allowable timeout time threshold is exceeded, it will actively send a key frame request to the video source terminal, which can effectively prevent the key frame from waiting too long, thereby effectively improving the key frame forwarding efficiency.

以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity, all possible combinations of the technical features in the above-described embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be regarded as the scope described in this specification.

以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present invention, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can also be made, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention should be subject to the appended claims.

Claims (17)

1.一种视频关键帧转发方法,其特征在于,应用于服务器,包括如下步骤:1. a video key frame forwarding method, is characterized in that, is applied to server, comprises the steps: 获取转发视频的视频源终端的下一关键帧到达所需的到达时间,其中,所述关键帧为视频源终端周期性发送的关键帧;Obtain the arrival time required for the arrival of the next key frame of the video source terminal that forwards the video, wherein the key frame is a key frame periodically sent by the video source terminal; 若所述到达时间超出允许超时的时间阈值,则向所述视频源终端发送关键帧请求,并等待关键帧到达;If the arrival time exceeds the time threshold that allows timeout, send a key frame request to the video source terminal, and wait for the key frame to arrive; 在等待关键帧到达时,记录关键帧到达前等待的等待时间;When waiting for the key frame to arrive, record the waiting time before the key frame arrives; 若所述等待时间超出允许超时的时间阈值,则从备选的视频源终端中选择一个替换当前的视频源终端进行关键帧转发;If the waiting time exceeds the time threshold that allows timeout, then select a replacement current video source terminal from the alternative video source terminals to perform key frame forwarding; 在所述关键帧到达时,接收到达的关键帧并将接收的所述关键帧转发至视频请求终端。When the key frame arrives, the arrived key frame is received and the received key frame is forwarded to the video requesting terminal. 2.根据权利要求1所述的视频关键帧转发方法,其特征在于,所述获取待转发视频的视频源终端的下一关键帧到达所需的到达时间的步骤之后,还包括:若所述到达时间未超出允许超时的时间阈值,则等待关键帧到达。2. The video key frame forwarding method according to claim 1, wherein after the step of obtaining the required arrival time for the arrival of the next key frame of the video source terminal of the video to be forwarded, further comprising: if the described If the arrival time does not exceed the time threshold allowed for timeout, wait for the key frame to arrive. 3.根据权利要求1所述的视频关键帧转发方法,其特征在于,所述获取转发视频的视频源终端的下一关键帧到达所需的到达时间之前,还包括:3. The video key frame forwarding method according to claim 1, wherein before the next key frame of the video source terminal that obtains the forwarded video arrives at the required arrival time, further comprising: 接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;receiving a video forwarding request from a video requesting terminal, obtaining information of a video source terminal matching the video forwarding request according to the video forwarding request, and performing forwarding priority sorting on each video source terminal according to the information of the video source terminal, Generate a forwarding priority list; 按照所述转发优先级列表的优先级顺序,选择优先级最高的视频源终端作为转发视频的视频源终端进行关键帧到达时间监测。According to the priority order of the forwarding priority list, the video source terminal with the highest priority is selected as the video source terminal for forwarding the video to monitor the arrival time of the key frame. 4.根据权利要求3所述的视频关键帧转发方法,其特征在于,还包括步骤:4. video key frame forwarding method according to claim 3, is characterized in that, also comprises the step: 获取所述视频请求终端的视频转发路数;obtaining the video forwarding paths of the video requesting terminal; 所述选择优先级最高的视频源终端作为转发视频的视频源终端进行关键帧到达时间监测的步骤包括:The step of selecting the video source terminal with the highest priority as the video source terminal for forwarding the video to monitor the arrival time of key frames includes: 按照所述转发优先级列表的优先级顺序,选择优先级最高的所述转发路数对应个数的视频源终端分别作为转发视频的视频源终端进行关键帧到达时间监测。According to the priority order of the forwarding priority list, the video source terminals corresponding to the number of forwarding paths with the highest priority are selected as the video source terminals for forwarding the video respectively to monitor the arrival time of key frames. 5.根据权利要求1所述的视频关键帧转发方法,其特征在于,还包括:5. video key frame forwarding method according to claim 1, is characterized in that, also comprises: 接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;receiving a video forwarding request from a video requesting terminal, obtaining information of a video source terminal matching the video forwarding request according to the video forwarding request, and performing forwarding priority sorting on each video source terminal according to the information of the video source terminal, Generate a forwarding priority list; 所述若所述等待时间超出允许超时的时间阈值,则从备选的视频源终端中选择一个替换当前的视频源终端进行关键帧转发的步骤包括:Described if the described waiting time exceeds the time threshold that allows timeout, then the step of selecting a replacement current video source terminal from the alternative video source terminal to perform key frame forwarding includes: 若所述等待时间超出允许超时的时间阈值,则按照所述转发优先级列表的优先级顺序,在所述转发优先级列表中选择备选的视频源终端替换当前的视频源终端进行关键帧转发。If the waiting time exceeds the time threshold for allowing timeout, select an alternative video source terminal in the forwarding priority list to replace the current video source terminal to perform key frame forwarding according to the priority order of the forwarding priority list . 6.根据权利要求3或5所述的视频关键帧转发方法,其特征在于,所述根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表的步骤包括:6. The video key frame forwarding method according to claim 3 or 5, wherein the forwarding priority sorting is performed on each video source terminal according to the information of the video source terminal, and the step of generating a forwarding priority list comprises the following steps: : 根据获取的各个所述视频源终端的音频能量大小顺序进行优先级排序,生成视频源终端的转发优先级列表;Perform priority sorting according to the obtained audio energy size order of each of the video source terminals, and generate a forwarding priority list of the video source terminals; or 根据视频请求终端指定的视频源终端优先级信息进行优先级排序,生成视频源终端的转发优先级列表;Perform priority sorting according to the priority information of the video source terminal specified by the video request terminal, and generate a forwarding priority list of the video source terminal; or 根据视频源终端接入的时间顺序进行优先级排序,生成视频源终端的转发优先级列表。The priority is sorted according to the time sequence of the access of the video source terminal, and the forwarding priority list of the video source terminal is generated. 7.根据权利要求4所述的视频关键帧转发方法,其特征在于,所述获取所述视频请求终端的视频转发路数的步骤包括:7. The video key frame forwarding method according to claim 4, wherein the step of acquiring the number of video forwarding paths of the video requesting terminal comprises: 根据视频请求终端的下行带宽获取所述视频请求终端可接收的视频转发路数;Acquire the number of video forwarding paths that can be received by the video requesting terminal according to the downlink bandwidth of the video requesting terminal; or 根据视频请求终端的解码能力获取所述视频请求终端可接收的视频转发路数。The number of video forwarding paths that can be received by the video requesting terminal is acquired according to the decoding capability of the video requesting terminal. 8.一种视频关键帧转发装置,其特征在于,应用于服务器,包括:8. A video key frame forwarding device, characterized in that, applied to a server, comprising: 关键帧监测模块,用于获取转发视频的视频源终端的下一关键帧到达所需的到达时间,其中,所述关键帧为视频源终端周期性发送的关键帧;A key frame monitoring module, used to obtain the arrival time required for the arrival of the next key frame of the video source terminal that forwards the video, wherein the key frame is a key frame periodically sent by the video source terminal; 关键帧请求模块,用于若所述到达时间超出允许超时的时间阈值,则向所述视频源终端发送关键帧请求,并等待关键帧到达;A key frame request module, configured to send a key frame request to the video source terminal if the arrival time exceeds the time threshold that allows timeout, and wait for the key frame to arrive; 等待时间记录模块,用于在等待关键帧到达时,记录关键帧到达前等待的等待时间;The waiting time recording module is used to record the waiting time before the key frame arrives when waiting for the key frame to arrive; 视频源终端替换模块,用于若所述等待时间超出允许超时的时间阈值,则从备选的视频源终端中选择一个替换当前的视频源终端进行关键帧转发;A video source terminal replacement module, used for if the waiting time exceeds the time threshold of the allowable timeout, then select a replacement current video source terminal from the alternative video source terminals to perform key frame forwarding; 关键帧转发模块,用于在所述关键帧到达时,接收到达的关键帧并将接收的所述关键帧转发至视频请求终端。A key frame forwarding module is configured to, when the key frame arrives, receive the arrived key frame and forward the received key frame to the video requesting terminal. 9.根据权利要求8所述的视频关键帧转发装置,其特征在于,所述视频关键帧转发装置还包括:9. The video key frame forwarding device according to claim 8, wherein the video key frame forwarding device further comprises: 关键帧等待模块,用于若所述到达时间未超出允许超时的时间阈值,则等待关键帧到达。The key frame waiting module is configured to wait for the key frame to arrive if the arrival time does not exceed the time threshold allowed for timeout. 10.根据权利要求8所述的视频关键帧转发装置,其特征在于,所述视频关键帧转发装置还包括:10. The video key frame forwarding device according to claim 8, wherein the video key frame forwarding device further comprises: 优先级排序模块,用于接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;A priority sorting module is configured to receive a video forwarding request from a video requesting terminal, obtain information of a video source terminal matching the video forwarding request according to the video forwarding request, and perform a search for each video source terminal according to the information of the video source terminal. The terminal performs forwarding priority sorting and generates a forwarding priority list; 视频源终端选择模块,用于按照所述转发优先级列表的优先级顺序,选择优先级最高的视频源终端作为转发视频的视频源终端进行关键帧到达时间监测。The video source terminal selection module is configured to select the video source terminal with the highest priority as the video source terminal for forwarding video according to the priority order of the forwarding priority list to monitor the arrival time of key frames. 11.根据权利要求10所述的视频关键帧转发装置,其特征在于,所述视频关键帧转发装置还包括:11. The video key frame forwarding device according to claim 10, wherein the video key frame forwarding device further comprises: 转发路数获取模块,用于获取所述视频请求终端的视频转发路数;a number of forwarding paths acquisition module, used for acquiring the number of video forwarding paths of the video requesting terminal; 所述视频源终端选择模块还用于,按照所述转发优先级列表的优先级顺序,选择优先级最高的所述转发路数对应个数的视频源终端分别作为转发视频的视频源终端进行关键帧到达时间监测。The video source terminal selection module is further configured to, according to the priority order of the forwarding priority list, select the video source terminals corresponding to the number of the forwarding paths with the highest priority as the video source terminals for forwarding the video respectively to perform key operations. Frame arrival time monitoring. 12.根据权利要求8所述的视频关键帧转发装置,其特征在于,所述视频关键帧转发装置还包括:12. The video key frame forwarding device according to claim 8, wherein the video key frame forwarding device further comprises: 优先级排序模块,用于接收视频请求终端的视频转发请求,根据所述视频转发请求,获取与所述视频转发请求匹配的视频源终端的信息,根据所述视频源终端的信息对各个视频源终端进行转发优先级排序,生成转发优先级列表;A priority sorting module is configured to receive a video forwarding request from a video requesting terminal, obtain information of a video source terminal matching the video forwarding request according to the video forwarding request, and perform a search for each video source terminal according to the information of the video source terminal. The terminal performs forwarding priority sorting and generates a forwarding priority list; 所述视频源终端替换模块还用于,若所述等待时间超出允许超时的时间阈值,则按照所述转发优先级列表的优先级顺序,在所述转发优先级列表中选择备选的视频源终端替换当前的视频源终端进行关键帧转发。The video source terminal replacement module is further configured to, if the waiting time exceeds the time threshold that allows timeout, select an alternative video source in the forwarding priority list according to the priority order of the forwarding priority list The terminal replaces the current video source terminal to forward key frames. 13.根据权利要求10或12所述的视频关键帧转发装置,其特征在于,所述优先级排序模块还用于:13. The video key frame forwarding device according to claim 10 or 12, wherein the priority sorting module is further used for: 根据获取的各个所述视频源终端的音频能量大小顺序进行优先级排序,生成视频源终端的转发优先级列表;Perform priority sorting according to the obtained audio energy size order of each of the video source terminals, and generate a forwarding priority list of the video source terminals; or 根据视频请求终端指定的视频源终端优先级信息进行优先级排序,生成视频源终端的转发优先级列表;Perform priority sorting according to the priority information of the video source terminal specified by the video request terminal, and generate a forwarding priority list of the video source terminal; or 根据视频源终端接入的时间顺序进行优先级排序,生成视频源终端的转发优先级列表。The priority is sorted according to the time sequence of the access of the video source terminal, and the forwarding priority list of the video source terminal is generated. 14.根据权利要求11所述的视频关键帧转发装置,其特征在于,所述转发路数获取模块还用于:14. video key frame forwarding device according to claim 11, is characterized in that, described forwarding path number acquisition module is also used for: 根据视频请求终端的下行带宽获取所述视频请求终端可接收的视频转发路数;Acquire the number of video forwarding paths that can be received by the video requesting terminal according to the downlink bandwidth of the video requesting terminal; or 根据视频请求终端的解码能力获取所述视频请求终端可接收的视频转发路数。The number of video forwarding paths that can be received by the video requesting terminal is acquired according to the decoding capability of the video requesting terminal. 15.一种视频直播系统,包括:视频请求终端、视频源终端以及服务器设备;其中,所述视频请求终端和视频源终端分别与服务器设备通信连接;15. A live video system, comprising: a video request terminal, a video source terminal, and a server device; wherein, the video request terminal and the video source terminal are respectively connected in communication with the server device; 所述视频请求终端用于发送视频转发请求至服务器设备,并接收服务器设备转发的来自所述视频源终端的视频数据;The video request terminal is configured to send a video forwarding request to the server device, and receive video data from the video source terminal forwarded by the server device; 所述视频源终端用于周期性向所述服务器设备发送关键帧,接收服务器设备的视频数据请求,并转发对应的视频数据至所述服务器设备;The video source terminal is configured to periodically send key frames to the server device, receive a video data request from the server device, and forward corresponding video data to the server device; 所述服务器设备用于执行如权利要求1至7任意一项所述的视频关键帧转发方法,并用于在将接收的所述关键帧转发至请求转发视频的视频请求终端时,还用于将对应的视频源终端的视频数据转发至请求转发视频的视频请求终端。The server device is configured to perform the video key frame forwarding method according to any one of claims 1 to 7, and is configured to forward the received key frame to the video requesting terminal requesting to forward the video, and also to forward the video key frame. The video data of the corresponding video source terminal is forwarded to the video requesting terminal that requests to forward the video. 16.一种计算机设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7任意一项所述的视频关键帧转发方法。16. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the computer program as claimed in the claims The video key frame forwarding method described in any one of 1 to 7. 17.一种计算机存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1至7任意一项所述的视频关键帧转发方法。17. A computer storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the video key frame forwarding method according to any one of claims 1 to 7 is implemented.
CN201810229537.3A 2018-03-20 2018-03-20 Video key frame forwarding method, device and live video system Active CN108259815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810229537.3A CN108259815B (en) 2018-03-20 2018-03-20 Video key frame forwarding method, device and live video system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810229537.3A CN108259815B (en) 2018-03-20 2018-03-20 Video key frame forwarding method, device and live video system

Publications (2)

Publication Number Publication Date
CN108259815A CN108259815A (en) 2018-07-06
CN108259815B true CN108259815B (en) 2020-09-01

Family

ID=62746175

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810229537.3A Active CN108259815B (en) 2018-03-20 2018-03-20 Video key frame forwarding method, device and live video system

Country Status (1)

Country Link
CN (1) CN108259815B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113965714B (en) * 2021-09-10 2023-06-23 北京百度网讯科技有限公司 Video stream processing method, device, electronic device and storage medium
CN115633150B (en) * 2022-10-11 2025-08-26 广州市奥威亚电子科技有限公司 Video transmission method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101316357A (en) * 2008-06-30 2008-12-03 华为技术有限公司 A channel switching method, terminal and media server
CN101383959A (en) * 2008-10-23 2009-03-11 中兴通讯股份有限公司 Method, system and user equipment for acquiring key frames in streaming media service
CN102801508A (en) * 2012-07-26 2012-11-28 苏州科达科技有限公司 Control method for processing network packet loss
CN103780972A (en) * 2012-10-19 2014-05-07 三星电子株式会社 Server, client device, and control methods thereof
CN105100830A (en) * 2015-07-23 2015-11-25 中国科学院声学研究所 Device and method for quickly switching video sources based on video aggregation service

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8666042B2 (en) * 2011-11-02 2014-03-04 Cisco Technology, Inc. Techniques for performing key frame requests in media servers and endpoint devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101316357A (en) * 2008-06-30 2008-12-03 华为技术有限公司 A channel switching method, terminal and media server
CN101383959A (en) * 2008-10-23 2009-03-11 中兴通讯股份有限公司 Method, system and user equipment for acquiring key frames in streaming media service
CN102801508A (en) * 2012-07-26 2012-11-28 苏州科达科技有限公司 Control method for processing network packet loss
CN103780972A (en) * 2012-10-19 2014-05-07 三星电子株式会社 Server, client device, and control methods thereof
CN105100830A (en) * 2015-07-23 2015-11-25 中国科学院声学研究所 Device and method for quickly switching video sources based on video aggregation service

Also Published As

Publication number Publication date
CN108259815A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
CN106488273B (en) A kind of method and apparatus for transmitting live video
US11405448B1 (en) Systems and methods for adaptively improving the perceived quality of a video conference by passive users
US9626217B2 (en) Information processing apparatus, information processing method, recording medium and information processing system
CN109309698B (en) Data processing system, method and apparatus
WO2020248909A1 (en) Video decoding method and apparatus, computer device, and storage medium
US10469627B2 (en) Rapid optimization of media stream bitrate
CN107846621A (en) Delay process method, system and electronic equipment
US10482568B2 (en) Information processor and information processing method
US10178143B2 (en) Selecting bitrate to stream encoded media based on tagging of important media segments
US9866602B2 (en) Adaptive bit rates during broadcast transmission in distributed content delivery networks
CN106921865A (en) Method for processing video frequency and device
WO2017166496A1 (en) Method and device for downloading video file, and method and device providing video file
CN108259815B (en) Video key frame forwarding method, device and live video system
CN111385660B (en) Video on demand method, device, equipment and storage medium
CN105144732B (en) Video switching device, video switching method, program and information processing device
US20140099040A1 (en) Image processing device and image processing method
CN114501053B (en) Live stream acquisition method and device
CN113747100B (en) Audio and video call methods, devices, storage media and electronic equipment
WO2020220534A1 (en) Middleware-based data processing method and related apparatus
CN108616576A (en) A kind of method and apparatus of scheduling application server
US20220303306A1 (en) Compression of uniform resource locator sequences for machine learning-based detection of target category examples
CN114339268A (en) Live broadcast data processing method and device and computer readable storage medium
CN113852866A (en) Media stream processing method, device and system
KR102247888B1 (en) System for cloud streaming service, method of image cloud streaming service based on selective streaming pipeline method and apparatus for the same
US11070436B2 (en) Communication control apparatus, communication apparatus, control methods thereof, and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant