CN112040239A - File repair method and device based on AVI format file structure - Google Patents
File repair method and device based on AVI format file structure Download PDFInfo
- Publication number
- CN112040239A CN112040239A CN202010960632.8A CN202010960632A CN112040239A CN 112040239 A CN112040239 A CN 112040239A CN 202010960632 A CN202010960632 A CN 202010960632A CN 112040239 A CN112040239 A CN 112040239A
- Authority
- CN
- China
- Prior art keywords
- file
- avi
- repair
- source code
- damaged
- 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.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/85406—Content authoring involving a specific file format, e.g. MP4 format
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Television Signal Processing For Recording (AREA)
Abstract
The invention discloses a file repair method and a device based on an AVI format file structure, wherein the method comprises the following steps: determining the coding type of the damaged file; according to the coding type of the damaged file, making a source code AVI file with the same coding type; modifying the AVI file code of the source code to generate a source code repair file; merging the source code repair file and the damaged video file to obtain a new AVI repair file; opening an AVI repair file by using a player, and determining the information of the original input size, resolution, bit rate and frame rate; and transcoding the AVI repair file, filling size, resolution, bit rate and frame rate information, outputting a new AVI file, and completing AVI file repair. The damaged AVI format file can be repaired based on the 16-system code format of the underlying file of the AVI format file, and the damaged AVI format file can be effectively repaired and guided according to different sizes and different damage modes of the files, so that important video information in the file can be recovered.
Description
Technical Field
The invention relates to a file repair method and device based on an AVI format file structure.
Background
An AVI format Video file is a Video format file with a wide application range at present, and the file format is called Audio Video Interleaved in english, that is, an Audio Video Interleaved format, and is a file format combining voice and image synchronously. At present, the format file is mainly applied to the fields of video shooting, movie and television editing, judicial evidence obtaining and the like, and is mainly stored in a computer storage medium as application modes of graphic electronic evidence, movie and television media master tape materials, daily life souvenirs and the like.
However, in daily life and work, a storage medium is damaged, a file is damaged irreversibly by virus damage, malicious virus often fixes and clears or encrypts 16-system codes in a fixed range of a head, and important sector codes in the head of an AVI format file cannot be read completely due to the problem of bad sectors and bad blocks of the storage medium when the storage medium is damaged, so that the AVI format file cannot be opened completely, important video information in the file cannot be identified and used, and a common AVI format repair tool in the market is completely ineffective against the problem.
Disclosure of Invention
In view of the above-mentioned defects in the prior art, the technical problem to be solved by the present invention is to provide a method and an apparatus for repairing a file based on an AVI format file structure, which can effectively repair and guide a damaged AVI format file according to different file sizes and different destruction modes, so as to recover important video information in the file.
In order to achieve the above object, the present invention provides a file repair method based on an AVI format file structure, including the following steps:
determining the coding type of the damaged file;
according to the coding type of the damaged file, making a source code AVI file with the same coding type;
modifying the AVI file code of the source code to generate a source code repair file;
merging the source code repair file and the damaged video file to obtain a new AVI repair file;
opening an AVI repair file by using a player, and determining the information of the original input size, resolution, bit rate and frame rate;
and transcoding the AVI repair file, filling size, resolution, bit rate and frame rate information, outputting a new AVI file, and completing AVI file repair.
Optionally, the determining the code of the damaged file includes: and (4) opening the damaged file by using WINHEX software, and searching a preset coding type through a text search function to determine the coding type of the damaged file.
Optionally, the preset type of search includes any one of WMV, MPG, XIVD, DVIX, and AVC.
Optionally, the making of the source code AVI file of the same coding type according to the coding type of the damaged file includes: and manufacturing a source code file with the same code length of 5 seconds according to the coding type of the damaged file, then jumping to the tail end of the source code file, upwards searching for the initial offset address of the last index table, selecting the first byte of the source code file as the start of a block, and generating a new file as a source code repair file.
Optionally, the merging the source code repair file and the damaged video file includes: and adding a first file and a second file by using the source code repair file and the damaged video file, and combining the first file and the second file by using WINHEX.
Optionally, before performing the combination of the additional one and the additional two by WINHEX, the following steps are further included: the total byte number of the source code repair file and the damaged video file is subtracted by 8 through WINHEX, and the files are converted into 16-system reverse order to fill in the addresses from 0X04 to 0X 07.
Optionally, the opening the AVI repair file by the player, and determining the original input size, resolution, bit rate, and frame rate information includes: and opening the combined AVI repair file by using POTPLAYER software, opening a file attribute menu to observe the size change of the video, and determining the original size, resolution, bit rate and frame rate information of the video.
Optionally, transcoding the AVI repair file, filling size, resolution, and frame rate information, and outputting a new AVI file, including: and carrying out AVI-to-AVI transcoding operation on the AVI repair file through the FormatFactory, configuring the AVI repair file into the observed original size, resolution, bit rate and frame rate information, and outputting a new AVI file.
Optionally, the completing the repair of the AVI file includes: and importing the new AVI file into PR, AE, VEGAS or other video editing software, clipping frames of the video sample file, and completing AVI file repair.
In order to achieve the above object, the present invention further provides a file repair apparatus based on an AVI format file structure, including:
the coding type determining module is used for determining the coding type of the damaged file;
the source code file manufacturing module is used for manufacturing source code AVI files with the same coding type;
the source code repair file manufacturing module is used for modifying the source code AVI file and generating a new source code repair file;
the merging module is used for merging the source code repair file and the damaged video file to obtain a new AVI repair file;
and the transcoding module is used for transcoding the AVI repair file to complete AVI file repair.
Due to the adoption of the technical scheme, the invention has the following advantages: the file repair method based on the AVI format file structure established by the method can repair damaged AVI format files based on the 16-system code format of the underlying files of the AVI format files, and can effectively repair and guide the damaged AVI format files according to different sizes and different damage modes of the files so as to recover important video information in the files.
Drawings
FIG. 1 is a flowchart of a file repair method based on AVI format file structure according to a first embodiment of the present invention;
FIG. 2a and FIG. 2b are schematic diagrams illustrating a file repair method step 2 based on AVI format file structure according to a first embodiment of the present invention;
FIG. 3 is a diagram illustrating a file repair method step 3 based on AVI format file structure according to a first embodiment of the present invention;
FIG. 4 is a diagram illustrating a file repair method step 4 based on AVI format file structure according to a first embodiment of the present invention;
FIGS. 5 and 6 are schematic diagrams illustrating a step 5 of a file repair method based on AVI format file structure according to a first embodiment of the present invention;
fig. 7 is a schematic diagram of step 6 of the file repair method based on the AVI format file structure according to the first embodiment of the present invention.
Detailed Description
The invention is further illustrated by the following examples in conjunction with the accompanying drawings:
the first embodiment is as follows:
as shown in fig. 1, a file repair method based on an AVI format file structure includes the following steps:
step 1: determining the coding type of the damaged file;
step 2: according to the coding type of the damaged file, making a source code AVI file with the same coding type;
and step 3: modifying the AVI file code of the source code to generate a source code repair file;
and 4, step 4: merging the source code repair file and the damaged video file to obtain a new AVI repair file;
and 5: opening an AVI repair file by using a player, and determining the information of the original input size, resolution, bit rate and frame rate;
step 6: and transcoding the AVI repair file, filling size, resolution, bit rate and frame rate information, outputting a new AVI file, and completing AVI file repair.
Specifically, in step 1, the determining the code of the damaged file includes: the damaged file is opened by using WINHEX software, and the encoding type of the damaged file is determined by searching characters such as 'WMV', 'MPG', 'XIVD', 'DVIX', 'AVC' and the like through a text searching function. As other preferred embodiments of the present invention, the characters searched are not limited to "WMV", "MPG", "XIVD", "DVIX", "AVC" listed in the present invention, but may be characters searched for other video file formats.
Because the AVI format file damage may be caused by viruses, part of the viruses can clear the fixed range of the file header, and the codes in the clear-up paradigm need to be randomly written once by using WINHEX software.
Further, in step 2 and step 3, the making of the source code AVI file of the same encoding type according to the encoding type of the damaged file includes: and (3) making a source code file with the same code length of 5 seconds according to the coding type of the damaged file, then jumping to the end of the source code file, upwards searching for the starting offset address of the last index table, selecting the offset address 0X00 as the start of a block, namely selecting the first byte of the source code file as the start of the block, specifically referring to fig. 2a, selecting the previous byte of the last index table of the source code file with the same code as the end of the block, specifically referring to fig. 2b, and generating a new file as a source code repair file.
As shown in fig. 3, before the additional first and additional second mergers are performed by WINHEX, the following steps are further included:
the total byte number of the source code repair file and the damaged video file is subtracted by 8 through WINHEX, and the files are converted into 16-system reverse order to fill in the addresses from 0X04 to 0X 07.
As shown in fig. 4, the merging the source code repair file and the damaged video file includes: and taking the source code repair file as an additional first file and the damaged video file as an additional second file, and combining the additional first file and the additional second file through WINHEX to obtain the new AVI repair file.
With reference to fig. 5 and fig. 6, the opening the AVI repair file by the player and determining the original input size, resolution, bit rate, and frame rate information specifically includes: and opening the combined new AVI repair file by using POTPLAYER software, opening a file attribute menu to observe the size change of the video, and determining the information such as the original size, the resolution, the bit rate, the frame rate and the like of the video.
Transcoding the AVI repair file, filling size, resolution and frame rate information, and outputting a new AVI file, which comprises: and carrying out AVI-to-AVI transcoding operation on the AVI repair file through the FormatFactory, configuring the AVI repair file into the observed original size, resolution, bit rate and frame rate information, and outputting a new AVI file. When the difference between the playing frame rate and the source frame rate is not large, the original frame rate can be directly used.
As shown in fig. 7, the completing the repair of the AVI file includes: and importing the new AVI file into PR, AE, VEGAS or other video editing software, clipping frames of the video sample file, and completing AVI file repair.
In summary, the file repair method based on the AVI format file structure established by the method of the present invention can repair damaged AVI format files based on the 16-system code format of the underlying file of the AVI format file, and according to different file sizes and different damage modes, can effectively repair and guide damaged AVI format files, so as to recover important video information in the files.
Example two:
a second embodiment of the present invention provides a file repair apparatus based on an AVI format file structure, including:
the coding type determining module is used for determining the coding type of the damaged file; the coding type determining module uses WINHEX software to open the damaged file, and the characters of WMV, MPG, XIVD, DVIX, AVC and the like are searched by a text searching function to determine the coding type of the damaged file.
The source code file manufacturing module is used for manufacturing source code AVI files with the same coding type; and the source code file manufacturing module manufactures a source code file with the same code length of 5 seconds according to the coding type of the damaged file, then jumps to the tail of the source code file, upwards searches for the initial offset address of the last index table, selects the offset address 0 as the start of a block, and generates a new file as a source code repair file.
The source code repair file manufacturing module is used for modifying the source code AVI file and generating a new source code repair file; and manufacturing a source code file with the same code length of 5 seconds according to the coding type of the damaged file, then jumping to the tail end of the source code file, upwards searching for the initial offset address of the last index table, selecting the offset address 0 as the start of a block, and generating a new file as a source code repair file.
The merging module is used for merging the source code repair file and the damaged video file to obtain a new AVI repair file; and the merging module takes the source code repair file as an additional first and the damaged video file as an additional second, and performs the combination of the additional first and the additional second through WINHEX to obtain the new AVI repair file.
And the transcoding module is used for transcoding the AVI repair file to complete AVI file repair. Transcoding the AVI repair file, filling size, resolution and frame rate information, and outputting a new AVI file; and importing the new AVI file into PR, AE, VEGAS or other video editing software, clipping frames of the video sample file, and completing AVI file repair.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.
Claims (10)
1. A file repair method based on an AVI format file structure is characterized by comprising the following steps:
determining the coding type of the damaged file;
according to the coding type of the damaged file, making a source code AVI file with the same coding type;
modifying the AVI file code of the source code to generate a source code repair file;
merging the source code repair file and the damaged video file to obtain a new AVI repair file;
opening an AVI repair file by using a player, and determining the information of the original input size, resolution, bit rate and frame rate;
and transcoding the AVI repair file, filling size, resolution, bit rate and frame rate information, outputting a new AVI file, and completing AVI file repair.
2. The AVI format file structure-based file repair method of claim 1, wherein the determining the encoding of the corrupted file comprises: and (4) opening the damaged file by using WINHEX software, and searching a preset coding type through a text search function to determine the coding type of the damaged file.
3. The file repair method according to claim 2, wherein the search preset type includes any one of WMV, MPG, XIVD, DVIX, AVC.
4. The method of claim 1, wherein the preparing a source code AVI file of the same encoding type according to the encoding type of the damaged file comprises: and manufacturing a source code file with the same code length of 5 seconds according to the coding type of the damaged file, selecting the first byte of the source code file as the start of a block, then jumping to the tail of the source code file, upwards searching for the initial offset address of the last index table, and generating a new file as a source code repair file.
5. The AVI format file structure-based file repair method of claim 1, wherein the merging the source code repair file and the corrupted video file comprises: and adding a first file and a second file by using the source code repair file and the damaged video file, and combining the first file and the second file by using WINHEX.
6. A file repair method based on AVI format file structure as claimed in claim 5, further comprising the following steps before performing the additional one and additional two mergers by WINHEX: the total byte number of the source code repair file and the damaged video file is subtracted by 8 through WINHEX, and the files are converted into 16-system reverse order to fill in the addresses from 0X04 to 0X 07.
7. The AVI format file structure-based file repair method of claim 1, wherein the opening an AVI repair file using a player, the determining original input size, resolution, bit rate, frame rate information comprising: and opening the combined AVI repair file by using POTPLAYER software, opening a file attribute menu to observe the size change of the video, and determining the original size, resolution, bit rate and frame rate information of the video.
8. The method of claim 7, wherein transcoding the AVI repair file to fill in size, resolution, and frame rate information and output a new AVI file comprises: and carrying out AVI-to-AVI transcoding operation on the AVI repair file through the FormatFactory, configuring the AVI repair file into the observed original size, resolution, bit rate and frame rate information, and outputting a new AVI file.
9. The AVI format file structure-based file repair method of claim 7, wherein the completing the AVI file repair includes: and importing the new AVI file into PR, AE, VEGAS or other video editing software, clipping frames of the video sample file, and completing AVI file repair.
10. A file repair device based on AVI format file structure is characterized in that: comprises that
The coding type determining module is used for determining the coding type of the damaged file;
the source code file manufacturing module is used for manufacturing source code AVI files with the same coding type;
the source code repair file manufacturing module is used for modifying the source code AVI file and generating a new source code repair file;
the merging module is used for merging the source code repair file and the damaged video file to obtain a new AVI repair file;
and the transcoding module is used for transcoding the AVI repair file to complete AVI file repair.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010960632.8A CN112040239B (en) | 2020-09-14 | 2020-09-14 | File repair method and device based on AVI format file structure |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010960632.8A CN112040239B (en) | 2020-09-14 | 2020-09-14 | File repair method and device based on AVI format file structure |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112040239A true CN112040239A (en) | 2020-12-04 |
CN112040239B CN112040239B (en) | 2022-07-26 |
Family
ID=73589820
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010960632.8A Active CN112040239B (en) | 2020-09-14 | 2020-09-14 | File repair method and device based on AVI format file structure |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112040239B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115334350A (en) * | 2022-07-25 | 2022-11-11 | 广东跃昉科技有限公司 | Method and device for repairing file, terminal equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110097058A1 (en) * | 2009-10-23 | 2011-04-28 | Vivotek Inc. | Method of processing audio-video data |
CN102724551A (en) * | 2012-06-13 | 2012-10-10 | 天脉聚源(北京)传媒科技有限公司 | Video encoding system and video encoding method |
US20130254611A1 (en) * | 2012-03-23 | 2013-09-26 | Qualcomm Incorporated | Recovering data in multimedia file segments |
CN105631335A (en) * | 2015-12-25 | 2016-06-01 | 北京奇虎科技有限公司 | Dynamic decompression method, device and apparatus |
CN107896343A (en) * | 2017-11-29 | 2018-04-10 | 天津聚飞创新科技有限公司 | The restorative procedure and device of MP4 files |
CN110740391A (en) * | 2019-10-31 | 2020-01-31 | 四川效率源信息安全技术股份有限公司 | method for repairing MP4 damaged files |
CN111028135A (en) * | 2019-12-10 | 2020-04-17 | 国网重庆市电力公司电力科学研究院 | Image file restoration method |
CN111294647A (en) * | 2018-12-10 | 2020-06-16 | 中国移动通信集团有限公司 | Video processing method, device and equipment and storage medium |
-
2020
- 2020-09-14 CN CN202010960632.8A patent/CN112040239B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110097058A1 (en) * | 2009-10-23 | 2011-04-28 | Vivotek Inc. | Method of processing audio-video data |
US20130254611A1 (en) * | 2012-03-23 | 2013-09-26 | Qualcomm Incorporated | Recovering data in multimedia file segments |
CN102724551A (en) * | 2012-06-13 | 2012-10-10 | 天脉聚源(北京)传媒科技有限公司 | Video encoding system and video encoding method |
CN105631335A (en) * | 2015-12-25 | 2016-06-01 | 北京奇虎科技有限公司 | Dynamic decompression method, device and apparatus |
CN107896343A (en) * | 2017-11-29 | 2018-04-10 | 天津聚飞创新科技有限公司 | The restorative procedure and device of MP4 files |
CN111294647A (en) * | 2018-12-10 | 2020-06-16 | 中国移动通信集团有限公司 | Video processing method, device and equipment and storage medium |
CN110740391A (en) * | 2019-10-31 | 2020-01-31 | 四川效率源信息安全技术股份有限公司 | method for repairing MP4 damaged files |
CN111028135A (en) * | 2019-12-10 | 2020-04-17 | 国网重庆市电力公司电力科学研究院 | Image file restoration method |
Non-Patent Citations (1)
Title |
---|
强振平: "深度学习图像修复方法综述", 《中国图象图形学报》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115334350A (en) * | 2022-07-25 | 2022-11-11 | 广东跃昉科技有限公司 | Method and device for repairing file, terminal equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112040239B (en) | 2022-07-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20110289099A1 (en) | Method and apparatus for identifying video program material via dvs or sap data | |
US8161021B2 (en) | Recording apparatus, reproduction apparatus, and file management method | |
US9792390B2 (en) | Metadata/content re-association system and method | |
JP2007012112A (en) | Data recording device and method thereof, program, and recording medium | |
BRPI0415045A (en) | Information storage media for multimedia data storage, information storage media, text subtitle processing apparatus, text subtitle processing method, and computer readable recording media | |
CN112040239B (en) | File repair method and device based on AVI format file structure | |
JP2006074391A (en) | File recording method and recorder | |
CN105447016A (en) | Assembly fast search and reuse method | |
CN114125469B (en) | MP4 file repairing method, device, electronic equipment and storage medium | |
US20240244299A1 (en) | Content providing method and apparatus, and content playback method | |
CN111028135B (en) | Image file repairing method | |
JP2007519068A (en) | Computer-based calculation method and computer system for generating a semantic description using conversion technology | |
US10158888B2 (en) | Method and apparatus for reproducing video data | |
JP5409214B2 (en) | Media file repair method, media file creation method, media file playback method and apparatus | |
CN110858492A (en) | Audio editing method, device, equipment and system and data processing method | |
JP4360428B2 (en) | Recording apparatus, recording method, computer program, and recording medium | |
JP4280701B2 (en) | Data file editing method and apparatus, control program, and storage medium | |
EP1477987A1 (en) | Method for storing additional data relating to menu data | |
CN112131193B (en) | Application program compression method and device | |
CN110955381B (en) | Device and method for compressing file outgoing package | |
Chernyshev | Library for Remote Copying of Video File Fragments | |
JP2006129078A (en) | Data file editing method and apparatus thereof, control program, and storage medium | |
JP4225124B2 (en) | Data processing method and system | |
JP4329872B2 (en) | Data processing method, data processing system, and editing apparatus | |
CN113590636A (en) | Online transaction system and method based on block chain |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |