CN108024138A - A kind of method for packing and device - Google Patents

A kind of method for packing and device Download PDF

Info

Publication number
CN108024138A
CN108024138A CN201610967488.4A CN201610967488A CN108024138A CN 108024138 A CN108024138 A CN 108024138A CN 201610967488 A CN201610967488 A CN 201610967488A CN 108024138 A CN108024138 A CN 108024138A
Authority
CN
China
Prior art keywords
video frame
write
writing
storage area
media file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610967488.4A
Other languages
Chinese (zh)
Inventor
辛安民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201610967488.4A priority Critical patent/CN108024138A/en
Publication of CN108024138A publication Critical patent/CN108024138A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4331Caching operations, e.g. of an advertisement for later insertion during playback
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4332Content storage operation, e.g. storage operation in response to a pause request, caching operations by placing content in organized collections, e.g. local EPG data repository
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)

Abstract

An embodiment of the present invention provides a kind of method for packing and device, method includes:Obtain each video frame of video data to be packaged;Each video frame is write to the media file storage area in default package file;Wherein, included at least in the package file:For writing the media file storage area of video frame and pre- writing buffer for writing index data;After any video frame is write the media file storage area, the index data of the video frame is write into the pre- writing buffer, multimedia file is obtained with encapsulation.Using the embodiment of the present invention, the playability of storage system packaged obtained multimedia file under power down scene is improved.

Description

