Virtual player based on user perspective
Technical field
The present invention relates to a kind of virtual player, and in particular to a kind of virtual player based on user perspective, belongs to logical
Believe technical field.
Background technology
Panoramic video has third dimension and the sense of reality, can provide the user with visual experience well, it is possible to achieve body faces
The experience in its border and the surprised effect more to make one see with different eyes.With the continuous upgrading of Computer Image Processing ability, to realize
Broadcasting to panoramic video, panoramic video player is developed on the basis of traditional 2D video players.Panoramic video is broadcast
Device is put by playing the 360 degrees omnidirection real scene video stored with digital signal form, is created that one kind has privacy and people concurrently
The immersion virtual experience of property.
With the continuous improvement of people's demand, people be more desirable to not only it can be seen that it is true, comprehensively, intuitively aphorama
Frequently, short-sighted frequency can also be obtained in real time when watching panoramic video to be kept as a souvenir or with friend share.At present, it is also no to appoint
A panoramic video player of anticipating can be realized in panoramic video broadcasting records short video capability.
The content of the invention
The purpose of the present invention is to solve the above problems, providing one kind can obtain in real time while panoramic video is watched
Take the virtual player of short-sighted frequency.
The present invention adopts the technical scheme that to solve the above problems:The virtual broadcasting based on user perspective of the present invention
Device, including:First link unit, instruction acquiring unit, cut unit, the first searching unit, memory cell, the second chain order
Member, video sequence acquiring unit, the second searching unit and coding unit;
First link unit is bi-directionally connected panoramic video player, output end link order acquiring unit, is used for
The instruction acquiring unit of panoramic video player and virtual player is connected, the output end of the instruction acquiring unit connects respectively
Unit and the first searching unit are cut, the instruction for user to be passed on by panoramic video player is respectively transmitted to cut list
Member and the first searching unit, first searching unit are bi-directionally connected memory cell, for reading the rope of memory cell storage
The mapping relations of quotation part and sequence of frames of video and panoramic pictures, first searching unit are also connected by the second link unit
Video server, for sending the request of transmission sequence of frames of video to video server, and receive regarding for video server transmission
Frequency frame sequence, the input of the memory cell connects video server by the second link unit, for storing Video service
The index file of device transmission, the mapping relations and panoramic pictures sequence of sequence of frames of video and panoramic pictures, the video sequence obtain
The input of unit is taken to connect video server by the second link unit, output end connects the input of the second searching unit,
Deposited for obtaining the sequence of frames of video of video server transmission and transmitting to the second searching unit, the second searching unit connection
Storage unit, for searching and obtaining panoramic pictures sequence, the output end connection of second searching unit cuts unit, for inciting somebody to action
The panoramic pictures sequence of acquisition is transmitted to cutting unit, the output end connection coding unit for cutting unit, for by panorama
Sequence of pictures is cut to the sequence of pictures matched with user perspective, and transmits to coding unit, the output end of the coding unit
Panoramic video player is connected by the first link unit, for re-starting coding to sequence of pictures, and passes panoramic video back
Player.
The video intercepting method realized on the above-mentioned virtual player based on user perspective, specific steps include:
101st, instruction acquiring unit user in real includes view parameter and frame by what panoramic video player was sent
The beginning record command of time parameter, and the frame time parameter for starting to include in record command is transmitted to the first searching unit,
User perspective parameter is transmitted to cutting unit;
102nd, the first searching unit according to frame time parameter search memory cell store index file in corresponding video
Position of the frame sequence in panoramic video file, and positional information is sent to frame of video corresponding to video server request transmission
Sequence;
103rd, video sequence acquiring unit real-time reception video server is sent sequence of frames of video and by the video of acquisition
Frame sequence is transmitted to the second searching unit;
104th, sequence of frames of video and panoramic pictures of second searching unit in sequence of frames of video and memory cell reflects
Penetrate relation to search from memory cell and obtain panoramic pictures sequence corresponding to sequence of frames of video, and panoramic pictures sequence is transmitted
To cutting unit;
105th, unit user perspective parameter according to corresponding to each frame video is cut to cut on each Zhang Quanjing picture in real time
Take corresponding picture, and by each target rectangle picture transfer to coding unit;
106th, after instructing acquiring unit to get recording stop instruction, stop obtaining view parameter and frame time parameter,
And informed code unit will start to be recorded to the target rectangle figure based on user perspective for terminating to obtain in this period of recording
Piece sequence is recompiled and sent to panoramic video player plays sequentially in time.
Further, frame time parameter described in step 101 is timestamp of the frame in video file.
Further, the specific method of the step 105 is:Planar rectangular panoramic pictures are mapped on sphere, with flat
The side of face rectangle panoramic pictures as sphere semi arch generate corresponding to panorama mapping sphere, and by planar rectangular panoramic pictures
It is mapped on panorama mapping sphere, spherical figure is cut on panorama mapping sphere according to user perspective parameter and pre-set dimension,
Then spherical figure will have been cut and be mapped to target rectangle picture.
Beneficial effect:
First, the present invention by search panoramic video play when corresponding sequence of frames of video, and according to sequence of frames of video with
The mapping relations of panoramic pictures, panoramic pictures sequence is found, user perspective institute is cut in panoramic pictures by cutting unit
Corresponding picture, and resulting sequence of pictures is recompiled sequentially in time and passes panoramic video player back, realize use
Family obtains short-sighted frequency in real time while panoramic video is watched;
Second, the code check of original panoramic picture is that comparison is high, and code check and resolution ratio are into positive correlation, but in transmission of video mistake
Cheng Zhong, in order to ensure to transmit fluency, code check during panoramic video compressed encoding can be controlled, therefore code check will not be too high, panorama
Video pictures resolution ratio is not also high, and virtual player of the invention can be in the case of panoramic video resolution ratio be high, in original
Intercepted in beginning panoramic pictures after fragment re-encoding can according to being actually needed compressed encoding into the higher video flowing of resolution ratio, for example,
Panoramic video screen resolution is 2880*1440, and target rectangle sequence of pictures resolution ratio can more a height of 4000*3000.
Brief description of the drawings
Fig. 1 is the fundamental diagram of the present invention.
Embodiment
Embodiment 1:Illustrate present embodiment, virtually the broadcasting based on user perspective of present embodiment with reference to Fig. 1
Put device overall structure as shown in figure 1, including:First link unit, instruction acquiring unit, cut unit, the first searching unit, deposit
Storage unit, the second link unit, video sequence acquiring unit, the second searching unit and coding unit;
First link unit is bi-directionally connected panoramic video player, output end link order acquiring unit, is used for
The instruction acquiring unit of panoramic video player and virtual player is connected, the output end of the instruction acquiring unit connects respectively
Unit and the first searching unit are cut, the instruction for user to be passed on by panoramic video player is respectively transmitted to cut list
Member and the first searching unit, first searching unit are bi-directionally connected memory cell, for reading the rope of memory cell storage
The mapping relations of quotation part and sequence of frames of video and panoramic pictures, first searching unit are also connected by the second link unit
Video server, for sending the request of transmission sequence of frames of video to video server, and receive regarding for video server transmission
Frequency frame sequence, the input of the memory cell connects video server by the second link unit, for storing Video service
The index file of device transmission, the mapping relations and panoramic pictures sequence of sequence of frames of video and panoramic pictures, the video sequence obtain
The input of unit is taken to connect video server by the second link unit, output end connects the input of the second searching unit,
Deposited for obtaining the sequence of frames of video of video server transmission and transmitting to the second searching unit, the second searching unit connection
Storage unit, for searching and obtaining panoramic pictures sequence, the output end connection of second searching unit cuts unit, for inciting somebody to action
The panoramic pictures sequence of acquisition is transmitted to cutting unit, the output end connection coding unit for cutting unit, for by panorama
Sequence of pictures is cut to the sequence of pictures matched with user perspective, and transmits to coding unit, the output end of the coding unit
Panoramic video player is connected by the first link unit, for re-starting coding to sequence of pictures, and passes panoramic video back
Player.
It should be noted that the virtual player of the present invention can be arranged on video server end as One function module
Or panoramic video player end is arranged on as a part of panoramic video player, or be arranged on as separate unit
Between panoramic video player and video server, the conversion of virtual player locus, the essence to the present invention is not formed
Property improve.
Embodiment 2:Present embodiment on the virtual player based on user perspective of embodiment 1
The video intercepting method of realization, specific steps include:
101st, the beginning record command that instruction acquiring unit user in real is sent by panoramic video player, and will
The frame time parameter for starting to include in record command is transmitted to the first searching unit, user perspective parameter is transmitted single to cutting
Member, wherein user are sent during panoramic video is watched records short video request, when request carries user perspective parameter and frame
Between parameter, wherein, user perspective parameter can according in user equipment attitude transducer obtain viewing visual angle, can also obtain
The viewing visual angle of user's input;
102nd, video server generates time index file, the index file root when panoramic video generates according to timestamp
According to position of the timestamp index search sequence of frames of video in panoramic video file;Video server is built in panorama video code
Vertical mapping relations between sequence of frames of video and panoramic pictures sequence, such as:It is n to set frame per second, and sequence of frames of video is represented with Irn
N-th frame image in r-th of frame sequence, panoramic pictures sequence are represented with Drn corresponding to the n-th frame image in r-th of frame sequence
Panoramic pictures, then the mapping relations between sequence of frames of video and panoramic pictures sequence can be expressed as Irn → Drn;It is above-mentioned
Index file, mapping relations and panoramic pictures sequence are stored in virtual player memory cell immediately, the first searching unit root
Position of the corresponding sequence of frames of video in panoramic video file in the index file of memory cell storage is searched according to frame time parameter
Put, and positional information is sent to sequence of frames of video corresponding to video server request transmission;
103rd, video sequence acquiring unit real-time reception video server is sent sequence of frames of video and by the video of acquisition
Frame sequence is transmitted to the second searching unit;
104th, sequence of frames of video and panoramic pictures of second searching unit in sequence of frames of video and memory cell reflects
Penetrate relation to search from memory cell and obtain panoramic pictures sequence corresponding to sequence of frames of video, and panoramic pictures sequence is transmitted
To cutting unit;
105th, unit user perspective parameter according to corresponding to each frame video is cut to cut on each Zhang Quanjing picture in real time
Take corresponding picture, and by each target rectangle picture transfer to coding unit;
106th, after instructing acquiring unit to get recording stop instruction, stop obtaining view parameter and frame time parameter,
And informed code unit will start to be recorded to the target rectangle figure based on user perspective for terminating to obtain in this period of recording
Piece sequence is recompiled and sent to panoramic video player plays sequentially in time.
Further, frame time parameter described in step 101 is timestamp of the frame in video file.
Further, the specific method of the step 105 is:Planar rectangular panoramic pictures are mapped on sphere, with flat
The side of face rectangle panoramic pictures as sphere semi arch generate corresponding to panorama mapping sphere, and by planar rectangular panoramic pictures
It is mapped on panorama mapping sphere, spherical figure is cut on panorama mapping sphere according to user perspective parameter and pre-set dimension,
The setting of size can based on experience value, or sent according to user record the screen size parameter that is included in short video instructions come
Setting, will cut spherical figure and has been mapped to target rectangle picture after cutting.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
God any modification, equivalent substitution and improvements made etc., should be included in the scope of the protection with principle.