A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://patents.google.com/patent/CN103297519B/en below:

CN103297519B - Method and system for transmitting video stream for coding and decoding clusters

具体实施方式detailed description

下面以具体实施例的方式对本发明的方案进行详细描述。The solutions of the present invention will be described in detail below in the form of specific examples.

图1所示,是本发明编解码集群传输视频流的方法实施例一的流程示意图。As shown in FIG. 1 , it is a schematic flowchart of Embodiment 1 of the method for encoding and decoding cluster transmission of video streams according to the present invention.

所述编解码集群传输视频流的方法包括以下步骤:The method for the codec cluster transmission video stream includes the following steps:

步骤101,获取预设时段内向多个编码设备中的第一编码设备请求视频流的解码设备的数量。所述预设时段,优选地可以是3秒、5秒、10秒或30秒等,可根据解码设备请求视频流的频率或第一编码设备的一些传输属性设定。所述第一编码设备可以是所述多个编码设备中的任意一个编码设备。Step 101, acquiring the number of decoding devices requesting video streams from a first encoding device among multiple encoding devices within a preset period of time. The preset period, preferably 3 seconds, 5 seconds, 10 seconds or 30 seconds, etc., can be set according to the frequency of video stream requests from the decoding device or some transmission properties of the first encoding device. The first encoding device may be any encoding device in the plurality of encoding devices.

在本步骤中,优选地,在预设时段内,可根据解码设备的IP(Internet Protocol,网络之间互连的协议)地址或预设身份标识,识别向所述第一编码设备请求视频流的解码设备,从而统计得出其具体数值。所述预设身份标识优选地为解码设备的设备名称或编号。In this step, preferably, within a preset period of time, according to the decoding device's IP (Internet Protocol, a protocol for interconnection between networks) address or a preset identity, it can be identified that the video stream is requested from the first encoding device The decoding equipment, so as to obtain its specific value statistically. The preset identity is preferably a device name or serial number of the decoding device.

步骤102,请求所述视频流的解码设备的数量高于预设值时,从多个编码设备中除所述第一编码设备外其他的编码设备中选取至少一个编码设备作为待发送所述视频流的编码设备。Step 102: When the number of decoding devices requesting the video stream is higher than a preset value, select at least one encoding device from among the plurality of encoding devices except the first encoding device as the video stream to be sent. The encoding device for the stream.

在本步骤中,优选地,所述预设值可根据所述第一编码设备在不影响自身编码效率的情况下最多能同时传输的所述视频流的链路的路数设定。若第一编码设备能同时传输6路视频流,可将预设值设置为6,也可以设置为1至5之间任意值。优选地,所述预设值也可根据执行步骤1之前所述第一编码设备的可用带宽设定。In this step, preferably, the preset value can be set according to the maximum number of links of the video streams that the first encoding device can simultaneously transmit without affecting its own encoding efficiency. If the first encoding device can transmit 6 video streams at the same time, the preset value can be set to 6, or can be set to any value between 1 and 5. Preferably, the preset value can also be set according to the available bandwidth of the first encoding device before step 1 is performed.

在本发明的一实施例中,在执行上述步骤中从多个编码设备中除第一编码设备外其他的编码设备中选取至少一个编码设备作为待发送所述视频流的编码设备的操作之前,还可执行以下操作:In an embodiment of the present invention, before performing the operation of selecting at least one encoding device from among the plurality of encoding devices except the first encoding device in the above steps as the encoding device to transmit the video stream, You can also do the following:

获取所述第一编码设备当前可用的带宽(剩余带宽),将所述当前可用的带宽和所述第一编码设备的带宽阈值比较;所述当前可用的带宽大于所述带宽阈值时,选取所述第一编码设备作为待发送所述视频流的编码设备。优选地,所述带宽阈值大于或等于同时传送2路所述视频流所需占用的带宽值。若带宽阈值等于2路视频流占用的带宽,其中,1路用于向其他编码设备传送作为源数据的所述视频流,1路用于向请求所述视频流的解码设备传送所述视频流。Obtain the currently available bandwidth (remaining bandwidth) of the first encoding device, and compare the currently available bandwidth with the bandwidth threshold of the first encoding device; when the currently available bandwidth is greater than the bandwidth threshold, select the The first coding device is used as the coding device to send the video stream. Preferably, the bandwidth threshold is greater than or equal to the bandwidth value required for simultaneous transmission of two video streams. If the bandwidth threshold is equal to the bandwidth occupied by two channels of video streams, one channel is used to transmit the video stream as source data to other encoding devices, and the other channel is used to transmit the video stream to the decoding device requesting the video stream .

上述操作用于判断所述第一编码设备是否可作为待发送所述视频流的编码设备。选取第一编码设备作为发送所述视频流的编码设备,可优先向急需所述视频流或较早时间请求所述视频流的解码设备发送所述视频流。在本发明的其他实施例中,可直接跳过上述操作,发送所述视频流的编码设备全部从多个编码设备中除所述第一编码设备之外的其他编码设备中选取。The foregoing operations are used to determine whether the first encoding device can be used as an encoding device to send the video stream. The first coding device is selected as the coding device for sending the video stream, and the video stream may be preferentially sent to the decoding device that urgently needs the video stream or requests the video stream earlier. In other embodiments of the present invention, the above operations may be directly skipped, and all encoding devices sending the video stream are selected from other encoding devices except the first encoding device among the plurality of encoding devices.