A kind of method for packing and device
Technical field
The present invention relates to technical field of data processing, more particularly to a kind of method for packing and device.
Background technology
With the development of technology, video data can be packaged using a variety of method for packing, so as to obtain different envelopes Fill the multimedia file of form.For example, can into MP4, (MPEG-4Part 14, uses the multimedia of MPEG-4 by video encapsulation Computer archive form), avi (Audio Video Interleaved, Audio Video Interleaved form) and WMV (Windows Media Video, media video form) etc. form multimedia file.
Wherein, by video data be packaged into MP4 and avi when need carry index data multimedia file when, it is necessary to Then Mr. encapsulates each video frame of video data into file header, after often having encapsulated a video frame, the video frame is corresponding In index data write-in memory;And then after meeting the file size of external setting-up, all indexes of record in memory Data are uniformly written to the end of file, and then form a multimedia file.Wherein, phase can be parsed by index data Answer the position of video frame.
But for this kind of packaged type, once the storage system power down in encapsulation process, the index number in memory According to that will lose, it can so cause the index data of video data can not write the file to be encapsulated, most video data at last It is encapsulated into the multimedia file for lacking index data.And when broadcasting lacks the multimedia file of index data, by institute Index data can not be obtained in the multimedia file of acquisition, causes multimedia file can not carry out normal play.
As it can be seen that for needing to carry the multimedia file of index data, how to improve under storage system power down scene The playability of packaged obtained multimedia file is a urgent problem to be solved.
The content of the invention
The purpose of the embodiment of the present invention is to provide a kind of method for packing and device, improves storage system in power down scene The playability of lower packaged obtained multimedia file.
In a first aspect, an embodiment of the present invention provides a kind of method for packing, the method may include:
Obtain each video frame of video data to be packaged;
Each video frame is write to the media file storage area in default package file;Wherein, the encapsulation text Included at least in part:For writing the media file storage area of video frame and pre- writing buffer for writing index data;
It is after any video frame is write the media file storage area, the index data write-in of the video frame is described pre- Writing buffer, multimedia file is obtained with encapsulation.
Alternatively, before each video frame is write the media file storage area in default package file, also wrap Include:
Fixed indices parameter in the index data of each video frame and file header are write into the pre- writing buffer, Wherein, the file header carries the encapsulation format information of the package file;
It is described after any video frame is write the media file storage area, the index data of the video frame is write into institute The step of stating pre- writing buffer, including:
After any video frame is write the media file storage area, by the video frame in addition to the fixed indices parameter Index data, write the pre- writing buffer.
Alternatively, by the index data in addition to the fixed indices parameter of the video frame, the pre- writing buffer is write The step of, including:
By pre- writing buffer described in the change index parameter read-in in the index data of the video frame;Wherein, the change Indexing parameter at least carries the size information of the video frame, storage location offset information, timestamp information and key frame information.
Alternatively, before each video frame is write the media file storage area in default package file, also wrap Include:
Judge pre- writing buffer whether is preset with default package file, write each video frame if so, performing The step of entering the media file storage area of default package file;
If it is not, creating the pre- writing buffer, the media that each video frame is write to default package file are performed The step of file storage area.
Alternatively, the package file prewrites setting buffers before media file storage area.
Alternatively, before each video frame is write the media file storage area in default package file, also wrap Include:Structure includes the media file storage area and the encapsulation of the pre- writing buffer for writing index data for being used to write video frame in advance File.
Second aspect, an embodiment of the present invention provides a kind of packaging system, described device can include:
Obtaining unit, for obtaining each video frame of video data to be packaged;
First writing unit, for each video frame to be write to the media file storage in default package file Area;Wherein, included at least in the package file:For writing the media file storage area of video frame and for writing index data Pre- writing buffer;
Second writing unit, after any video frame is write the media file storage area, by the index of the video frame Data write the pre- writing buffer, and multimedia file is obtained with encapsulation.
Alternatively, packaging system provided in an embodiment of the present invention, can also include:
3rd writing unit, for each video frame to be write to the media file storage in default package file Qu Qian, the pre- writing buffer is write by the fixed indices parameter in the index data of each video frame and file header, its In, the file header carries the encapsulation format information of the package file;
Correspondingly, the second writing unit is specifically used for:
After any video frame is write the media file storage area, by the video frame in addition to the fixed indices parameter Index data, write the pre- writing buffer.
Alternatively, the second writing unit is specifically used for:
After any video frame is write the media file storage area, by the change index in the index data of the video frame Pre- writing buffer described in parameter read-in;Wherein, the change index parameter at least carries the size information of the video frame, storage position Put offset information, timestamp information and key frame information.
Alternatively, packaging system provided in an embodiment of the present invention, can also include:
Creating unit, for creating pre- writing buffer;
Judging unit, for each video frame to be write to the media file storage area in default package file Before, judge pre- writing buffer whether is preset with default package file, if so, triggering first writing unit;
If it is not, triggering the creating unit, and trigger first writing unit.
Alternatively, the creating unit is additionally operable to:
The package file is prewrite into setting buffers before media file storage area.
Alternatively, the creating unit is specifically used for:Write by each video frame in default package file Before media file storage area, structure, which includes, in advance is used to write the media file storage area of video frame and for writing the pre- of index data The package file of writing buffer.
In embodiments of the present invention, a frame video frame is often encapsulated, the frame video frame is just written to default package file Media file storage area;And by the corresponding index data of frame video frame, it is slow to be written to prewriting for the default package file Rush in area, in this way, in the case of storage system power down, having encapsulated the video frame of completion can be played, and this improves deposit The playability of packaged obtained multimedia file under storage system power down scene.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is attached drawing needed in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of method for packing flow chart provided in an embodiment of the present invention;
Fig. 2 is a kind of method for packing schematic diagram provided in an embodiment of the present invention;
Fig. 3 is a kind of encapsulating structure schematic diagram of package file provided in an embodiment of the present invention;
Fig. 4 is another method for packing flow chart provided in an embodiment of the present invention;
Fig. 5 is a kind of packaging system structure diagram provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other without making creative work Embodiment, belongs to the scope of protection of the invention.
In order to solve the prior art by video data be packaged into MP4 and avi etc. need carry index data multimedia During file, storage system power down causes index data to lose, and then causes packaged obtained multimedia file not broadcast normally The problem of putting, an embodiment of the present invention provides a kind of method for packing and device, is sealed with improving storage system under power down scene Fill the playability of obtained multimedia file.
It should be noted that the executive agent of the method for packing is the equipment for needing to be packaged video data.Its In, the functional software for realizing method for packing of the embodiment of the present invention can be to be arranged at the equipment dedicated for encapsulation video data Software, or be arranged at the equipment and be used to encapsulate the feature card in the software of video data.The equipment includes But terminal device and server are not limited to, wherein, terminal device can be:Laptop, desktop computer, smart mobile phone Deng.
First, an embodiment of the present invention provides a kind of method for packing, as shown in Figure 1, the method for packing can include with Lower step:
S101:Obtain each video frame of video data to be packaged;
It is understood that when equipment needs execute encapsulation to operate, video data to be packaged is first obtained.Obtaining institute After stating video data, the video data can be encoded according to pre-arranged code form, and then pack and obtain the video counts According to corresponding each video frame.Wherein, each video frame can be according to the pre-arranged code form, to the video counts According to the partial video frame encoded in obtained all videos frame or all videos frame.
It should be noted that the pre-arranged code form refers to the video data being packaged into a frame frame video frame institute The coding mode of use.The pre-arranged code form including but not limited to H.264, the form such as VC-1 and MPEG-2, wherein, These pre-arranged code forms belong to the prior art, and it is not described here in detail.
In addition, obtaining the mode of each video frame can include:Perform method for packing provided in an embodiment of the present invention Equipment obtained based on pre-arranged code said shank;Or, directly acquire to obtain from other equipment.
S102:Each video frame is write to the media file storage area in default package file;Wherein, the envelope Included at least in dress file:For writing the media file storage area of video frame and pre- writing buffer for writing index data;
Wherein, media file storage area and pre- writing buffer are previously provided with default package file.In the present embodiment, After each video frame of the video data is obtained, each video frame is written to the media file storage area.
It is emphasized that the mode that each video frame is written to the package file memory block is:Every time will One frame video frame writes the media file storage area of the package file, in that way, and then each video frame is write The media file storage area.In addition, the write sequence of each video frame can be set according to demand, it is not limited to be obtained Obtain the order of each video frame.
It should be noted that the pre- writing buffer is used to store the corresponding index data of each video frame.Wherein, The index data of any video frame records the coded format for having the video frame, size information, resolution ratio, timestamp information, storage Position offset information and key frame information etc..
S103:After any video frame is write the media file storage area, the index data of the video frame is write The pre- writing buffer, multimedia file is obtained with encapsulation.
As soon as, should it is understood that after often writing frame video frame in the media file storage area of the package file The corresponding index data of video frame is written to the pre- writing buffer, so as to obtain the corresponding multimedia text of the package file Part so that in the storage system power down of the equipment, remain able to play out the multimedia file, improve more matchmakers The playability of body file.
In embodiments of the present invention, a frame video frame is often encapsulated, the frame video frame is just written to default package file Media file storage area;And by the corresponding index data of frame video frame, it is slow to be written to prewriting for the default package file Rush in area, in this way, in the case of storage system power down, having encapsulated the video frame of completion can be played, and this improves deposit The playability of packaged obtained multimedia file under storage system power down scene.
Alternatively, before each video frame is write the media file storage area in default package file, also wrap Include:
Fixed indices parameter in the index data of each video frame and file header are write into the pre- writing buffer, Wherein, the file header carries the encapsulation format information of the package file;
It is described after any video frame is write the media file storage area, the index data of the video frame is write into institute The step of stating pre- writing buffer, including:
After any video frame is write the media file storage area, by the video frame in addition to the fixed indices parameter Index data, write the pre- writing buffer.
It is understood that the fixed indices parameter in the index data of each video frame can be previously written To the pre- writing buffer.Wherein, the fixed indices parameter may include the information such as the coded format of video frame, resolution ratio.
Therefore, after any video frame is write the media file storage area, it is only necessary to by removing admittedly in the video frame Determine the index data (i.e. change index parameter) outside indexing parameter, such as the size information of the video frame, storage location offset letter The information such as breath, timestamp information and key frame information, write pre- writing buffer, improve the speed for encapsulating the video frame Degree.
In addition, it is necessary to file header be write in package file, with by described during encapsulation obtains multimedia file File header identifies the encapsulation format of the package file, which can be used for the file version for describing the multimedia file The information such as this and compatible protocol.Therefore the file header can be previously written to the pre- writing buffer in the lump.
Alternatively, before each video frame is write the media file storage area in default package file, also wrap Include:
Judge pre- writing buffer whether is preset with default package file, write each video frame if so, performing The step of entering the media file storage area of default package file;
If it is not, creating the pre- writing buffer, the media that each video frame is write to default package file are performed The step of file storage area.
It is understood that before writing video frame in default package file, judge in the default package file Whether pre- writing buffer is provided with;If there are pre- writing buffer, by video frame write-in media file storage area;If there is no pre- Writing buffer, then first create pre- writing buffer, then video frame is write media file storage area, to be regarded by any After frequency frame writes the media file storage area, the corresponding index data of the video frame can be written to pre- writing buffer.
Alternatively, the multimedia file prewrites setting buffers before media file storage area.
It is understood that due to needing constantly to write video frame in media file storage area, and depositing shared by video frame Store up space and be much larger than the memory space being used for shared by index data, therefore needing to carry out media file storage area for convenience Extension, can prewrite setting buffers before media file storage area by the multimedia file.
In order to facilitate understanding, method for packing provided in an embodiment of the present invention is made furtherly with reference to Fig. 2 and Fig. 3 It is bright.
Referring to Fig. 2, treat being packaged into the video data of multimedia file and encoded first, obtain the video of a frame frame Frame, and after any one frame video frame is write the media file storage area of default package file, the video frame is corresponding Index data writes the pre- writing buffer of the package file.
Wherein, Fig. 3 is the corresponding encapsulating structure of package file shown in Fig. 2.Referring to Fig. 3, wrapped in the package file Include:For writing the media file storage area of video frame, the pre- writing buffer for writing index data.Wherein, the pre- Write post Area includes writing the first area of the file header of the package file, writes the second area of the corresponding index data of video frame and be used for Identify the 3rd region of media file storage area total length.The media file storage area includes being used for the number for writing video frame According to block.
Wherein, the second area can also include fixed indices data field, change index data field and User Defined Area, the User Defined area can be used for writing custom data.
With reference to Fig. 4, the video data is encapsulated into the multimedia file institute of MP4 forms to the embodiment of the present invention A kind of packaged type used illustrates.
From the prior art, being packaged into the multimedia file of MP4 forms needs to include index data, if in power down feelings Index data is not write into MP4 files under condition, can cause the MP4 files can not normal play.
In order to solve the above-mentioned technical problem, the video data can be packaged using method for packing as shown in Figure 4, Referring to Fig. 4, method for packing may include steps of:
Step S401:Obtain the video data to be packaged into MP4 files;
Step S402:Judge pre- writing buffer whether is preset with default package file;
If no, perform step S403:Pre- writing buffer is created in the default package file;
If so, perform step S404;
Step S404:Judge the pre- writing buffer whether in advance with fixed indices parameter and file header;
If not prewriting, step S405 is performed:It is to be packaged into the corresponding fixation of MP4 files in the pre- writing buffer write-in Indexing parameter and file header;
If step S406 is performed with the fixed indices parameter and file header in advance:Obtain video data to be packaged Any video frame;
Step S407:The video frame is write into the media file storage area in the default package file;
Step S408:By pre- writing buffer described in the change index parameter read-in in the index data of the video frame;
Step S409:Change and be used for the length mark letter for identifying media file storage area total length in pre- writing buffer Breath;
Step S410:Judge that the pre- writing buffer writes the length of data and whether exceedes preset length, if exceeding, hold Row step S411:Encapsulation terminates, and obtains multimedia file;
If not exceeded, perform step S406.
It will be appreciated by persons skilled in the art that after determining to be packaged into MP4 files to video data, you can know pair The coded format that the video data is encoded is MP4 forms, and then can obtain the corresponding fixed indices of any video frame Parameter (such as coded format), so as to which coded format is previously written default pre-set buffer area.
Need what is illustrated, in order to distinguish the envelope for the multimedia file that video data is packaged into MP4 forms in the prior art Dress method, those skilled in the art can write compatible version in file header and write the method for packing of the mark embodiment of the present invention Identification information.
In addition, during step S408 is performed, change index parameter the pre- Write post is not being write into all In the case of area, the storage system power down of equipment, then the video frame of current encapsulation can not normal play, but the video frame it Before the video frame that is packaged being capable of normal play.
During step S408 is performed, change index parameter is all being write to the situation of the pre- writing buffer Under, the storage system power down of equipment, then the video frame of current encapsulation and the equal energy of the video frame being packaged before the video frame Normal play.
That is, this kind of packaged type, can farthest play the video frame encapsulated, therefore be very suitable for The equipment of these easy power down of moving camera and vehicle-mounted traveling recorder.
It is emphasized that the method for packing that the embodiment of the present invention is provided, can be used for audio frame to be packaged into Row encapsulation, can also be carried out at the same time encapsulation, it is not described here in detail to audio frame and video frame at the same time.
Corresponding to above method embodiment, the embodiment of the present invention additionally provides a kind of packaging system, and described device can wrap Include:
Obtaining unit 501, for obtaining each video frame of video data to be packaged;
First writing unit 502, the media file for each video frame to be write in default package file are deposited Storage area;Wherein, included at least in the package file:For writing the media file storage area of video frame and for writing index data Pre- writing buffer;
Second writing unit 503, after any video frame is write the media file storage area, by the rope of the video frame Argument obtains multimedia file according to the pre- writing buffer is write, with encapsulation.
In embodiments of the present invention, a frame video frame is often encapsulated, the frame video frame is just written to default package file Media file storage area;And by the corresponding index data of frame video frame, it is slow to be written to prewriting for the default package file Rush in area, in this way, in the case of storage system power down, having encapsulated the video frame of completion can be played, and this improves deposit The playability of packaged obtained multimedia file under storage system power down scene.
Alternatively, described device further includes:
3rd writing unit, for each video frame to be write to the media file storage in default package file Qu Qian, the pre- writing buffer is write by the fixed indices parameter in the index data of each video frame and file header, its In, the file header carries the encapsulation format information of the package file;
Correspondingly, the second writing unit 503 is specifically used for:
After any video frame is write the media file storage area, by the video frame in addition to the fixed indices parameter Index data, write the pre- writing buffer.
Alternatively, the second writing unit 503 is specifically used for:
After any video frame is write the media file storage area, by the change index in the index data of the video frame Pre- writing buffer described in parameter read-in;Wherein, the change index parameter at least carries the size information of the video frame, storage position Put offset information, timestamp information and key frame information.
Alternatively, described device further includes:
Creating unit, for creating pre- writing buffer;
Judging unit, for each video frame to be write to the media file storage area in default package file Before, judge pre- writing buffer whether is preset with default package file, if so, triggering first writing unit;
If it is not, triggering the creating unit, and trigger first writing unit 502.
Alternatively, the creating unit is additionally operable to:
The package file is prewrite into setting buffers before media file storage area.
Alternatively, the creating unit is specifically used for:Write by each video frame in default package file Before media file storage area, structure, which includes, in advance is used to write the media file storage area of video frame and for writing the pre- of index data The package file of writing buffer.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to Non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those Element, but also including other elements that are not explicitly listed, or further include as this process, method, article or equipment Intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that Also there are other identical element in process, method, article or equipment including the key element.
Each embodiment in this specification is described using relevant mode, identical similar portion between each embodiment Divide mutually referring to what each embodiment stressed is the difference with other embodiment.It is real especially for system For applying example, since it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method Part explanation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (12)

  1. A kind of 1. method for packing, it is characterised in that including:
    Obtain each video frame of video data to be packaged;
    Each video frame is write to the media file storage area in default package file;Wherein, in the package file Include at least:For writing the media file storage area of video frame and pre- writing buffer for writing index data;
    It is slow by being prewrite described in the index data write-in of the video frame after any video frame is write the media file storage area Area is rushed, multimedia file is obtained with encapsulation.
  2. 2. according to the method described in claim 1, it is characterized in that, each video frame is being write into default package file In media file storage area before, further include:
    Fixed indices parameter in the index data of each video frame and file header are write into the pre- writing buffer, its In, the file header carries the encapsulation format information of the package file;
    It is described after any video frame is write the media file storage area, the index data write-in of the video frame is described pre- The step of writing buffer, including:
    After any video frame is write the media file storage area, by the rope in addition to the fixed indices parameter of the video frame Argument evidence, writes the pre- writing buffer.
  3. 3. the according to the method described in claim 2, it is characterized in that, rope in addition to the fixed indices parameter by the video frame The step of argument evidence, the write-in pre- writing buffer, including:
    By pre- writing buffer described in the change index parameter read-in in the index data of the video frame;Wherein, the change index Parameter at least carries the size information of the video frame, storage location offset information, timestamp information and key frame information.
  4. 4. according to the method described in claim 1, it is characterized in that, each video frame is being write into default package file In media file storage area before, further include:
    Judge pre- writing buffer whether is preset with default package file, write each video frame in advance if so, performing If package file media file storage area the step of;
    If it is not, creating the pre- writing buffer, the media file that each video frame is write to default package file is performed The step of memory block.
  5. 5. according to the method described in claim 1, it is characterized in that, the package file prewrites setting buffers in media text Before part memory block.
  6. 6. according to the method described in claim 1, it is characterized in that, each video frame is being write into default package file In media file storage area before, further include:Structure, which includes, in advance is used to write the media file storage area of video frame and for writing The package file of the pre- writing buffer of index data.
  7. A kind of 7. packaging system, it is characterised in that including:
    Obtaining unit, for obtaining each video frame of video data to be packaged;
    First writing unit, for each video frame to be write to the media file storage area in default package file;Its In, included at least in the package file:For writing the media file storage area of video frame and for writing prewriting for index data Buffering area;
    Second writing unit, after any video frame is write the media file storage area, by the index data of the video frame The pre- writing buffer is write, multimedia file is obtained with encapsulation.
  8. 8. device according to claim 7, it is characterised in that further include:
    3rd writing unit, for each video frame to be write to the media file storage area in default package file Before, the fixed indices parameter in the index data of each video frame and file header are write into the pre- writing buffer, wherein, The file header carries the encapsulation format information of the package file;
    Correspondingly, the second writing unit is specifically used for:
    After any video frame is write the media file storage area, by the rope in addition to the fixed indices parameter of the video frame Argument evidence, writes the pre- writing buffer.
  9. 9. device according to claim 8, it is characterised in that the second writing unit is specifically used for:
    After any video frame is write the media file storage area, by the change index parameter in the index data of the video frame Write the pre- writing buffer;Wherein, it is inclined at least to carry the size information of the video frame, storage location for the change index parameter Move information, timestamp information and key frame information.
  10. 10. device according to claim 7, it is characterised in that further include:
    Creating unit, for creating pre- writing buffer;
    Judging unit, for before each video frame is write the media file storage area in default package file, sentencing Pre- writing buffer whether is preset with disconnected default package file, if so, triggering first writing unit;
    If it is not, triggering the creating unit, and trigger first writing unit.
  11. 11. device according to claim 7, it is characterised in that the creating unit is additionally operable to:
    The package file is prewrite into setting buffers before media file storage area.
  12. 12. device according to claim 7, it is characterised in that the creating unit is specifically used for:Each regarded by described Before frequency frame writes the media file storage area in default package file, structure includes the media file for being used to write video frame in advance Memory block and the package file of the pre- writing buffer for writing index data.
CN201610967488.4A 2016-10-31 2016-10-31 A kind of method for packing and device Pending CN108024138A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610967488.4A CN108024138A (en) 2016-10-31 2016-10-31 A kind of method for packing and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610967488.4A CN108024138A (en) 2016-10-31 2016-10-31 A kind of method for packing and device

Publications (1)

Publication Number Publication Date
CN108024138A true CN108024138A (en) 2018-05-11

Family

ID=62083489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610967488.4A Pending CN108024138A (en) 2016-10-31 2016-10-31 A kind of method for packing and device

Country Status (1)

Country Link
CN (1) CN108024138A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506447A (en) * 2021-02-01 2021-03-16 成都焱之阳科技有限公司 Data lock-free caching method and server for video monitoring equipment
CN115269511A (en) * 2022-07-25 2022-11-01 北京航星永志科技有限公司 Generic electronic file packaging method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101447207A (en) * 2008-12-30 2009-06-03 深圳华为通信技术有限公司 Media recording method and device thereof
CN101656099A (en) * 2008-08-18 2010-02-24 安凯(广州)软件技术有限公司 Audio and video production and play method used for MP3 player
CN101998160A (en) * 2010-11-17 2011-03-30 中兴通讯股份有限公司 Method and device for recovering network television-recorded program
CN102646433A (en) * 2012-04-17 2012-08-22 北京华夏电通科技股份有限公司 Method, device and system for generating stream media real-time record file of digital court
CN103796047A (en) * 2014-01-23 2014-05-14 福建星网锐捷安防科技有限公司 Method and device for encapsulating video/audio data
CN105898551A (en) * 2015-12-18 2016-08-24 乐视云计算有限公司 Network video playing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656099A (en) * 2008-08-18 2010-02-24 安凯(广州)软件技术有限公司 Audio and video production and play method used for MP3 player
CN101447207A (en) * 2008-12-30 2009-06-03 深圳华为通信技术有限公司 Media recording method and device thereof
CN101998160A (en) * 2010-11-17 2011-03-30 中兴通讯股份有限公司 Method and device for recovering network television-recorded program
CN102646433A (en) * 2012-04-17 2012-08-22 北京华夏电通科技股份有限公司 Method, device and system for generating stream media real-time record file of digital court
CN103796047A (en) * 2014-01-23 2014-05-14 福建星网锐捷安防科技有限公司 Method and device for encapsulating video/audio data
CN105898551A (en) * 2015-12-18 2016-08-24 乐视云计算有限公司 Network video playing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506447A (en) * 2021-02-01 2021-03-16 成都焱之阳科技有限公司 Data lock-free caching method and server for video monitoring equipment
CN115269511A (en) * 2022-07-25 2022-11-01 北京航星永志科技有限公司 Generic electronic file packaging method and device

