Video data transmission method and video source equipment

文档序号:1131152 发布日期:2020-10-02 浏览:15次 中文

阅读说明:本技术 一种视频数据传输方法和视频源设备 (Video data transmission method and video source equipment ) 是由 张夷 于 2019-03-25 设计创作,主要内容包括:本申请提供一种视频数据传输方法和视频源设备。本申请提供的视频数据传输方法,包括:在接收到来自客户端的取流请求时,将采集到的视频数据切分为第一子视频集和第二子视频集;将所述第一子视频集通过建立在本设备和所述客户端之间的设备对设备P2P链路发送给所述客户端,并将所述第二子视频集通过建立在本设备和所述客户端之间的中心转发链路发送给所述客户端,以使所述客户端在接收到所述第一子视频集和所述第二子视频集时,根据所述第一子视频集和所述第二子视频集合成请求的视频数据。本申请提供的视频数据传输方法和视频源设备,通过P2P链路和中心转发链路发送视频数据,这样,可保证视频数据的传输质量。(The application provides a video data transmission method and video source equipment. The video data transmission method provided by the application comprises the following steps: when a streaming request from a client is received, dividing the collected video data into a first sub video set and a second sub video set; and sending the first sub video set to the client through a device-to-device P2P link established between the device and the client, and sending the second sub video set to the client through a central forwarding link established between the device and the client, so that the client integrates the requested video data according to the first sub video set and the second sub video set when receiving the first sub video set and the second sub video set. According to the video data transmission method and the video source equipment, the video data are sent through the P2P link and the central forwarding link, and therefore the transmission quality of the video data can be guaranteed.)

1. A video data transmission method applied to a video source device, the method comprising:

when a streaming request from a client is received, dividing the collected video data into a first sub video set and a second sub video set;

and sending the first sub video set to the client through a device-to-device P2P link established between the device and the client, and sending the second sub video set to the client through a central forwarding link established between the device and the client, so that the client integrates the requested video data according to the first sub video set and the second sub video set when receiving the first sub video set and the second sub video set.

2. The method of claim 1, wherein the segmenting the captured video data into a first set of sub-videos and a second set of sub-videos comprises:

acquiring the transmission rate of the P2P link and the code rate of the video data;

determining a target ratio M to N according to the transmission rate and the code rate; wherein, the M is equal to the transmission rate divided by the difference between the code rate and the transmission rate;

and according to the M: N, segmenting the video data into the first sub-video set and the second sub-video set, so that the proportion of the total capacity of the sub-videos contained in the first sub-video set to the total capacity of the sub-videos contained in the second sub-video set is equal to the M: N.

3. The method of claim 2, wherein segmenting the video data into the first set of sub-videos and the second set of sub-videos according to the M: N comprises:

segmenting the video data into a plurality of sub-videos with equal sizes;

and aiming at every M plus N sub-videos, determining M sub-videos as the sub-videos in the first sub-video set, and determining the remaining N sub-videos as the sub-videos in the second sub-video set.

4. The method of claim 3, wherein the slicing the video data into sub-videos of equal size comprises:

according to a preset frame number, segmenting the video data into a plurality of sub-videos with equal sizes; wherein, the number of frames contained in each sub-video is equal to the preset number of frames;

in the alternative, the first and second sets of the first,

according to a first preset capacity, the video data are segmented into a plurality of sub-videos with equal sizes; wherein the capacity of each of the sub-videos is equal to the first preset capacity.

5. The method of claim 4, wherein said first predetermined capacity is equal to the smaller of the path maximum transmission value of said P2P link and the path maximum transmission value of said central forwarding link.

6. The method of claim 2, wherein said slicing the video data into the first set of sub-videos and the second set of sub-videos according to the M: N comprises:

for each second preset volume of video data, dividing the video data into a first sub video and a second sub video according to the M: N ratio;

determining the first sub-video as a sub-video in a first sub-video set and determining the second sub-video as a sub-video in the second sub-video set.

7. A computer storage medium having a computer program stored thereon, the program, when being executed by a processor, performing the steps of the method of any one of claims 1 to 6.

8. The video source equipment is characterized by comprising an acquisition module, a memory and a processor; wherein the content of the first and second substances,

the acquisition module is used for acquiring video data;

the memory for storing a computer program;

the processor is configured to implement the following steps when executing the computer program:

when a streaming request from a client is received, dividing the collected video data into a first sub video set and a second sub video set;