在本发明的一实施例中,优选地,所述从多个编码设备中除第一编码设备外其他的编码设备中选取至少一个编码设备作为待发送所述视频流的编码设备的步骤可包括以下步骤:In an embodiment of the present invention, preferably, the step of selecting at least one encoding device from among the plurality of encoding devices except the first encoding device as the encoding device to transmit the video stream may include The following steps:

获取所述其他的编码设备中每个编码设备当前可用的带宽(剩余带宽)。Obtain the currently available bandwidth (remaining bandwidth) of each encoding device in the other encoding devices.

选取前N个剩余带宽值最大的编码设备作为待发送所述视频流的编码设备,所述N为大于或等于1的自然数。若多个编码设备的剩余带宽值相等,则可优选与第一编码设备的物理距离小的编码设备。在本操作中,优选地,也可不完全选取剩余带宽值大的编码设备。可根据请求所述视频流的解码设备的数量,以及传输单个所述视频流所需占用带宽,计算得出同时将所述视频流传送至所有请求所述视频流的解码设备所需要的总带宽,而后在选取解码设备时,选取的至少一个编码设备的剩余带宽值的总和恰好能满足所需的所述总带宽。也可使用其他本领域管用技术手段选取待发送所述视频流的编码设备。Select the first N coding devices with the largest remaining bandwidth values as the coding devices to send the video stream, where N is a natural number greater than or equal to 1. If the remaining bandwidth values of multiple encoding devices are equal, the encoding device with a smaller physical distance from the first encoding device may be preferred. In this operation, preferably, an encoding device with a large residual bandwidth value may not be completely selected. The total bandwidth required to transmit the video stream to all decoding devices requesting the video stream at the same time can be calculated according to the number of decoding devices requesting the video stream and the bandwidth required to transmit a single video stream , and then when the decoding device is selected, the sum of the remaining bandwidth values of at least one selected encoding device can just meet the required total bandwidth. Other effective technical means in the field may also be used to select the encoding device to send the video stream.

上述选取发送所述视频流的编码设备的方式,根据除第一编码设备外的其他编码设备的传输性能(可用带宽),选取传输性能较高的编码设备,既能减少选取的编码设备的数量,又能更快的将所述视频流传输至请求所述视频流的解码设备。In the above method of selecting the encoding device for sending the video stream, according to the transmission performance (available bandwidth) of other encoding devices except the first encoding device, select the encoding device with higher transmission performance, which can reduce the number of selected encoding devices , and the video stream can be transmitted to the decoding device requesting the video stream more quickly.

在本发明的另一实施例中,优选地,所述从多个编码设备中除第一编码设备外其他的编码设备中选取至少一个编码设备作为待发送所述视频流的编码设备的步骤还可包括以下步骤:In another embodiment of the present invention, preferably, the step of selecting at least one encoding device from among the plurality of encoding devices except the first encoding device as the encoding device to transmit the video stream further May include the following steps:

依次选取所述其他的编码设备其中的一个,优选地,可根据所述其他编码设备与所述第一编码设备的物理距离从大到小依次选取,也可根据预设的编号或IP地址依次选取。Select one of the other encoding devices in turn, preferably, according to the physical distance between the other encoding devices and the first encoding device in order from large to small, or according to the preset number or IP address select.

对于每次选取的一个编码设备,判断所述编码设备当前可用的带宽是否高于预设带宽值(统一设定的比较值)或所述选取的编码设备的带宽阈值(根据编码设备自身工作状况设定),若高于,选取所述编码设备作为待发送所述视频流的编码设备。For one coding device selected each time, it is judged whether the currently available bandwidth of the coding device is higher than the preset bandwidth value (comparison value set uniformly) or the bandwidth threshold of the selected coding device (according to the working condition of the coding device itself) setting), if higher, select the encoding device as the encoding device to send the video stream.

判断作为待发送所述视频流的编码设备的数量是否超过预设数量,若超过,停止选取和判断。Judging whether the number of encoding devices to be sent the video stream exceeds a preset number, and if so, stop selecting and judging.

若不高于,跳过所述编码设备。If not higher, skip the encoding device.

上述选取编码设备的方式,随机性较大,但是,该方式可自动、快速的选取编码设备,也适用用于无法获取所述编码设备的可用带宽的情况。The above method of selecting the encoding device is quite random, but this method can automatically and quickly select the encoding device, and is also applicable to the situation where the available bandwidth of the encoding device cannot be obtained.

步骤103,将所述视频流发送至选取的编码设备,通过所述选取的编码设备将所述视频流传送至对应的解码设备。Step 103: Send the video stream to a selected encoding device, and transmit the video stream to a corresponding decoding device through the selected encoding device.