Similar Documents

Publication Publication Date Title
JP4481889B2 (en) Data recording apparatus and method, program, and recording medium
CN108093299B (en) Method for repairing damaged MP4 file and storage medium
CN101849249B (en) Method and device for acquiring, recording and utilizing data captured in an aircraft
CN108881770B (en) Method and device for recording multimedia file
CN102291580B (en) Video transmission method based on Android system
CN111063376B (en) Method, terminal equipment and storage medium for audio and video synchronization in MP4 repairing
CN109982154A (en) Method, equipment and the storage medium of image for reproduction space region
CN102118539B (en) Multimedia playing terminal as well as playing method and device for dragging multimedia files
CN104602105B (en) The player method and user equipment of video file
EP2523460A1 (en) Image processing device, information recording medium, image processing medium, and program
CN108024138A (en) A kind of method for packing and device
CN110784741A (en) Time-shifting response method and device of media data
CN101763722B (en) Method and device for releasing dynamic traffic information
CN105049904A (en) Play method and play device of multi-media files
CN103796047B (en) Method and device for encapsulating video/audio data
CN102629235A (en) Method for increasing read-write speed of double data rate (DDR) memory
CN112509097B (en) Method and device for editing hand-painted animation materials
CN108255491A (en) A kind of unified modeling method of servo-driver data
CN106791536A (en) The recording player method and terminal of multimedia file
CN111741247A (en) Video playback method and device and computer equipment
CN113660442B (en) Video restoration method and device, electronic equipment and readable medium
CN112929686B (en) Method and device for playing back recorded video in real time on line
CN102509313A (en) Encapsulating method of multimedia image data
CN102646433B (en) Method, device and system for generating stream media real-time record file of digital court
CN103065660A (en) Video file locating method of embedded video recorder

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180511