and sending the first sub video set to the client through a device-to-device P2P link established between the device and the client, and sending the second sub video set to the client through a central forwarding link established between the device and the client, so that the client integrates the requested video data according to the first sub video set and the second sub video set when receiving the first sub video set and the second sub video set.

Technical Field

The present application relates to the field of video transmission technologies, and in particular, to a video data transmission method and a video source device.

Background

In recent years, with the enhancement of public safety awareness, video monitoring systems have come into play. The video monitoring system generally includes a client and a video source device, and the video source device sends collected video data to the client when receiving a streaming request from the client, so that a user at the client side can view the video data.

Currently, video source devices transmit video data to clients in a wireless manner. For example, video data is often transmitted To a client over a device-To-device P2P (Peer To Peer, P2P) link established between a video source device and the client.

However, when the P2P link is used to transmit video data, if the transmission rate of the P2P link is small, the transmission quality of the video data cannot be guaranteed.

Disclosure of Invention

In view of the above, the present application provides a video data transmission method and a video source device, so as to provide a video data transmission method with better transmission quality.

The first aspect of the present application provides a video data transmission method, which is applied to a video source device, and the method includes:

when a streaming request from a client is received, dividing the collected video data into a first sub video set and a second sub video set;

and sending the first sub video set to the client through a device-to-device P2P link established between the device and the client, and sending the second sub video set to the client through a central forwarding link established between the device and the client, so that the client integrates the requested video data according to the first sub video set and the second sub video set when receiving the first sub video set and the second sub video set.

A second aspect of the present application provides a computer storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods provided in the first aspect of the present application

A third aspect of the present application provides a video source device, which includes an acquisition module, a memory, and a processor; wherein the content of the first and second substances,

the acquisition module is used for acquiring video data;

the memory for storing a computer program;

the processor is configured to implement the following steps when executing the computer program:

when a streaming request from a client is received, dividing the collected video data into a first sub video set and a second sub video set;

and sending the first sub video set to the client through a device-to-device P2P link established between the device and the client, and sending the second sub video set to the client through a central forwarding link established between the device and the client, so that the client integrates the requested video data according to the first sub video set and the second sub video set when receiving the first sub video set and the second sub video set.

According to the video data transmission method and the video source device, when a streaming request from a client is received, collected video data are divided into a first sub video set and a second sub video set, the first sub video set is sent to the client through a device-to-device P2P link established between the device and the client, the second sub video set is sent to the client through a center forwarding link established between the device and the client, and the client combines the requested video data according to the first sub video set and the second sub video set when receiving the first sub video set and the second sub video set. Thus, the transmission quality of the video data can be ensured by transmitting the video data through the P2P link and the central forwarding link.

Drawings

Fig. 1 is a schematic view of an application scenario of a video data transmission method provided in the present application;

fig. 2 is a flowchart of a first embodiment of a video data transmission method provided in the present application;

fig. 3 is a flowchart of a second embodiment of a video data transmission method provided in the present application;

fig. 4 is a schematic structural diagram of a video source device according to a first embodiment of the present disclosure.

Detailed Description

Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.

The application provides a video data transmission method and video source equipment, and aims to provide a video data transmission method with better transmission quality.

In the following, specific examples are given to describe the technical solutions of the present application in detail. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.

Fig. 1 is a schematic view of an application scenario of a video data transmission method provided in the present application. Referring to fig. 1, the video data transmission method may be applied to a video monitoring system, which may include a client 1, a video source device 2 and a central forwarding device 3, wherein the video transmission method and apparatus may be applied to the video source device 2 shown in fig. 1.

Further, with continued reference to fig. 1, in the present application, a P2P link and a central forwarding link are provided between the client 1 and the video source device 2 (i.e. the link transmits video data to the client 1 through the central forwarding device 3). According to the method, when video source equipment receives a streaming request from a client, collected video data are divided into a first sub video set and a second sub video set, the first sub video set is sent to the client through an equipment-to-equipment P2P link established between the equipment and the client, and the second sub video set is sent to the client through a central forwarding link established between the equipment and the client. Thus, the video data is transmitted through the P2P link and the central forwarding link, and the transmission effect of the video data can be ensured.

Fig. 2 is a flowchart of a first embodiment of a video data transmission method provided in the present application. Referring to fig. 2, the method provided in this embodiment may include:

s201, when a streaming request from a client is received, dividing collected video data into a first sub video set and a second sub video set.

