H.264 video reorientation method and device of based on Windows systemTechnical field
The invention belongs to computer realm, relate to a kind of video reorientation method, especially relate to a kind of based on WindowsH.264 the video reorientation method of system and device.
Background technology
Along with the development of cloud, people are more and more abundanter to the demand of virtual desktop technology.Current at virtual tableIn the research of surface technology, mainstream technology is the technology such as desktop display protocol, users' personal allocation.And video decompression technology byIn huge data bandwidth can be caused, therefore it is the key point in virtual desktop technology and difficult point.
The following is the operation principle of current virtual desktop decompression technique, flow process as shown in Figure 1:
1. far-end video is screened by remote decoder by the difference of form, and the video separation of different-format,To facilitate the video to different-format to carry out different process.
2. remote decoder divides situation by Media Stream by the incoming this locality of network.The classification policy of prior art includes: profitWith characteristic parameter, relative noise is filtered, automatically detects Motion-changed Region, according to the boundary characteristic (limit of object videoEdge detects) generate object video.
3. local decoder is according to different incoming Media Streams, does corresponding decoding in specific one module.
4. become local video stream after decoding to export at local screen.
Prior art is only to process whole virtual desktop, and video does not do single optimization and process, there is voidThe problems such as plan desktop broadcasting video effect is poor, the most smooth.
Summary of the invention
Defect that the purpose of the present invention is contemplated to overcome above-mentioned prior art to exist and provide a kind of and reduce resource occupationAnd save bandwidth, be greatly improved and play the H.264 video based on Windows system of the definition of video and fluency and resetTo method and device.
The purpose of the present invention can be achieved through the following technical solutions:
A kind of H.264 video reorientation method based on Windows system, comprises the following steps:
Receive the video file playing request of client;
The form of corresponding video file is obtained according to video file playing request;
Judge that whether described form is H.264 form, the most then extract video area and send and be decoded showing to clientShow, if it is not, after then directly described video file being exported by far-end virtual desktop, by with non-H.264 format stream mediaFar-end virtual desktop is sent along to client.
After the video file playing request of described reception client, obtain corresponding video according to video file playing requestFile, obtains the form of this video file after decoding described video file.
When judging described form as H.264 form, also include:
Preserving the video file after video area is extracted, and sent to client by network channel, client receives and carriesObtaining Streaming Media after the video area decoding gone out, the video file after described Streaming Media extracts with video area carries out hardware jointlyShow after decoding process.
A kind of H.264 video redirection device based on Windows system, including the virtual machine connected by network channelServer and client side, described virtual machine server includes:
Input module, for receiving the video file playing request that client sends, and plays according to described video fileRequest is loaded into corresponding video file;
Far-end decoder module, for automatically identifying the form of video file and carrying out alignment processing: if the lattice of video fileFormula is H.264 form, then export after processing described video file, if the form of video file is non-H.264 form, then in instituteState and show on far-end virtual desktop, by the virtual table of far-end with non-H.264 format stream media after video file is decodedFace exports;
Sending module, for receiving the output data of far-end decoder module;
First transport module, for passing through network tunnel transports to client by the output data in sending module;
Described client includes:
Second transport module, for the output data of sink virtual machine server;
Receiver module, for judging that whether described output data are the media data of H.264 form;
Local hard decoder module, responds when the judged result of receiver module is for being, for the media number to H.264 formAccording to being decoded;
Screen display module, when the judged result at receiver module is no or to receive local hard decoder module decodedRespond during data, for output data or the decoded data of receiver module are shown at local screen.
Described far-end decoder module includes:
For the video file of H.264 form being carried out the unit of video area extraction;With
For preserving the unit of the H.264 remainder of the video file of form after video area is extracted.
Described local hard decoder module includes:
For the unit that the video area in the media data of H.264 form is decoded;With
For video flowing and the far-end virtual desktop of decoding to be carried out the unit of hardware decoding as overall region.
Compared with prior art, the invention have the advantages that
1) present invention carries out first screening video format when video redirects, and the data to different video formDistinctly process, particular video stream is done special process, take full advantage of the ability of local hardware decoding, can be effectivelyReduce the utilization rate of CPU, so that the broadcasting of video is more smooth, promote the experience of user
2) present invention can effectively reduce resource occupation and save bandwidth;
3) present invention is different from existing technical scheme, and the present invention takes full advantage of the ability of local hardware decoding so that it isCan not only reach reduce remote desktop resource occupation and save the purpose of bandwidth, and substantially increase and play the clear of videoDegree and fluency.
Accompanying drawing explanation
Fig. 1 is the workflow diagram of existing video decoding techniques;
Fig. 2 is the workflow diagram of the inventive method;
Fig. 3 is the structural representation of apparatus of the present invention.
Detailed description of the invention
The present invention is described in detail with specific embodiment below in conjunction with the accompanying drawings.The present embodiment is with technical solution of the present inventionPremised on implement, give detailed embodiment and concrete operating process, but protection scope of the present invention be not limited toFollowing embodiment.
As in figure 2 it is shown, the present embodiment provide a kind of H.264 video reorientation method based on Windows system, including withLower step:
S1: receive the video file playing request of client;
S2: media player obtains corresponding video file according to video file playing request, to described video file solutionThe form of this video file is obtained, it is judged that whether described form is H.264 form, the most then perform step S3 after Ma, if it is not,Then perform step S4;
S3: extract video area transmission and be decoded display to client, preserve the video file after video area is extracted,And sent to client by network channel, client obtains Streaming Media, described stream matchmaker after receiving the video area decoding proposedVideo file after body extracts with video area carries out display after hardware decoding process jointly;
S4: after directly described video file being exported by far-end virtual desktop, by with non-H.264 format stream mediaFar-end virtual desktop is sent along to client.With the far-end virtual desktop of non-H.264 format stream media as whole region,Its desktop changes, then video card can obtain delta data the most automatically, and is sent to client frame by frame and processes.
Realize the H.264 video redirection device based on Windows system of said method as it is shown on figure 3, include passing throughThe virtual machine server 1 of network channel connection and client 2.
Virtual machine server 1 includes input module 11, far-end decoder module 12, sending module 13 and the first transport module14, input module 11 is used for receiving the video file playing request that client sends, and according to described video file playing requestIt is loaded into corresponding video file;Far-end decoder module 12 is for automatically identifying the form of video file and carrying out alignment processing: ifThe form of video file is H.264 form, then output after processing described video file, and concrete process includes H.264 formVideo file carry out video area extraction, and preserve the remainder of the H.264 video file of form after video area is extractedPoint;If the form of video file is non-H.264 form, then aobvious on far-end virtual desktop after described video file is decodedShow, the far-end virtual desktop with non-H.264 format stream media is exported;Sending module 13 is for receiving far-end decoder moduleOutput data;First transport module 14 is for passing through network tunnel transports to client by the output data in sending module;
Client 2 includes receiver module 21, local hard decoder module 22, screen display module 23 and the second transport module24, the second transport module 24 is for the output data of sink virtual machine server;Receiver module 21 is used for judging described output numberAccording to the media data being whether H.264 form;Local hard decoder module 22 responds when the judged result of receiver module is for being, usesIn being decoded the media data of H.264 form, decoding process includes the video area in the media data to H.264 formIt is decoded and video flowing and the far-end virtual desktop of decoding is carried out hardware decoding as overall region;Screen display module 23Respond when judged result at receiver module is no or when receiving the local decoded data of hard decoder module, for receivingOutput data or the decoded data of module show on local screen.
By above-mentioned technology, video format is carried out screening and process out of the ordinary, the utilization rate of CPU can be effectively reduced, fromAnd make the broadcasting of video more smooth, promote the experience of user.