在本发明的一实施例中,优选地,可通过所述第一编码设备将所述视频流发送至所有所述选取的编码设备。可同时将所述视频流传送至所有的所述选取的编码设备,也可按时序将依次所述视频流传送至所有的所述选取的编码设备。这种通过第一编码设备将所述视频流传送至所述选取的编码设备的方式,可避免面所述选取的编码设备因彼此互传所述视频流而消耗可用带宽。In an embodiment of the present invention, preferably, the first encoding device may send the video stream to all the selected encoding devices. The video stream may be transmitted to all the selected encoding devices at the same time, or the video stream may be transmitted sequentially to all the selected encoding devices in time sequence. This method of transmitting the video stream to the selected encoding device through the first encoding device can prevent the selected encoding devices from consuming available bandwidth due to mutual transmission of the video stream.

优选地,也可先通过所述第一编码设备将所述视频流传送至所述选取的编码设备中的任意一个编码设备,然后再通过所述任意一个编码设备将所述视频流传送至所述选取的编码设备中的其他编码设备。所述选取的编码设备中任意一个获取所述视频流后,可根据预设顺序或根据编码设备间的物理距离,将所述视频流在所述选取的编码设备中的其他编码设备中互传。如,获得所述视频流的编码设备都将所述视频流传送至相距最近的编码设备,或获得所述视频流的编码设备都将所述视频流传送至编号接近的编码设备,或获得所述视频流的编码设备都将所述视频流传送至剩余带宽仅次的编码设备。上述在选取的编码设备间传输视频流的方式,可节约第一编码设备的带宽。Preferably, the video stream may also be transmitted to any one of the selected encoding devices through the first encoding device first, and then the video stream is transmitted to the selected encoding device through the arbitrary one encoding device. Other coding devices in the selected coding devices mentioned above. After any one of the selected encoding devices obtains the video stream, the video stream may be transmitted to other encoding devices among the selected encoding devices according to a preset sequence or according to the physical distance between the encoding devices . For example, the coding devices that obtain the video streams all transmit the video streams to the nearest coding device, or the coding devices that obtain the video streams all transmit the video streams to coding devices with close numbers, or obtain all All encoding devices for the above video streams transmit the video streams to the encoding device with the second largest remaining bandwidth. The foregoing method of transmitting video streams between selected encoding devices can save the bandwidth of the first encoding device.

在本发明的一实施例中,确定好请求所述视频流的解码设备与待发送所述视频流的编码设备后,优选地,可通过以下操作,确定解码设备与编码设备间的连接链路(对应关系或视频传送链路):In an embodiment of the present invention, after the decoding device requesting the video stream and the encoding device to be sent the video stream are determined, preferably, the connection link between the decoding device and the encoding device can be determined through the following operations (correspondence or video transmission link):

首先,根据所述选取的编码设备中每个编码设备当前可用的带宽,确定每个编码设备能同时发送的所述视频流的路数。First, according to the currently available bandwidth of each encoding device among the selected encoding devices, determine the number of channels of the video stream that each encoding device can send simultaneously.

根据所述能同时发送的所述视频流的路数,确定每个编码设备对应的解码设备。According to the number of video streams that can be sent simultaneously, the decoding device corresponding to each encoding device is determined.

使用所述选取的编码设备将所述视频流传送至所述对应的解码设备。Transmitting the video stream to the corresponding decoding device using the selected encoding device.

在上述操作中,若选取的编码设备足够多或其剩余带宽总和足够,仅通过一次映射即可将所有编码设备与所有解码设备链路对应。若不足,那么可以分批映射对应。In the above operations, if enough encoding devices are selected or the sum of their remaining bandwidths is sufficient, all encoding devices can be linked to all decoding devices through only one mapping. If it is not enough, then it can be mapped in batches.

在本发明的另一实施例中,确定好请求所述视频流的解码设备与待发送所述视频流的编码设备后,优选地,根据预设的对应关系或传输顺序,使用所述选取的编码设备将所述视频流传送至所述对应的解码设备。所述传输顺序可以是按编码设备与解码设备的IP地址预设的传输视频流的先后顺序,也可以根据编码设备与解码设备的编号预设的传输视频流的先后顺序。如,编号大的编码设备优先向编号大的解码设备传送所述视频流。In another embodiment of the present invention, after the decoding device requesting the video stream and the encoding device to be sent the video stream are determined, preferably, according to the preset corresponding relationship or transmission sequence, the selected The encoding device transmits the video stream to the corresponding decoding device. The transmission sequence may be a preset sequence of transmitting video streams according to the IP addresses of the encoding device and the decoding device, or may be a preset sequence of transmitting video streams according to the numbers of the encoding device and the decoding device. For example, an encoding device with a large number preferentially transmits the video stream to a decoding device with a large number.

在本发明方法的实施例中,优选地,可循环执行图1中的步骤102和103,即:在步骤102中每选取出预设个数的(1个或多个)作为待发送所述视频流的编码设备,立即执行步骤103的步骤,然后回到步骤102继续选取编码设备,直至请求所述视频流的所有解码设备都接收到所述视频流为止。优选地,也可仅执行一次步骤102,一次性选取足够的编码设备。In the embodiment of the method of the present invention, preferably, steps 102 and 103 in FIG. 1 can be executed cyclically, that is, in step 102, a preset number (1 or more) is selected as the to-be-sent The encoding device of the video stream immediately executes step 103, and then returns to step 102 to continue selecting encoding devices until all decoding devices requesting the video stream receive the video stream. Preferably, step 102 may also be performed only once to select enough encoding devices at one time.

