CN106055643B - continuous writing method for MXF file writing interruption - Google Patents
continuous writing method for MXF file writing interruption Download PDFInfo
- Publication number
- CN106055643B CN106055643B CN201610376221.8A CN201610376221A CN106055643B CN 106055643 B CN106055643 B CN 106055643B CN 201610376221 A CN201610376221 A CN 201610376221A CN 106055643 B CN106055643 B CN 106055643B
- Authority
- CN
- China
- Prior art keywords
- mxf file
- file
- format
- audio
- mxf
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/60—Information retrieval; Database structures therefor; File system structures therefor of audio data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Television Signal Processing For Recording (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a continuous writing method for MXF file writing interruption, which comprises the following steps: judging whether the MXF file is complete or not; if the MXF file is not complete, judging whether the header metadata of the MXF file is complete, and if the header metadata is not complete, rewriting the header metadata; acquiring the frame number of the written audio and video data; writing new audio and video data; writing a file tail packet; judging whether to write in a complete index table segment and a random index packet according to the format of the MXF file; the write-resuming method further comprises the following steps: rewriting the item of the header metadata that requires rewriting of the time length parameter. The incomplete MXF files are processed by the method of continuous writing, so that the processing time is greatly shortened and the workload is reduced compared with the rewriting operation of the incomplete MXF files.
Description
Technical Field
The invention relates to the technical field of MXF file continuous writing, in particular to a continuous writing method for MXF file writing interruption.
Background
the MXF can process and pack audio and video of a plurality of tracks and database files at the same time, so that a complete MXF material content is more, and the file is larger. In the generation process of the MXF file, if the power failure or other conditions are met and the writing of the file is interrupted, the MXF file is rewritten from the beginning in the prior art, so that the defects in the following aspects are caused:
(1) When the MXF file is rewritten, firstly, the Header Metadata (Header Metadata) is rewritten, the Header Metadata contains the structure of the Metadata group describing the overall content of the main body and the single program segment, and the correct writing can be performed only by having a professional MXF file knowledge background, so that the writing can be completed by investing a great deal of energy;
(2) If the MXF file to be generated is very large, most of the file may be written in some cases when the writing is interrupted, and if the writing is started from the head, time and labor are wasted; moreover, the file is interrupted when being written to the tail part, only a small part of audio and video data needs to be written, then FPP (file tail package) and RIP (random index package) are written according to MXF standard, and a complete material for media exchange can be formed, and if the file is rewritten, the same complete file is rewritten, which is completely unnecessary;
(3) if the MXF file is rewritten, because the description information required for the difference between the encoding formats of different files is different, if a person who does not know the information required for decoding writes the description information of the audio/video data, the description parameters that have to be written may not be clear, and an error may be caused during rewriting.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a continuous writing method for interruption of MXF file writing.
The purpose of the invention is realized by the following technical scheme: the method for continuing writing interruption of MXF file writing comprises the following steps: judging whether the MXF file is complete or not; if the MXF file is not complete, judging whether the header metadata of the MXF file is complete, and if the header metadata is not complete, rewriting the header metadata; acquiring the frame number of the written audio and video data; writing new audio and video data; and writing the tail packet of the file.
The method for continuously writing further comprises the following steps of judging the format of the MXF file: if the MXF file is in the first format, judging whether the tail part of the MXF file needs to be written into a complete index table segment and a random index packet or not; and if the MXF file is in the second format, judging whether the tail part of the MXF file needs to be written into a complete index table segment.
the write-resuming method further comprises the following steps: rewriting the item of the header metadata that requires rewriting of the time length parameter.
The method for judging whether the MXF file is complete comprises the following steps: if the MXF file is in the first format, reading the data at the tail of the MXF file for analysis, and judging whether the MXF file has a random index packet or not, if the MXF file has the random index packet, considering the MXF file to be complete, otherwise, considering the MXF file to be incomplete; and if the MXF file is in the second format, analyzing the offset of a tail packet in the head metadata and the time length of a video and audio data frame in the metadata, if the time lengths of the tail packet and the video and audio data frame are both 0, determining that the MXF file is incomplete, otherwise, determining that the MXF file is complete.
And if the header metadata is finished, recording the offset of the item needing to rewrite the time length parameter in the header metadata in the file.
the items in the header metadata that need to be rewritten with the duration parameter include video and audio sequences and actual source material.
The method for acquiring the frame number of the written audio and video data comprises the following steps: judging the format of the MXF file: if the MXF file is in the first format, searching the last file body packet containing the complete index table segment in the MXF file, and analyzing the file body packet to obtain the frame number of the written audio and video data; and if the MXF file is in the second format, acquiring the frame number of the written audio and video data by dividing the length of the written audio and video data in the file body package of the MXF file by the length of each frame of audio and video data.
the method for writing in new audio and video data comprises the following steps: judging the format of the MXF file: if the MXF file is in the first format, continuing to write the audio and video data, filling a new index table segment, and recording the index information of the audio and video data; and if the MXF file is in the second format, continuously writing the audio and video data and recording the frame number of the written audio and video data.
The first format is an Op1a format or an Op1b format, and the second format is an Op atom format.
the invention has the beneficial effects that:
(1) Reducing the workload of incomplete MXF file writing: when the incomplete MXF file is continuously written, the head metadata does not need to be rewritten, and the written part of audio-video data does not need to be rewritten again, so that the workload can be greatly reduced;
(2) shortening the writing time of incomplete MXF files: the written audio and video data does not need to be written again, so that a large amount of time is saved, and especially when the first writing block of the file is close to the tail part, the interruption is caused, and compared with rewriting the file, the advantages of continuously writing the file are more obvious;
(3) Improving the operability of writing incomplete MXF files: because the rewriting of the head metadata is reduced, for the MXF file of which the tail part needs to be written with the video description information and the audio description information, only the head metadata information in the MXF file head needs to be parsed, and the MXF file is copied and written.
drawings
fig. 1 is a flowchart of a method for resuming writing of an MXF file in an interruption state according to the present invention.
Detailed Description
The technical solutions of the present invention are further described in detail below with reference to the accompanying drawings, but the scope of the present invention is not limited to the following.
as shown in fig. 1, the method for resuming the writing interruption of the MXF file analyzes the type of the incomplete MXF file by analyzing the physical structure and the logical structure of the MXF file, and then resumes the writing of the different types of files according to the structure thereof, so that the time for completing the file supplementation can be greatly saved, and the method is simple and feasible to operate and has wide applicability. The continuous writing method comprises the following steps:
Step one, judging whether the MXF file is complete.
the method for judging whether the MXF file is complete comprises the following steps: if the MXF file is in an Op1a format or an Op1b format, reading the data at the tail of the MXF file for analysis, judging whether the MXF file has a random index packet, if so, considering the MXF file to be complete, otherwise, considering the MXF file to be incomplete; if the MXF file is in an Op atom format, analyzing the offset of a tail packet in the head metadata and the time length of a video and audio data frame in the metadata, if the time lengths of the tail packet and the video and audio data frame are both 0, determining that the MXF file is incomplete, otherwise, determining that the MXF file is complete.
step two, if the MXF file is incomplete, judging whether the header metadata of the MXF file is completed, and if the header metadata is not completed, rewriting the header metadata; and if the header metadata is finished, recording the offset of the item needing to rewrite the time length parameter in the header metadata in the file. By recording the offset of the item of the time length parameter needing to be rewritten in the file, the subsequent rewriting time length is facilitated, the file position needing to be rewritten is directly positioned according to the recorded offset, the head metadata does not need to be analyzed again, and the time is saved.
And if the MXF file is complete, the MXF file does not need to be continuously written.
the items of the header metadata, for which the time length parameter needs to be rewritten, include video and audio data and actual source material.
And step three, acquiring the frame number of the written audio and video data. The method for acquiring the frame number of the written audio and video data comprises the following steps: judging the format of the MXF file: if the MXF files are in an Op1a format or an Op1b format, searching the last file body packet containing the complete index table segment in the MXF files, and acquiring the frame number of the written audio and video data by analyzing the file body packet; and if the MXF file is in an Op atom format, acquiring the number of frames of the written audio and video data by dividing the length of the written audio and video data in the file body package of the MXF file by the length of each frame of audio and video data.
And step four, writing new audio and video data. The method for writing in new audio and video data comprises the following steps: judging the format of the MXF file: if the MXF file is in an Op1a format or an Op1b format, continuing to write the audio and video data, filling a new index table segment, and recording the index information of the audio and video data; and if the MXF file is in the Op atom format, continuously writing the audio and video data and recording the frame number of the written audio and video data.
and step five, writing the tail packet of the file.
the method for continuously writing further comprises the following steps of judging the format of the MXF file: if the MXF file is in Op1a format or Op1b format, judging whether a complete index table segment and a random index packet need to be written, and writing the index table segment and the random index packet for the MXF file in which the complete index table segment and the random index packet need to be written; and if the MXF file is in an Op atom format, judging whether the tail part of the MXF file is written into a complete index table segment, and if the tail part of the MXF file is not written into the complete index table segment, writing the index table segment.
The write-resuming method further comprises the following steps: and rewriting items needing to rewrite the time length parameters in the head metadata, positioning the video and audio sequence and the offset of the actual source material in the file obtained by the analysis in the foregoing, and rewriting the time length items in the video and audio sequence and the actual source material.
the invention can simply and quickly realize the processing of incomplete MXF files, and the processed MXF files can be correctly played and transmitted. The incomplete MXF files are processed by the continuous writing method, so that the processing time is greatly shortened and the workload is reduced compared with the rewriting operation of the incomplete MXF files.
The foregoing is illustrative of the preferred embodiments of this invention, and it is to be understood that the invention is not limited to the precise form disclosed herein and that various other combinations, modifications, and environments may be resorted to, falling within the scope of the concept as disclosed herein, either as described above or as apparent to those skilled in the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (4)
- A continuous writing method for MXF file writing interruption is characterized in that: the method comprises the following steps:Judging whether the MXF file is complete or not;if the MXF file is not complete, judging whether the header metadata of the MXF file is complete, and if the header metadata is not complete, rewriting the header metadata;if the header metadata is finished, recording the offset of an item needing to rewrite the time length parameter in the header metadata in the file;acquiring the frame number of the written audio and video data;Writing new audio and video data;Writing a file tail packet;the method for acquiring the frame number of the written audio and video data comprises the following steps:judging the format of the MXF file:if the MXF file is in the first format, searching the last file body packet containing the complete index table segment in the MXF file, and analyzing the file body packet to obtain the frame number of the written audio and video data;If the MXF file is in the second format, acquiring the frame number of the written audio and video data by dividing the length of the written audio and video data in the file body package of the MXF file by the length of each frame of audio and video data;The method for writing in new audio and video data comprises the following steps:Judging the format of the MXF file:if the MXF file is in the first format, continuing to write the audio and video data, filling a new index table segment, and recording the index information of the audio and video data;if the MXF file is in the second format, continuing to write the audio and video data and recording the frame number of the written audio and video data;Rewriting items in the header metadata, wherein the items need to be rewritten with the duration parameters;The items in the header metadata that need to be rewritten with the duration parameter include video and audio sequences and actual source material.
- 2. The method of resuming writing of an MXF file write interruption of claim 1, wherein: the method for continuously writing further comprises the following steps of judging the format of the MXF file:If the MXF file is in the first format, judging whether the tail part of the MXF file needs to be written into a complete index table segment and a random index packet or not;and if the MXF file is in the second format, judging whether the tail part of the MXF file needs to be written into a complete index table segment.
- 3. the method of resuming writing of an MXF file write interruption of claim 1, wherein: the method for judging whether the MXF file is complete comprises the following steps:If the MXF file is in the first format, reading the data at the tail of the MXF file for analysis, and judging whether the MXF file has a random index packet or not, if the MXF file has the random index packet, considering the MXF file to be complete, otherwise, considering the MXF file to be incomplete;And if the MXF file is in the second format, analyzing the offset of a tail packet in the head metadata and the time length of a video and audio data frame in the metadata, if the time lengths of the tail packet and the video and audio data frame are both 0, determining that the MXF file is incomplete, otherwise, determining that the MXF file is complete.
- 4. A method of renewing an MXF file write interruption of any of claims 1-3, wherein: the first format is an Op1a format or an Op1b format, and the second format is an Op atom format.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610376221.8A CN106055643B (en) | 2016-05-31 | 2016-05-31 | continuous writing method for MXF file writing interruption |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610376221.8A CN106055643B (en) | 2016-05-31 | 2016-05-31 | continuous writing method for MXF file writing interruption |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106055643A CN106055643A (en) | 2016-10-26 |
CN106055643B true CN106055643B (en) | 2019-12-13 |
Family
ID=57171762
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610376221.8A Active CN106055643B (en) | 2016-05-31 | 2016-05-31 | continuous writing method for MXF file writing interruption |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106055643B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107506309B (en) * | 2017-06-30 | 2020-05-19 | 深圳市硅格半导体有限公司 | Terminal, flash memory data writing method and computer readable storage medium |
CN109495752A (en) * | 2018-11-07 | 2019-03-19 | 成都索贝数码科技股份有限公司 | A method of MXF file is combined into based on object storage fragment transcoding/synthesis sudden strain of a muscle |
CN110996172B (en) * | 2019-12-17 | 2022-01-11 | 杭州当虹科技股份有限公司 | Method for quickly synthesizing 4K MXF file |
CN114374875B (en) * | 2021-12-31 | 2024-05-28 | 浙江大华技术股份有限公司 | MP4 file recording method, device and readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2002021845A1 (en) * | 2000-09-06 | 2002-03-14 | Sony United Kingdom Limited | Combining video material and data |
CN101169795A (en) * | 2006-10-24 | 2008-04-30 | 索尼英国有限公司 | Information processing apparatus, information processing method, program and program recording medium |
CN102801754A (en) * | 2011-05-24 | 2012-11-28 | 英业达集团(天津)电子技术有限公司 | Method and system for breakpoint transmission |
CN103701907A (en) * | 2013-12-27 | 2014-04-02 | 乐视网信息技术(北京)股份有限公司 | Processing method and system for continuing to transmit data in server |
-
2016
- 2016-05-31 CN CN201610376221.8A patent/CN106055643B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2002021845A1 (en) * | 2000-09-06 | 2002-03-14 | Sony United Kingdom Limited | Combining video material and data |
CN101169795A (en) * | 2006-10-24 | 2008-04-30 | 索尼英国有限公司 | Information processing apparatus, information processing method, program and program recording medium |
CN102801754A (en) * | 2011-05-24 | 2012-11-28 | 英业达集团(天津)电子技术有限公司 | Method and system for breakpoint transmission |
CN103701907A (en) * | 2013-12-27 | 2014-04-02 | 乐视网信息技术(北京)股份有限公司 | Processing method and system for continuing to transmit data in server |
Non-Patent Citations (1)
Title |
---|
MXF格式浅析;黄钰,李建国,黄元;《视听界(广播电视技术)》;20081031(第05期);第5-10页 * |
Also Published As
Publication number | Publication date |
---|---|
CN106055643A (en) | 2016-10-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106055643B (en) | continuous writing method for MXF file writing interruption | |
CN1643605B (en) | Data recording method, data recording device, data recording medium, data reproduction method, and data reproduction device | |
CN111770360B (en) | Method and system for marking whole flow of video manuscript collection, editing and auditing | |
RU2010111391A (en) | SEGMENTED METADATA AND INDICES FOR STREAM MULTIMEDIA DATA | |
EP2270799A3 (en) | Recording medium, playback apparatus, program, playback method, system integrated circuit | |
CN106021565B (en) | continuous writing method of MXF files in Op1a and Op1b formats | |
CN111930975A (en) | Ship navigation data playback and analysis system and method | |
DK1728252T3 (en) | Recording medium as well as method and apparatus for reproducing a subtitle stream recorded on the recording medium | |
CN109511008B (en) | Method for supporting video and audio file content addition based on object storage | |
JP2013528823A5 (en) | ||
CN106020733B (en) | Continuous writing method of MXF file in Op atom format | |
JP2013528823A (en) | Audio data storage method and apparatus | |
US20230308712A1 (en) | Systems and methods for processing overlapping content | |
US20230053698A1 (en) | Method and system for managing life cycle iteration of test case, and medium | |
JP2007306257A5 (en) | ||
CN103210389B (en) | A kind for the treatment of method and apparatus of metadata | |
CN109271399A (en) | A kind of method of calibration of database write-in log consistency | |
WO2022156169A1 (en) | Method and device for exporting animated video | |
CN109660576B (en) | User data real-time migration method, storage medium, electronic device and system | |
RU2012141874A (en) | INFORMATION PROCESSING DEVICE, INFORMATION RECORDING MEDIA, INFORMATION PROCESSING METHOD AND PROGRAM | |
CN114205628B (en) | MP4 file coding method, device and system | |
TW200615923A (en) | Information storage medium, recording/reproducing apparatus, recording/reproducing method, and host using the same | |
EP1516253A2 (en) | Method for handling data, data storage system, file system and computer program product | |
JP5148676B2 (en) | Video data processing apparatus and video data processing method | |
CN116933143B (en) | Flight parameter data classification method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |