Panoramic video distribution method and system based on visual continuity
Technical Field
The invention relates to the field of video distribution, in particular to a panoramic video distribution method and system based on visual continuity.
Background
The panoramic video can provide dynamic real-time video information while providing omnidirectional visual information, so that people can see the whole dynamic scene surrounding the camera. Panoramas are typically large resolution images, the generation of which requires a significant amount of computational effort. Compared with a panoramic image, the panoramic video adds a new time dimension. Therefore, the amount of computation and data will be tens of times larger than that of the panoramic view, which is a great challenge to the processing power of the hardware system and the working efficiency of the software system. When the code stream of the panoramic video is distributed and transmitted, great pressure is exerted on the bandwidth of the network, and the mobile network with extremely limited bandwidth is extremely challenging.
Disclosure of Invention
The embodiment of the invention aims to provide a panoramic video distribution method based on visual continuity, and aims to solve the problems of large calculation amount, low efficiency and unsmooth panoramic video distribution in the prior art.
The embodiment of the invention is realized in such a way that a panoramic video distribution method based on visual continuity comprises the following steps:
step A: one code stream in multiple paths of optional panoramic video code streams is taken as a reference code stream and recorded as a streamcurStream ofcurThe corresponding camera collects the view angle as a reference angle, and the reference angle is recorded as thetacur;
And B: calculating the camera collecting visual angle theta corresponding to each path of code stream of the panoramic videonAnd thetacurAngle difference d theta ofn;θnRepresents streamnA corresponding camera collects a visual angle; streamnThe nth spliced code stream representing the panoramic video,n is 1,2, the number of spliced code streams is represented by N;
and C: arranging multiple paths of code streams of the panoramic video into two code stream queues;
step D: sending const second panoramic video multi-path code streamnN is 1,2,. cndot.n; const represents a time window duration parameter;
step E: in the const second time window, sending the visual angle information in the time window
Representing the upper and lower visual angle limits of the nth time window;
step F: if the panoramic video multi-path code streamnIf the code stream in the nt +1 time window exists, entering the step G; otherwise, ending the distribution of the multi-path code stream of the panoramic video; nt represents a time window index, and the initial value is 1;
step G: distributing multi-path code streams of the panoramic video according to the visual angle information;
step H: let nt be nt +1, determine const,
then re-enter step D.
Wherein d θn=θn-θcur,n=1,2,...,N;
t
0Representing the initial buffering time of the transmitted code stream, and taking 3-6 seconds; t is t
cRepresenting the buffering time of the sending code stream;
min (variable | condition) and max (variable | condition) respectively represent minimum and maximum values of variables satisfying the condition;
respectively representing the upper time limit and the lower time limit of the nth time window,
another object of an embodiment of the present invention is to provide a panoramic video distribution system based on visual continuity, the system including:
a reference code stream and reference angle setting module for selecting one code stream in multiple paths of code streams of the panoramic video as a reference code stream to be recorded as a streamcurStream ofcurThe corresponding camera collects the view angle as a reference angle, and the reference angle is recorded as thetacur(ii) a Wherein, streamnRepresenting the nth spliced code stream of the panoramic video, wherein N is 1,2, and N represent the number of the spliced code streams;
an angle difference calculation module for calculating the camera collection view angle and theta corresponding to each path of code stream of the panoramic videocurAngle difference d theta ofn,dθn=θn-θcur,n=1,2,...,N;θnRepresents streamnA corresponding camera collects a visual angle;
the code stream queue sequencing device is used for arranging the multi-path code streams of the panoramic video into two code stream queues;
a first multi-path code stream sending module for sending const second panoramic video multi-path code streamnN is 1,2,. cndot.n; const represents a time window duration parameter;
a visual angle information sending module for sending the visual angle information in the time window in the const second time window
Wherein the content of the first and second substances,
representing the upper and lower visual angle limits of the nth time window; a first judgment processing module for judging if the panoramic video multi-path code stream is stream
nIf the code stream in the nt +1 time window exists, the multi-path is enteredA code stream distribution module; otherwise, ending the distribution of the multi-path code stream of the panoramic video;
the multi-path code stream distribution device is used for distributing multi-path code streams of the panoramic video according to the visual angle information;
a setting module, configured to make nt equal to nt +1, determine const,
then, the first multi-path code stream sending module is re-entered.
Wherein the content of the first and second substances,
t
0representing the initial buffering time of the transmitted code stream, and taking 3-6 seconds; t is t
cRepresenting the buffering time of the sending code stream; nt represents a time window index, and the initial value is 1;
min (variable | condition) and max (variable | condition) respectively represent minimum and maximum values of variables satisfying the condition;
the invention has the advantages of
The invention provides a panoramic video distribution method based on visual continuity. The method of the invention utilizes the continuity of human vision to carry out self-adaptive distribution on the multi-path code stream spliced by the panoramic video. Therefore, the panoramic video can distribute all paths of code streams according to the network congestion state, and the smoothness of playing the panoramic video is improved without influencing the watching effect of audiences.
Drawings
Fig. 1 is a flowchart of a panoramic video distribution method based on visual continuity according to a preferred embodiment of the present invention;
FIG. 2 is a flowchart of the detailed method of Step2 in FIG. 1;
FIG. 3 is a flowchart of the detailed method of Step6 in FIG. 1;
fig. 4 is a block diagram of a panoramic video distribution system based on visual continuity according to a preferred embodiment of the present invention;
FIG. 5 is a detailed structure diagram of the code stream queue sorting apparatus in FIG. 4;
FIG. 6 is a detailed block diagram of the multi-path code stream distribution apparatus in FIG. 4;
FIG. 7 is a detailed configuration view of the first processing device of FIG. 6;
fig. 8 is a detailed configuration diagram of the second processing device in fig. 6.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and examples, and for convenience of description, only parts related to the examples of the present invention are shown. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides a panoramic video distribution method based on visual continuity. The method of the embodiment of the invention utilizes the continuity of human vision to carry out self-adaptive distribution on the multi-path code stream spliced by the panoramic video. Therefore, the panoramic video can distribute all paths of code streams according to the network congestion state, and the smoothness of playing the panoramic video is improved without influencing the watching effect of audiences.
Example one
Fig. 1 is a flowchart of a panoramic video distribution method based on visual continuity according to a preferred embodiment of the present invention; the method comprises the following steps:
step 0: one code stream in multiple paths of optional panoramic video code streams is taken as a reference code stream and recorded as a streamcurStream ofcurThe corresponding camera collects the view angle as a reference angle, and the reference angle is recorded as thetacur。
Wherein, streamnRepresenting the nth spliced code stream of the panoramic video, wherein N is 1,2, and N represent the number of the spliced code streams; thetanRepresents streamnThe corresponding camera captures the view angle.
Step 1: calculating the collecting visual angle and theta of camera corresponding to each path of code stream of panoramic videocurAngle difference d theta ofn,dθn=θn-θcur,n=1,2,...,N。
Step 2: and arranging the multi-path code streams of the panoramic video into two code stream queues.
FIG. 2 is a flowchart of the detailed method of Step2 in FIG. 1; the method comprises the following steps:
step21, arranging all the angle differences less than or equal to 0 in ascending order, and recording the angle differences as
Wherein k1 represents the number of all angular differences equal to or less than 0;
step22, arranging the corresponding camera collection visual angles into an angle sequence according to the arrangement sequence of all the angle differences less than or equal to 0
Referred to as a first angular sequence; arranging multiple paths of code streams of the corresponding panoramic video into a code stream sequence and recording the code stream sequence
Called a first code stream sequence;
step23, arranging all the angle differences larger than 0 in descending order and recording the angle differences as
Step24, arranging the corresponding camera collection visual angles into an angle sequence according to the arrangement sequence of all the angle differences larger than 0, and recording the angle sequence as
Referred to as a second angular sequence; arranging multiple paths of code streams of the corresponding panoramic video into a code stream sequence and recording the code stream sequence
Referred to as a second code stream sequence.
Step 3: sending const second panoramic video multi-path code stream streamn,n=1,2,...,N。
Wherein the content of the first and second substances,
const represents a time window duration parameter; t is t
0The initial buffering time of the sending code stream is shown, and can be 3-6 seconds generally; t is t
cRepresenting the buffering time of the sending code stream; nt denotes a time window index and has an initial value of 1.
Step 4: in the const second time window, sending the visual angle information in the time window
Wherein the visual angle information comprises
Indicating the upper and lower visual angle limits for the nth time window,
min (variable | condition) and max (variable | condition) respectively represent minimum and maximum values of variables satisfying the condition;
step 5: if the panoramic video multi-path code streamnIf the code stream in the nt +1 time window exists, entering Step 6; otherwise, ending the distribution of the panoramic video multi-path code stream.
Step 6: and distributing multi-path code streams of the panoramic video according to the visual angle information.
FIG. 3 is a flowchart of the detailed method of Step6 in FIG. 1; the method comprises the following steps:
step 61: computing
Referred to as the sign view angle.
Step 62: first, calculate
Then, finding out the camera collecting angle corresponding to the minimum value, and recording the camera collecting angle as theta
nowAnd the corresponding code stream is marked as stream
now(ii) a abs (variable) means taking the absolute value of the variable;
step 63: if streamnowIf the first code stream sequence is located, a first processing mode is adopted; otherwise, the second processing mode is adopted.
A first processing mode:
step J1: find streamnowA position in the first code stream sequence.
Step J2: and rearranging the second code stream sequence and the second angle sequence.
Step J21: all the first code stream sequences are positioned in the streamnowAnd the former code streams are put into the second code stream sequence one by one according to the reverse order, the code streams in the original second code stream sequence are sequentially moved backwards, the code streams exceeding the sequence length are sequentially moved out and put into the tail part of the first code stream sequence, and the updated second code stream sequence is obtained.
Step J22: all are positioned at theta in the first angle sequencenowAnd putting the previous angles into the second angle sequence one by one according to a reverse order, sequentially moving the angles in the original second angle sequence backwards, sequentially moving the angles exceeding the length of the sequence out of the tail part of the first angle sequence, and acquiring an updated second angle sequence.
Step J3: rearranging the first code stream sequence and the first angle sequence:
will streamnowMoving to the first bit of the first code stream sequence, and simultaneously locating all the bits in the streamnowThe latter code stream moves forwards sequentially to obtain an updated first code stream sequence; then, theta is measurednowMove to the first of the first angular sequence while all will be at θnowAnd the later code streams sequentially move forwards to obtain an updated first angle sequence.
A second processing mode:
step L1: find streamnowA position in the second sequence of code streams.
Step L2: and rearranging the first code stream sequence and the first angle sequence.
Step L21: stream of the second code stream sequencenowAnd all are located in streamnowThe former code streams are put into the first code stream sequence one by one according to the reverse order, the code streams in the original first code stream sequence are sequentially moved backwards, the code streams exceeding the sequence length are sequentially moved out and put into the tail part of the second code stream sequence, and the updated first code stream sequence is obtained.
Step L22: in the second angle sequence, thetanowAnd all lie at θnowThe previous angles are put into the first angle sequence one by one according to the reverse order, the angles in the original first angle sequence are sequentially moved backwards, the angles exceeding the length of the sequence are sequentially moved out to be put into the tail part of the second angle sequence, and the updated first angle sequence is obtained.
Step L3: rearranging the second code stream sequence and the second angle sequence: all are located in streamnowThe latter code streams move forward in sequence until one code stream moves to the first position of the second code stream sequence, and an updated second code stream sequence is obtained; will all be located at thetanowAnd the subsequent code streams are sequentially moved forwards until an angle is moved to the first position of the second angle sequence, and the updated second angle sequence is obtained.
Step 64: constructing a panoramic video multi-path code stream distribution sequence table:
step 65: and sequentially transmitting the code streams in nt +1 time windows corresponding to the multi-path code streams of the panoramic video according to the sequence of the multi-path code stream distribution sequence table of the panoramic video.
Step 7: let nt be nt +1, determine const,
then Step3 is re-entered.
Example two
Fig. 4 is a block diagram of a panoramic video distribution system based on visual continuity according to a preferred embodiment of the present invention; the system comprises:
a reference code stream and reference angle setting module for selecting one code stream in multiple paths of code streams of the panoramic video as a reference code stream to be recorded as a streamcurStream ofcurThe corresponding camera collects the view angle as a reference angle, and the reference angle is recorded as thetacur。
Wherein, streamnRepresenting the nth spliced code stream of the panoramic video, wherein N is 1,2, and N represent the number of the spliced code streams; thetanRepresents streamnThe corresponding camera captures the view angle.
An angle difference calculation module for calculating the camera collection view angle and theta corresponding to each path of code stream of the panoramic videocurAngle difference d theta ofn,dθn=θn-θcur,n=1,2,...,N。
And the code stream queue sequencing device is used for arranging the multi-path code streams of the panoramic video into two code stream queues.
A first multi-path code stream sending module for sending const second panoramic video multi-path code streamn,n=1,2,...,N。
Wherein the content of the first and second substances,
const represents a time window duration parameter; t is t
0The initial buffering time of the sending code stream is shown, and can be 3-6 seconds generally; t is t
cRepresenting the buffering time of the sending code stream; nt denotes a time window index and has an initial value of 1.
A visual angle information sending module for sending the visual angle information in the time window in the const second time window
Wherein the visual angle information comprises
Indicating the upper and lower visual angle limits for the nth time window,
min (variable | condition) and max (variable | condition) respectively represent minimum and maximum values of variables satisfying the condition;
a first judgment processing module for judging if the panoramic video multi-path code stream is streamnIf the code stream in the nt +1 time window exists, entering a multi-path code stream distribution module; otherwise, ending the distribution of the panoramic video multi-path code stream.
And the multi-path code stream distribution device is used for distributing the multi-path code streams of the panoramic video according to the visual angle information.
A setting module, configured to make nt equal to nt +1, determine const,
then, the first multi-path code stream sending module is re-entered.
Further, fig. 5 is a detailed structure diagram of the code stream queue sorting apparatus in fig. 4; the code stream queue sequencing device comprises:
the ascending order arrangement module of the angle difference is used for ascending order arrangement of all the angle differences less than or equal to 0 and recording the angle differences as
Wherein k1 represents the number of all angular differences equal to or less than 0;
a first angle sequence and a first code stream sequence setting module, configured to arrange corresponding camera acquisition views into an angle sequence according to the arrangement sequence of all angle differences smaller than or equal to 0
Referred to as a first angular sequence; arranging multiple paths of code streams of the corresponding panoramic video into a code stream sequence and recording the code stream sequence
Called a first code stream sequence;
the angle difference descending order arrangement module is used for descending order arrangement of all the angle differences larger than 0 and recording the angle differences as
A second angle sequence and second code stream sequence setting module, configured to arrange corresponding camera acquisition views into an angle sequence according to the arrangement sequence of all angle differences greater than 0, and record the angle sequence as
Referred to as a second angular sequence; arranging multiple paths of code streams of the corresponding panoramic video into a code stream sequence and recording the code stream sequence
Referred to as a second code stream sequence.
Further, fig. 6 is a detailed structure diagram of the multi-path code stream distribution apparatus in fig. 4; the multi-path code stream distribution device comprises:
a sign view angle calculation module for calculating
Referred to as the sign view angle.
A third code stream acquisition module for first calculating
Then, finding out the camera collecting angle corresponding to the minimum value, and recording the camera collecting angle as theta
nowAnd the corresponding code stream is marked as stream
now(ii) a abs (variable) means taking the absolute value of the variable;
a second judgment processing module for if streamnowIf the first code stream sequence is located, entering a first processing device; otherwise, entering a second processing device.
The distribution sequence table building module is used for building a panoramic video multi-path code stream distribution sequence table:
and the second multi-path code stream sending module is used for sequentially sending the code streams in nt +1 time windows corresponding to the multi-path code streams of the panoramic video according to the sequence of the multi-path code stream distribution sequence table of the panoramic video.
Further, fig. 7 is a detailed structural view of the first processing device in fig. 6; the first processing device includes:
a first position finding module for finding streamnowA position in the first code stream sequence.
The first reordering module is used for reordering the second code stream sequence and the second angle sequence.
Step J21: all the first code stream sequences are positioned in the streamnowAnd the former code streams are put into the second code stream sequence one by one according to the reverse order, the code streams in the original second code stream sequence are sequentially moved backwards, the code streams exceeding the sequence length are sequentially moved out and put into the tail part of the first code stream sequence, and the updated second code stream sequence is obtained.
Step J22: all are positioned at theta in the first angle sequencenowAnd putting the previous angles into the second angle sequence one by one according to a reverse order, sequentially moving the angles in the original second angle sequence backwards, sequentially moving the angles exceeding the length of the sequence out of the tail part of the first angle sequence, and acquiring an updated second angle sequence.
The second reordering module is used for reordering the first code stream sequence and the first angle sequence:
will streamnowMoving to the first bit of the first code stream sequence, and simultaneously locating all the bits in the streamnowThe latter code stream moves forwards sequentially to obtain an updated first code stream sequence; then, theta is measurednowMove to the first of the first angular sequence while all will be at θnowAnd the later code streams sequentially move forwards to obtain an updated first angle sequence.
Further, fig. 8 is a detailed configuration diagram of the second processing device in fig. 6. The second processing device includes:
a second position finding module for finding streamnowA position in the second sequence of code streams.
And the third reordering module is used for reordering the first code stream sequence and the first angle sequence.
Step L21: stream of the second code stream sequencenowAnd all are located in streamnowThe former code streams are put into the first code stream sequence one by one according to the reverse order, the code streams in the original first code stream sequence are sequentially moved backwards, the code streams exceeding the sequence length are sequentially moved out and put into the tail part of the second code stream sequence, and the updated first code stream sequence is obtained.
Step L22: in the second angle sequence, thetanowAnd all lie at θnowThe previous angles are put into the first angle sequence one by one according to the reverse order, the angles in the original first angle sequence are sequentially moved backwards, the angles exceeding the length of the sequence are sequentially moved out to be put into the tail part of the second angle sequence, and the updated first angle sequence is obtained.
A fourth reordering module, configured to reorder the second code stream sequence and the second angle sequence:
all are located in streamnowThe latter code streams move forward in sequence until one code stream moves to the first position of the second code stream sequence, and an updated second code stream sequence is obtained; will all be located at thetanowAnd the subsequent code streams are sequentially moved forwards until an angle is moved to the first position of the second angle sequence, and the updated second angle sequence is obtained.
It will be understood by those skilled in the art that all or part of the steps in the method according to the above embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, such as ROM, RAM, magnetic disk, optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.