图2所示,是本发明编解码集群传输视频流的方法实施例二的流程示意图。FIG. 2 is a schematic flowchart of Embodiment 2 of the method for encoding and decoding cluster transmission of video streams according to the present invention.

在本实施例中,编解码集群包括20个编码设备和20个解码设备,编码设备与解码设备间的网络设备可包括交换机和路由器,支持广域网。在其他实施例中,编解码集群中的编码设备和解码设备的数量可更多或者更少,网络设备也可以是支持局域网的设备。In this embodiment, the codec cluster includes 20 encoding devices and 20 decoding devices, and the network devices between the encoding devices and the decoding devices may include switches and routers to support wide area networks. In other embodiments, the number of encoding devices and decoding devices in the codec cluster may be more or less, and the network device may also be a device supporting a local area network.

在本实施例中,编解码集群传输视频流的方法流程(软件程序)安装在一台控制PC(personal computer),控制PC通过网络设备与编解码集群中的各编码设备和各解码设备连接。In this embodiment, the method flow (software program) for the codec cluster to transmit video streams is installed on a control PC (personal computer), and the control PC is connected to each encoding device and each decoding device in the codec cluster through a network device.

在本实施例中,编解码集群中的每个编码设备在不影响编码效率的情况下,最多能同时对外发送或接收7路视频数据。解码设备优选地与编码设备具有相同性能。在本实施例中,以下20个IP地址用于标示20个解码设备:192.168.1.10、192.168.1.11、192.168.1.12、...192.168.1.29。子网掩码为255.255.255.0。以下以编码设备10到编码设备29来表征20个编码设备。20解码设备的IP地址为:192.168.2.10、192.168.2.10、…192.168.2.29。子网掩码为255.255.255.0。以下以解码设备10到解码设备29来表征20个解码设备。这样通过路由器模拟成广域网环境,控制PC的IP地址设置为192.168.1.30,预先将上述所有IP地址进行存储。In this embodiment, each coding device in the codec cluster can send or receive up to 7 channels of video data at the same time without affecting the coding efficiency. The decoding device preferably has the same capabilities as the encoding device. In this embodiment, the following 20 IP addresses are used to identify 20 decoding devices: 192.168.1.10, 192.168.1.11, 192.168.1.12, ... 192.168.1.29. The subnet mask is 255.255.255.0. The 20 encoding devices are identified below as encoding devices 10 to 29 . 20 The IP addresses of the decoding devices are: 192.168.2.10, 192.168.2.10, ... 192.168.2.29. The subnet mask is 255.255.255.0. The 20 decoding devices are represented below by decoding device 10 to decoding device 29 . In this way, a wide area network environment is simulated through a router, the IP address of the control PC is set to 192.168.1.30, and all the above IP addresses are stored in advance.

本实施例中,对应图1中的步骤102,包括判断第一编码设备是否能作为发送所述视频流的步骤、并详述了从其他编码设备中选取编码设备的步骤,对应图1中的步骤103,包括建立编码设备与解码设备间对应关系的步骤。In this embodiment, corresponding to step 102 in FIG. 1 , it includes the step of judging whether the first encoding device can be used to transmit the video stream, and details the step of selecting the encoding device from other encoding devices, corresponding to the step in FIG. 1 Step 103 includes the step of establishing a corresponding relationship between encoding devices and decoding devices.

参照图2,编解码集群传输视频流的方法包括以下步骤:Referring to Fig. 2, the method for codec cluster transmission video stream includes the following steps:

步骤201,在预设时段内,获取请求第一编码设备的视频流的解码设备的数量。在本实施例中,在预设时段内,控制PC通过解码设备的视频流请求,获取请求同一编码设备的视频流的解码设备的数量。查询到解码设备10至解码设备19这10个编码设备需要请求编码设备10的视频流。Step 201, within a preset period of time, acquire the number of decoding devices requesting video streams from the first encoding device. In this embodiment, within a preset period of time, the control PC acquires the number of decoding devices that request video streams from the same encoding device through the video stream request from the decoding device. To query the 10 encoding devices from the decoding device 10 to the decoding device 19 needs to request the video stream of the encoding device 10 .

步骤202,判断所述解码设备的数量是否高于预设值。在本实施例中,比较请求编码设备10的视频流的解码设备的数量与预设数值7的大小,大于时,执行步骤203,即比较10与7(预设值,根据编码设备10能够同时传输7路数据的性能预先设定)可知,请求编码设备10的视频流的解码设备的数量已高于预设值7,那么接下来进入步骤203,若低于,直接终止控制PC上的软件程序。Step 202, judging whether the number of the decoding devices is higher than a preset value. In this embodiment, compare the number of video stream decoding devices requesting the encoding device 10 with the preset value 7, and if it is greater than 7, execute step 203, that is, compare 10 with 7 (the preset value, according to the encoding device 10 that can simultaneously The performance of transmitting 7 channels of data is pre-set), it can be seen that the number of decoding devices requesting the video stream of the encoding device 10 is higher than the preset value 7, then proceed to step 203, if it is lower, directly terminate the software on the control PC program.