Specifically, in an embodiment, the acquired video data may be segmented into a plurality of sub-video sets (it should be noted that the plurality of sub-video sets may be equal sub-videos or unequal sub-videos, which is not limited in this embodiment), and further, for every two sub-videos, one of the sub-videos is determined as a sub-video in the first sub-video set, and the other sub-video is determined as a sub-video in the second sub-video set. In particular, for example, in one embodiment, the sub-videos are numbered sequentially, and then the sub-videos located in odd bits are determined as the sub-videos in the first sub-video set, and the sub-videos located in even bits are determined as the sub-videos in the second sub-video set. In this example, for example, the sub-videos numbered 1, 3, 5, … … are determined as the sub-videos in the first sub-video set, and the sub-videos numbered 2, 4, 6, … … are determined as the sub-videos in the first sub-video set.

S202, sending the first sub-video set to the client through a device-to-device P2P link established between the device and the client, and sending the second sub-video set to the client through a central forwarding link established between the device and the client, so that the client, when receiving the first sub-video set and the second sub-video set, combines the requested video data according to the first sub-video set and the second sub-video set.

Specifically, referring to fig. 1, in this step, the first sub-video set is sent to the client through the P2P link, and the second sub-video set is sent to the client through the central forwarding link.

It should be noted that the P2P link may include one link or multiple links, and when the P2P link includes multiple links, the first sub-video set is transmitted through the multiple links. In the present embodiment, this is not limited.

In addition, when the sub-videos are sent to the client, the sub-videos can be numbered, so that when the client receives the sub-videos, a plurality of requested video data can be synthesized from the videos according to the numbers of the sub-videos.

In the video data transmission method provided in this embodiment, when a streaming request from a client is received, collected video data is divided into a first sub-video set and a second sub-video set, and then the first sub-video set is sent to the client through a device-to-device P2P link established between the device and the client, and the second sub-video set is sent to the client through a central forwarding link established between the device and the client, so that the client combines the requested video data according to the first sub-video set and the second sub-video set when receiving the first sub-video set and the second sub-video set. Thus, the transmission quality of the video data can be ensured by transmitting the video data through the P2P link and the central forwarding link.

Fig. 3 is a flowchart of a second embodiment of a video data transmission method provided in the present application. Referring to fig. 3, in the method provided in this embodiment, based on the above embodiment, in step S201, the step of dividing the acquired video data into the first sub-video set and the second sub-video set may include:

and S301, acquiring the transmission rate of the P2P link and the code rate of the video data.

Specifically, the specific implementation process and implementation principle of this step can be referred to the description in the related art, and are not described herein again. For example, in one embodiment, the transmission rate to the P2P link is 0.5Mb/s, and the bitrate of the video data is 1.5 Mb/s.

S302, determining a target ratio M to N according to the transmission rate and the code rate; wherein, the M to N is equal to the transmission rate divided by the difference between the code rate and the transmission rate.

With reference to the above example, the difference between the code rate and the transmission rate is 1, and in this step, the target ratio is determined to be 1: 2.

and S303, according to the M: N, dividing the video data into a first sub-video set and a second sub-video set, so that the ratio of the total capacity of the sub-videos contained in the first sub-video set to the total capacity of the sub-videos contained in the second sub-video set is equal to the M: N.

Specifically, in a possible implementation manner, a specific implementation process of this step may include:

(1) segmenting the video data into a plurality of sub-videos with equal sizes;

(2) and aiming at every M plus N sub-videos, determining M sub-videos as the sub-videos in the first sub-video set, and determining the remaining N sub-videos as the sub-videos in the second sub-video set.

For example, in combination with the above example, in this step, the video data is divided into a plurality of sub-videos with equal sizes, and then for every 3 sub-videos, 1 of the sub-videos is determined as a sub-video in the first sub-video set, and the remaining two sub-videos are determined as sub-videos in the second sub-video set. For example, in an embodiment, for every 3 sub-videos, the first sub-video is determined as the sub-video in the first sub-video set, and the remaining two sub-videos are determined as the sub-videos in the second sub-video set. For another example, in another embodiment, for every 3 sub-videos, the second sub-video is determined as the sub-video in the first sub-video set, and the first sub-video and the third sub-video are determined as the sub-videos in the second sub-video set.

Optionally, when the video data is segmented into a plurality of sub-videos with equal sizes, in an embodiment, the video data may be segmented into a plurality of sub-videos with equal sizes according to a preset number of frames; and each sub-video comprises a frame number equal to the preset frame number. In another embodiment, the video data may be segmented into a plurality of sub-videos with equal sizes according to a first preset capacity; wherein the capacity of each of the sub-videos is equal to the first preset capacity.

