Summary of the invention
For the problems referred to above, the object of this invention is to provide a kind of method and apparatus of the quick display video overcome the above problems, solve after user opens video file on computers and need the wait long period just can see the problem of the image of this video file.
For solving the problems of the technologies described above, the invention provides a kind of method of quick display video, described method comprises:
Determine the N number of video file needing fast display, wherein N be greater than zero integer; Following content is performed to each video file in described N number of video file: the header file information extracting video file, in the video memory of video card, one is created for storing the memory space of described header file information according to the size of described header file information, record the stored position information of memory space described in described video memory, the mapping relations of the mark recording this video file described stored position information of header file information in described video memory of video file therewith;
Receive the OPEN for a target video file in described N number of video file, according to the stored position information of described mapping relationship searching to the memory space of header file information in video memory of described target video file, loaded the header file information of described target video file according to described stored position information respective stored space from described video memory by the graphic process unit of described video card, after having loaded from described target video file header file information end position read the video data of described target video file and play by display.
Wherein, the method for above-mentioned quick display video can also have following characteristics:
Memory capacity for the capacity header file information therewith storing the memory space of a header file information is identical, and the stored position information of described memory space refers to original position and the end position of described memory space.
Wherein, the method for above-mentioned quick display video can also have following characteristics:
Capacity for the N number of memory space storing described N number of header file information is all identical and for continuous print memory space, the stored position information of described memory space refers to the initial address of described N number of memory space, the capability value of single memory space and the identification number of memory space.
Wherein, the method for above-mentioned quick display video can also have following characteristics:
When the value of described N is greater than 1, the video format of described N number of video file is incomplete same.
Wherein, the method for above-mentioned quick display video can also have following characteristics:
The video format of described video file comprises: AVI form, WMV form, ASF form, mpeg format, RM form, RMVB form.
For solving the problems of the technologies described above, the invention provides a kind of equipment of quick display video, described equipment comprises: central processing unit, display, video card, and described video card comprises graphic process unit and video memory;
Described central processing unit, for determining the N number of video file needing fast display, wherein N be greater than zero integer; Also for performing following content to each video file in described N number of video file: the header file information extracting video file, in video memory, one is created for storing the memory space of described header file information according to the size of described header file information, record the stored position information of memory space described in described video memory, the mapping relations of the mark recording this video file described stored position information of header file information in described video memory of video file therewith; Also for receiving the OPEN for a target video file in described N number of video file, according to the stored position information of described mapping relationship searching to the memory space of header file information in video memory of described target video file; Also for described stored position information is notified to described profiling processor; Also for after the header file information of described graphic process unit to described target video file has loaded, from described target video file header file information end position read the video data of described target video file and play by display;
Described graphic process unit, for loading the header file information of described target video file according to the described stored position information corresponding memory space from described video card received.
Wherein, the equipment of above-mentioned quick display video can also have following characteristics:
Described graphic process unit, also for determining a memory space according to the original position indicated in described stored position information to end position, from then on memory space loads the header file information of described target video file.
Wherein, the equipment of above-mentioned quick display video can also have following characteristics:
Described graphic process unit, also for calculating in described stored position information the long-pending of the capability value of single memory space that indicates and the identification number of memory space, determine a memory space according to the first address indicated in described stored position information and described amassing, from then on memory space loads the header file information of described target video file.
Wherein, the equipment of above-mentioned quick display video can also have following characteristics:
When the value of described N is greater than 1, the video format of described N number of video file is incomplete same.
Wherein, the equipment of above-mentioned quick display video can also have following characteristics:
When the value of described N is greater than 1, the video format of described N number of video file is incomplete same, and described video format comprises: AVI form, WMV form, ASF form, mpeg format, RM form, RMVB form.
In the present invention, the header file information of video file be stored in video memory and use the graphic process unit of video card to resolve the header file information of video file, the time needed for header file parsing is shortened greatly by the mode of central processing unit parsing header file information compared in prior art, make user foreshorten within 1 second from the stand-by period clicked certain video file to the video image seeing video file, greatly improve the experience of user.Especially, when the occupancy of central processing unit is in high percentage, can be fast for user demonstrates its video image needing viewing, for user provides efficient service.
Specific embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combination in any mutually.
Basic thought of the present invention is, the header file information of video file is stored in video memory and uses the graphic process unit of video card to resolve the header file information of video file, the time needed for header file parsing is shortened greatly by the mode of central processing unit parsing header file information compared in prior art, user is made to foreshorten within 1 second, to improve the experience of user from the stand-by period clicked certain video file to the video image seeing video file.
Fig. 1 is the method for quick display video in the present invention, and this method comprises the following steps:
Step S101, determines the N number of video file needing fast display, wherein N be greater than zero integer; Following content is performed to video file each in N number of video file: the header file information extracting video file, in the video memory of video card, one is created for storing the memory space of this header file information according to the size of header file information, the stored position information of this memory space in record video memory, the mapping relations of the mark recording this video file stored position information of header file information in video memory of video file therewith.
Step S102, receive the OPEN for a target video file in above-mentioned N number of video file, according to the stored position information of above-mentioned mapping relationship searching to the memory space of header file information in video memory of target video file, by the graphic process unit of video card according to the header file information of above-mentioned stored position information respective stored space loaded targets video file from video card, after having loaded from target video file header file information end position read the video data of target video file and play by display.
In this method step S101 complete after can multiple exercise step S102, namely, after completing the storage of header file information of N number of video file, can repeatedly play in this N number of video file or the multiple video files in this N number of video file be play respectively.
When in this method, the value of N is greater than 1, the video format of N number of video file can be same video format, or the video format of N number of video file is incomplete same.The video format of video file comprises: Audio Video Interleaved (Audio Video Interactive, be called for short AVI) form, windows media video (Windows Media Video, be called for short WMV), senior stream format (Advanced Streaming Format, be called for short ASF), dynamic image expert group (MPEG (Moving Pictures Experts Group, be called for short MPEG) form, RM form, RMVB form.
In this method, the set-up mode of memory space can adopt the one in following two kinds of modes:
Mode one, the memory capacity for the capacity header file information therewith storing the memory space of a header file information is identical, and the stored position information of memory space refers to original position and the end position of memory space.When performing step S101, comprised according to the method for stored position information header file information of respective stored space loaded targets video file from video card by the graphic process unit of video card: determine a memory space according to the original position indicated in stored position information to end position, from then on the header file information of memory space loaded targets video file.
Mode two, capacity for the N number of memory space storing N number of header file information is all identical and for continuous print memory space, the stored position information of memory space refers to the initial address of N number of memory space, the capability value of single memory space and the identification number of memory space.This identification number is corresponding with the identification number of N number of video file, and the identification number of the identification number of such as, when the identification number of first video file is 0 corresponding memory space is also the identification number of 0, second video file memory space corresponding when being 1 is also 1.When performing step S102, comprised according to the method for stored position information header file information of respective stored space loaded targets video file from video card by the graphic process unit of video card: calculate in stored position information amassing of the capability value of single memory space that indicates and the identification number of memory space, a memory space is determined, the from then on header file information of memory space loaded targets video file according to the first address indicated in stored position information and above-mentioned amassing.
This method is by being stored in video memory by the header file information of video file and using the graphic process unit of video card to resolve the mode of the header file information of video file, shorten the time needed for header file parsing greatly, make user foreshorten within 1 second from the stand-by period using video jukebox software to open certain video file to the video image seeing video file, greatly improve the experience of user.Especially, when the occupancy of central processing unit is in high percentage, can be fast for user demonstrates its video image needing viewing, for user provides efficient service.
In the present invention, the equipment of quick display video is computer equipment, and comprising: central processing unit, display, video card, this video card comprises graphic process unit and video memory.
Central processing unit for determining the N number of video file needing fast display, wherein N be greater than zero integer; Also for performing following content to video file each in N number of video file: the header file information extracting video file, in video memory, one is created for storing the memory space of header file information according to the size of header file information, the stored position information of this memory space in record video memory, the mapping relations of the mark recording this video file stored position information of header file information in video memory of video file therewith.
Central processing unit also for receiving the OPEN for a target video file in N number of video file, according to the stored position information of mapping relationship searching to the memory space of header file information in video memory of target video file; Also for stored position information is notified to graphic process unit; Also for after the header file information of graphic process unit to target video file has loaded, from target video file header file information end position read the video data of target video file and play by display;
Graphic process unit is used for the header file information according to the stored position information corresponding memory space loaded targets video file from video memory received.Concrete, according to the mode one in said method, graphic process unit is used for determining a memory space according to the original position indicated in stored position information to end position, the from then on header file information of memory space loaded targets video file.According to the mode two in said method, graphic process unit is for calculating the long-pending of the capability value of single memory space that indicates in stored position information and the identification number of memory space, a memory space is determined, the from then on header file information of memory space loaded targets video file according to the first address indicated in stored position information and above-mentioned amassing.
Below by application example, the present invention is described in detail.
Run the application program developed for method of the present invention in a computer, 4 video files be stored in hard disk (being called video file 1, video file 2, video file 3, video file 4) are loaded in the listed files of application.When loading video file 1, the header file information of video file 1 is extracted by the Video Decoder function in application program, in the video memory of video card, one is created for storing the memory space 1 of this header file information according to the size of header file information, the stored position information 1 of this memory space in record video memory, the mapping relations 1 of the mark (this mark can be the title of video file or numbering) recording this video file 1 stored position information 1 of header file information in video memory of video file 1 therewith.Video file 2 is loaded successively, video file 3, video file 4 according to the method.
User clicks video file 1 in the listed files at application interface, found the stored position information 1 of the memory space 1 of header file information in video memory of this video file 1 according to the corresponding mapping relations 1 of video file 1 therewith by application, loaded the header file information of video file 1 from the memory space 1 video card according to stored position information 1 by the graphic process unit of video card, after having loaded in application from video file 1 header file information end position read the video data of video file 1 and play by display.
User clicks video file 2 in the listed files at application interface, found the stored position information 2 of the memory space 2 of header file information in video memory of this video file 2 according to the corresponding mapping relations 2 of video file 2 therewith by application, loaded the header file information of video file 2 from the memory space 2 video card according to stored position information 2 by the graphic process unit of video card, after having loaded in application from video file 2 header file information end position read the video data of video file 2 and play by display.
Above-described content can combine enforcement individually or in every way, and these variant are all within protection scope of the present invention.
It should be noted that, in this article, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the article of a series of key element or equipment not only comprises those key elements, but also comprise other key elements clearly do not listed, or also comprise by this article or the intrinsic key element of equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within the article or equipment comprising described key element and also there is other identical element.
Above embodiment only in order to technical scheme of the present invention and unrestricted to be described, only with reference to preferred embodiment to invention has been detailed description.Those of ordinary skill in the art should be appreciated that and can modify to technical scheme of the present invention or equivalent replacement, and does not depart from the spirit and scope of technical solution of the present invention, all should be encompassed in the middle of right of the present invention.