步骤203,第一编码设备的可用带宽高于其带宽阈值时,选取第一编码设备作为待发送所述视频流的编码设备,在本实施例中,控制PC获取编码设备10当前可用的带宽能够同时传输7路所述视频流,高于阈值3,选取编码设备10为待发送所述视频流的编码设备。Step 203, when the available bandwidth of the first encoding device is higher than its bandwidth threshold, select the first encoding device as the encoding device to transmit the video stream. In this embodiment, the control PC obtains the currently available bandwidth of the encoding device 10. Simultaneously transmit 7 channels of the video stream, if it is higher than the threshold 3, the encoding device 10 is selected as the encoding device to send the video stream.

步骤204,查询其他编码设备的可用带宽,并选取前N个可用带宽最大的编码设备。即,控制PC查询编码设备11到编码设备29中每个编码设备当前可用的带宽分别能传输所述视频流的路数为:7、6、6、5、4、3、2、2、2、2。选取前2个可用带宽最大的编码设备11与编码设备12作为待发送所述视频流的编码设备。其中编码设备12与编码设备10的物理距离比编码设备13与编码设备10的物理距离近。Step 204, query the available bandwidth of other coding devices, and select the top N coding devices with the largest available bandwidth. That is, the control PC queries the currently available bandwidth of each encoding device from the encoding device 11 to the encoding device 29 to respectively transmit the number of channels of the video stream: 7, 6, 6, 5, 4, 3, 2, 2, 2 ,2. The first two coding devices 11 and 12 with the largest available bandwidth are selected as the coding devices to send the video stream. The physical distance between the encoding device 12 and the encoding device 10 is shorter than the physical distance between the encoding device 13 and the encoding device 10 .

步骤205,通过第一编码设备将所述视频流传送至选取的编码设备中的任意一个编码设备,然后通过所述任意一个编码设备将所述视频流传送至选取的编码设备中剩余的编码设备。即,控制PC控制编码设备10与编码设备11间建立连接,并控制所述视频流传向所述编码设备11,然后控制编码设备11与编码设备12间建立连接,并控制所述视频流传向编码设备12。Step 205, transmit the video stream to any one of the selected encoding devices through the first encoding device, and then transmit the video stream to the remaining encoding devices among the selected encoding devices through the arbitrary one of the encoding devices . That is, the control PC controls the encoding device 10 to establish a connection with the encoding device 11, and controls the video stream to flow to the encoding device 11, then controls the encoding device 11 to establish a connection with the encoding device 12, and controls the video stream to flow to the encoding device 11. device12.

步骤206,建立选取的编码设备与请求所述视频流的解码设备间的对应关系。即,根据编码设备与解码设备的IP地址,控制PC控制编码设备10分别与解码设备10至解码设备14建立视频传送连接、编码设备11分别于解码设备15至解码设备18建立视频传送连接,编码设备12与解码设备19建立视频传送连接。Step 206, establishing a corresponding relationship between the selected encoding device and the decoding device requesting the video stream. That is, according to the IP addresses of the encoding equipment and the decoding equipment, the control PC controls the encoding equipment 10 to establish video transmission connections with the decoding equipment 10 to the decoding equipment 14 respectively, and the encoding equipment 11 establishes video transmission connections with the decoding equipment 15 to the decoding equipment 18 respectively, and the encoding Device 12 establishes a video transfer connection with decoding device 19 .

步骤207,控制PC控制编码设备与解码设备间建立对应关系后,发送指令至编码设备10、编码设备11和编码设备12将所述视频流传送至各自对应的解码设备。Step 207: After the controlling PC controls the encoding device and the decoding device to establish a corresponding relationship, it sends an instruction to the encoding device 10, the encoding device 11, and the encoding device 12 to transmit the video stream to their respective corresponding decoding devices.

在上述实施例二中,每个发送所述视频流的编码设备都预留了能发送1路所述视频流的带宽,用于各编码设备接收和发送本地的视频流。在其他实施例中,可根据各编码设备和解码设备的实际工作情况,预先设定不同的预留带宽或预留0路所述视频流的带宽。此外,本实施例中的各种具体限定并不用于限定本发明的所有实施例。In the second embodiment above, each encoding device that sends the video stream reserves a bandwidth capable of sending one channel of the video stream, which is used for each encoding device to receive and send a local video stream. In other embodiments, different reserved bandwidths or the bandwidth of 0 video streams may be reserved in advance according to the actual working conditions of each encoding device and decoding device. In addition, various specific limitations in this embodiment are not intended to limit all embodiments of the present invention.

图3所示,是本发明编解码集群传输视频流的方法实施例三的流程示意图。As shown in FIG. 3 , it is a schematic flowchart of Embodiment 3 of the method for encoding and decoding cluster transmission of video streams according to the present invention.

在本实施例中,编解码集群包括20个编码设备和20个解码设备,编码设备与解码设备间的网络设备可包括交换机和路由器,支持广域网。在其他实施例中,编解码集群中的编码设备和解码设备的数量可更多或者更少,网络设备也可以是支持局域网的设备。In this embodiment, the codec cluster includes 20 encoding devices and 20 decoding devices, and the network devices between the encoding devices and the decoding devices may include switches and routers to support wide area networks. In other embodiments, the number of encoding devices and decoding devices in the codec cluster may be more or less, and the network device may also be a device supporting a local area network.