For example, in one embodiment, every 3 frames of video data is sliced into one sub-video. For another example, in an embodiment, each first preset volume of video data is split into one sub-video, for example, each 0.5 minute of video data is split into one sub-video, or each 1000 bytes of video data is split into one sub-video.

It should be noted that, in an embodiment, the first preset capacity may be equal to the smaller of the path maximum transmission value of the P2P link and the path maximum transmission value of the central forwarding link. For example, in an embodiment, the maximum path transmission value of the P2P link is 1500 bytes, and the maximum path transmission value of the central forwarding link is 1000 bytes, and at this time, the first predetermined capacity is equal to 1000 bytes.

Further, in another possible implementation manner, a specific implementation process of this step may include:

(1) for each second preset volume of video data, dividing the video data into a first sub video and a second sub video according to the M: N ratio;

(2) determining the first sub-video as a sub-video in a first sub-video set and determining the second sub-video as a sub-video in the second sub-video set.

The second preset capacity is set according to actual needs, and this step is not limited to this. The second preset capacity is 1 minute as an example.

With reference to the above example, in this step, for every 1 minute of video data, the video data is divided into a first sub-video and a second sub-video according to a ratio of 1:2 (in this example, the first sub-video is the first 20 seconds of video data, and the second sub-video is the last 40 seconds of video data), and the first sub-video is determined as the sub-video in the first sub-video set, and the second sub-video is determined as the sub-video in the second sub-video set.

The method provided by this embodiment provides a method for dividing video data into a first sub-video set and a second sub-video set, and by this method, it can be ensured that the ratio of the total capacity of the sub-videos included in the first sub-video set to the total capacity of the sub-videos included in the second sub-video set is equal to a target ratio, and the target ratio is equal to the transmission rate of the P2P link divided by the difference between the bitrate of the video data and the transmission rate. In this way, the transmission rate of the P2P link can be fully utilized to transmit video data.

The video data transmission method provided by the present application is introduced above, and the video source device provided by the present application is introduced below:

fig. 4 is a schematic structural diagram of a video source device according to a first embodiment of the present disclosure. Referring to fig. 4, the video source device provided in this embodiment may include a collecting module 410, a memory 420 and a processor 430; wherein the content of the first and second substances,

the acquisition module 410 is used for acquiring video data;

the memory 420 for storing a computer program;

the processor 430 is configured to implement the following steps when executing the computer program:

when a streaming request from a client is received, dividing the collected video data into a first sub video set and a second sub video set;

and sending the first sub video set to the client through a device-to-device P2P link established between the device and the client, and sending the second sub video set to the client through a central forwarding link established between the device and the client, so that the client integrates the requested video data according to the first sub video set and the second sub video set when receiving the first sub video set and the second sub video set.

Specifically, the video source device provided in this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 1, and the implementation principle and the technical effect are similar, which are not described herein again.

Further, the processor 430 is further specifically configured to:

acquiring the transmission rate of the P2P link and the code rate of the video data;

determining a target ratio M to N according to the transmission rate and the code rate; wherein, the M is equal to the transmission rate divided by the difference between the code rate and the transmission rate;

and according to the M: N, segmenting the video data into the first sub-video set and the second sub-video set, so that the proportion of the total capacity of the sub-videos contained in the first sub-video set to the total capacity of the sub-videos contained in the second sub-video set is equal to the M: N.

Further, the processor 430 is further specifically configured to:

segmenting the video data into a plurality of sub-videos with equal sizes;

and aiming at every M plus N sub-videos, determining M sub-videos as the sub-videos in the first sub-video set, and determining the remaining N sub-videos as the sub-videos in the second sub-video set.

Further, the processor 430 is further specifically configured to:

according to a preset frame number, segmenting the video data into a plurality of sub-videos with equal sizes; wherein, the number of frames contained in each sub-video is equal to the preset number of frames;

in the alternative, the first and second sets of the first,

according to a first preset capacity, the video data are segmented into a plurality of sub-videos with equal sizes; wherein the capacity of each of the sub-videos is equal to the first preset capacity.

Further, the first preset capacity is equal to the smaller of the path maximum transmission value of the P2P link and the path maximum transmission value of the central forwarding link.

Further, the processor 430 is further specifically configured to:

for each second preset volume of video data, dividing the video data into a first sub video and a second sub video according to the M: N ratio;

determining the first sub-video as a sub-video in a first sub-video set and determining the second sub-video as a sub-video in the second sub-video set.

Further, the present application also provides a computer storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of any of the methods provided by the first aspect of the present application.

The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:获取白盒查找表的方法、装置、电子设备、存储介质及服务端

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类