在本实施例中,编解码集群传输视频流的方法流程(软件程序)安装在每台解码设备中,没有额外增加的控制设备,如实施例二中的控制PC。In this embodiment, the method flow (software program) for encoding and decoding cluster transmission of video streams is installed in each decoding device, and there is no additional control device, such as the control PC in Embodiment 2.

在本实施例中,编解码集群中的每个编码设备在不影响编码效率的情况下,最多能同时对外发送或接收7路视频数据。解码设备优选地与编码设备具有相同性能。在本实施例中,以下20个IP地址用于标示20个解码设备:192.168.1.10、192.168.1.11、192.168.1.12、...192.168.1.29。子网掩码为255.255.255.0。以下以编码设备10到编码设备29来表征20个编码设备。20解码设备的IP地址为:192.168.2.10、192.168.2.10、…192.168.2.29。子网掩码为255.255.255.0。以下以解码设备10到解码设备29来表征20个解码设备。这样通过路由器模拟成广域网环境,预先将上述所有IP地址进行存储。In this embodiment, each coding device in the codec cluster can send or receive up to 7 channels of video data at the same time without affecting the coding efficiency. The decoding device preferably has the same capabilities as the encoding device. In this embodiment, the following 20 IP addresses are used to identify 20 decoding devices: 192.168.1.10, 192.168.1.11, 192.168.1.12, ... 192.168.1.29. The subnet mask is 255.255.255.0. The 20 encoding devices are identified below as encoding devices 10 to 29 . 20 The IP addresses of the decoding devices are: 192.168.2.10, 192.168.2.10, ... 192.168.2.29. The subnet mask is 255.255.255.0. The 20 decoding devices are represented below by decoding device 10 to decoding device 29 . In this way, a wide area network environment is simulated by a router, and all the above-mentioned IP addresses are stored in advance.

本实施例中,不包括判断第一编码设备是否能作为发送所述视频流的步骤,对应图1中的步骤102和步骤103,进一步分别详述了在选取的编码设备间传输视频流的方式不同时,不同的建立编码设备与解码设备间对应关系的步骤。In this embodiment, the step of judging whether the first encoding device can be used to transmit the video stream is not included, corresponding to step 102 and step 103 in FIG. 1 , and further details the ways of transmitting video streams between the selected encoding devices respectively. When it is different, the steps of establishing the corresponding relationship between the encoding device and the decoding device are different.

参照图3,编解码集群传输视频流的方法包括以下步骤:Referring to Fig. 3, the method for codec cluster transmission video stream includes the following steps:

步骤301,在预设时段内,获取请求第一编码设备的视频流的解码设备的数量。在本实施例中,在预设时段内,通过编码设备10接收到的来自各解码设备的视频流请求,查询请求解码设备10的视频流的解码设备的数量,查询到解码设备10至解码设备19这10个编码设备需要请求其视频流。Step 301, within a preset period of time, acquire the number of decoding devices requesting the video stream of the first encoding device. In this embodiment, within a preset period of time, through the video stream requests received by the encoding device 10 from each decoding device, the number of decoding devices requesting the video stream of the decoding device 10 is queried, and the decoding device 10 to the decoding device are queried. 19 These 10 encoding devices need to request their video streams.

步骤302,判断请求所述视频流的解码设备的数量是否高于预设值,即比较10与6(预设值,根据编码设备10能够同时传输7路数据的性能预先设定)可知,请求编码设备10的视频流的解码设备的数量已高于预设值6,那么接下来进入步骤303,若低于,直接退出上述传输程序。Step 302, judging whether the number of decoding devices requesting the video stream is higher than the preset value, that is, comparing 10 with 6 (the preset value, which is preset according to the performance of the encoding device 10 capable of transmitting 7 channels of data at the same time), it can be seen that the request If the number of decoding devices for the video stream of the encoding device 10 is higher than the preset value 6, then proceed to step 303, and if it is lower, directly exit the above-mentioned transmission procedure.

步骤303,查询其他编码设备的剩余带宽,并选取前N个剩余带宽最大的编码设备。在本实施例中,编码设备10查询编码设备11到编码设备29中每个编码设备当前可用的带宽分别能传输所述视频流的路数为:6、5、5、5、4、3、2、2、2、2。选取前3个可用带宽最大的编码设备11、编码设备12与编码设备13作为待发送所述视频流的编码设备。其中编码设备12、编码设备13与编码设备10的物理距离比编码设备14与编码设备10的物理距离近。Step 303, query the remaining bandwidth of other encoding devices, and select the top N encoding devices with the largest remaining bandwidth. In this embodiment, the encoding device 10 queries the currently available bandwidth of each encoding device from the encoding device 11 to the encoding device 29. 2, 2, 2, 2. The first three coding devices 11, 12 and 13 with the largest available bandwidth are selected as the coding devices to send the video stream. The physical distance between the encoding device 12 , the encoding device 13 and the encoding device 10 is shorter than the physical distance between the encoding device 14 and the encoding device 10 .

步骤304,判断是否能通过第一编码设备将所述视频流传送至所有选取的编码设备。在本实施例中,判断编码设备10是否当前能同时传输3路以上所述视频流,若能,则执行步骤305,若不能则执行步骤306。Step 304, judging whether the video stream can be transmitted to all selected encoding devices through the first encoding device. In this embodiment, it is judged whether the encoding device 10 can currently transmit more than three video streams at the same time, if yes, perform step 305 , and if not, perform step 306 .

步骤305,通过第一编码设备将所述视频流传送至所有选取的编码设备。即,控制编码设备10与选取的编码设备(编码设备11、编码设备12和编码设备13)建立连接,并控制所述视频流传向选取的编码设备。并执行步骤307。Step 305, transmit the video stream to all selected encoding devices through the first encoding device. That is, the encoding device 10 is controlled to establish a connection with the selected encoding device (the encoding device 11 , the encoding device 12 and the encoding device 13 ), and the video stream is controlled to flow to the selected encoding device. And execute step 307.

步骤306,通过第一编码设备将所述视频流传送至所述选取的编码设备中任意一个编码设备,然后通过所述任意一个编码设备将所述视频流传送至剩余的编码设备。即,控制编码设备10与选取的编码设备中的任意一个编码设备(如编码设备11)建立连接,并控制所述视频流传向所述任意一个编码设备,然后通过所述任意一个编码设备将所述视频流传输至剩余的编码设备(控制编码设备11与编码设备12间建立连接,并控制所述视频流传向编码设备12,最后控制编码设备12与编码设备13建立连接,并控制所述视频流传向编码设备13)。并执行步骤308。Step 306, transmit the video stream to any one of the selected encoding devices through the first encoding device, and then transmit the video stream to the remaining encoding devices through the arbitrary one of the encoding devices. That is, the encoding device 10 is controlled to establish a connection with any one of the selected encoding devices (such as the encoding device 11), and the video stream is controlled to flow to the arbitrary encoding device, and then the video stream is transmitted to the arbitrary encoding device through the arbitrary encoding device. The video stream is transmitted to the remaining encoding devices (control the encoding device 11 to establish a connection with the encoding device 12, and control the video stream to the encoding device 12, and finally control the encoding device 12 to establish a connection with the encoding device 13, and control the video stream to the encoding device 13). And execute step 308 .

步骤307,根据编码设备与解码设备的IP地址,建立选取的编码设备与请求所述视频流的解码设备间的对应关系。即,控制编码设备11分别与解码设备10至解码设备14建立视频传送连接、编码设备12分别于解码设备15至解码设备18建立视频传送连接,编码设备13与解码设备19建立视频传送连接。Step 307, according to the IP addresses of the encoding device and the decoding device, establish a corresponding relationship between the selected encoding device and the decoding device requesting the video stream. That is, the encoding device 11 is controlled to establish video transmission connections with the decoding device 10 to the decoding device 14, the encoding device 12 establishes video transmission connections between the decoding device 15 and the decoding device 18, and the encoding device 13 establishes a video transmission connection with the decoding device 19.

步骤308,根据编码设备与解码设备的IP地址,建立选取的编码设备与请求所述视频流的解码设备间的对应关系。即,控制编码设备11分别与解码设备10至解码设备13建立视频传送连接、编码设备12分别于解码设备14至解码设备16建立视频传送连接,编码设备13分别与解码设备17至解码设备19建立视频传送连接。Step 308: Establish a corresponding relationship between the selected encoding device and the decoding device requesting the video stream according to the IP addresses of the encoding device and the decoding device. That is, the encoding device 11 is controlled to establish video transmission connections with the decoding device 10 to the decoding device 13 respectively, the encoding device 12 establishes a video transmission connection with the decoding device 14 to the decoding device 16 respectively, and the encoding device 13 respectively establishes a video transmission connection with the decoding device 17 to the decoding device 19 Video delivery connection.

步骤309,控制编码设备与解码设备间建立对应关系后,解码设备10发送指令至编码设备11、编码设备12和编码设备13将所述视频流传送至各自对应的解码设备。Step 309, after controlling the establishment of a correspondence between the encoding device and the decoding device, the decoding device 10 sends instructions to the encoding device 11, the encoding device 12, and the encoding device 13 to transmit the video stream to their respective corresponding decoding devices.

在上述实施例三中,没有选取编码设备10发送所述视频流。对于编解码集群,若其中任意一个编码设备由于一些暂时的工作需要,无法向解码设备传送其上的视频流,可通过将步骤302中的预设值设置为0,实施具体实施例2中的传输视频流的方法可有效克服其无法传送视频流的困难。此外,本实施例中的各种具体限定并不用于限定本发明的所有实施例。In the third embodiment above, the encoding device 10 is not selected to send the video stream. For the codec cluster, if any one of the encoding devices cannot transmit the video stream on it to the decoding device due to some temporary work needs, the preset value in step 302 can be set to 0 to implement the specific embodiment 2 The method for transmitting the video stream can effectively overcome the difficulty that the video stream cannot be transmitted. In addition, various specific limitations in this embodiment are not intended to limit all embodiments of the present invention.

如图4所示,本发明的编解码集群传输视频流的系统,包括计数模块10、第一控制模块20和第二控制模块30,其中:As shown in FIG. 4 , the system for codec cluster transmission video stream of the present invention includes a counting module 10, a first control module 20 and a second control module 30, wherein:

计数模块10,用于获取预设时段内向多个编码设备中的第一编码设备请求视频流的解码设备的数量。The counting module 10 is configured to acquire the number of decoding devices requesting video streams from a first encoding device among the plurality of encoding devices within a preset period of time.

第一控制模块20,用于在请求所述视频流的解码设备的数量高于预设值时,从多个编码设备中除所述第一编码设备外其他的编码设备中选取至少一个编码设备作为待发送所述视频流的编码设备。The first control module 20 is configured to select at least one encoding device from among the plurality of encoding devices except the first encoding device when the number of decoding devices requesting the video stream is higher than a preset value As the encoding device to send the video stream.

第二控制模块30,用于将所述视频流发送至选取的编码设备,通过所述选取的编码设备将所述视频流传送至对应的解码设备。The second control module 30 is configured to send the video stream to a selected encoding device, and transmit the video stream to a corresponding decoding device through the selected encoding device.

在本发明的优选实施例中,第一控制模块20还可用于:In a preferred embodiment of the present invention, the first control module 20 can also be used for:

获取所述第一编码设备当前可用的带宽,将所述当前可用的带宽和所述第一编码设备的带宽阈值比较。Obtain the currently available bandwidth of the first encoding device, and compare the currently available bandwidth with the bandwidth threshold of the first encoding device.

在所述当前可用的带宽大于所述带宽阈值时,选取所述第一编码设备作为待发送所述视频流的编码设备。When the currently available bandwidth is greater than the bandwidth threshold, select the first coding device as the coding device to send the video stream.

在本发明的优选实施例中,所述第二控制模块30还可用于:In a preferred embodiment of the present invention, the second control module 30 can also be used for:

根据所述选取的编码设备中每个编码设备当前可用的带宽,确定每个编码设备能同时发送的所述视频流的路数。According to the currently available bandwidth of each encoding device in the selected encoding devices, determine the number of video streams that each encoding device can send simultaneously.

根据所述能同时发送的所述视频流的路数,确定每个编码设备对应的解码设备。According to the number of video streams that can be sent simultaneously, the decoding device corresponding to each encoding device is determined.

使用所述选取的编码设备将所述视频流传送至所述对应的解码设备。Transmitting the video stream to the corresponding decoding device using the selected encoding device.

在本发明的优选实施例中,第一控制模块20还可用于:In a preferred embodiment of the present invention, the first control module 20 can also be used for:

获取所述其他的编码设备中每个编码设备当前可用的带宽;Obtain the currently available bandwidth of each encoding device in the other encoding devices;

选取前N个所述带宽的值最大的编码设备作为待发送所述视频流的编码设备,所述N为大于或等于1的自然数。Select the first N encoding devices with the largest bandwidth values as the encoding devices to send the video stream, where N is a natural number greater than or equal to 1.

在本发明的其他优选实施例中,第一控制模块20还用于:In other preferred embodiments of the present invention, the first control module 20 is also used for:

依次选取所述其他的编码设备其中的一个。One of the other encoding devices is selected in sequence.

对于每次选取的一个编码设备,判断所述编码设备当前可用的带宽是否高于预设带宽值或所述选取的编码设备的带宽阈值,若高于,选取所述编码设备作为待发送所述视频流的编码设备。For each encoding device selected, it is judged whether the currently available bandwidth of the encoding device is higher than the preset bandwidth value or the bandwidth threshold of the selected encoding device, and if it is higher, the encoding device is selected as the The encoding device for the video stream.

判断作为待发送所述视频流的编码设备的数量是否超过预设数量,若超过,停止选取和判断。Judging whether the number of encoding devices to be sent the video stream exceeds a preset number, and if so, stop selecting and judging.

若不高于,跳过所述编码设备。If not higher, skip the encoding device.

在本发明的优选实施例中,第二控制模块30可通过所述第一编码设备将所述视频流发送至所有所述选取的编码设备。第二控制模块30也可先通过所述第一编码设备将所述视频流传送至所述选取的编码设备中的任意一个编码设备,然后通过所述任意一个编码设备将所述视频流传送至所述选取的编码设备中的其他编码设备。In a preferred embodiment of the present invention, the second control module 30 can send the video stream to all the selected encoding devices through the first encoding device. The second control module 30 may also first transmit the video stream to any one of the selected encoding devices through the first encoding device, and then transmit the video stream to any encoding device through the arbitrary encoding device. Other encoding devices in the selected encoding devices.

本发明的编解码集群传输视频流的系统中的计数模块10、第一控制模块20和第二控制模块30可至少部分地安装在编解码集群中的任意编码设备上,也可至少部分地安装在编解码集群额外增设的控制PC中。The counting module 10, the first control module 20 and the second control module 30 in the codec cluster transmission video stream system of the present invention can be at least partially installed on any encoding device in the codec cluster, and can also be installed at least partially In the additional control PC of the codec cluster.

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4