CN110839135B - Recovery method and system for DV or HDV video file - Google Patents

Recovery method and system for DV or HDV video file Download PDF

Info

Publication number
CN110839135B
CN110839135B CN201911229808.6A CN201911229808A CN110839135B CN 110839135 B CN110839135 B CN 110839135B CN 201911229808 A CN201911229808 A CN 201911229808A CN 110839135 B CN110839135 B CN 110839135B
Authority
CN
China
Prior art keywords
cluster
sequence
file
distance
clusters
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
Application number
CN201911229808.6A
Other languages
Chinese (zh)
Other versions
CN110839135A (en
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.)
Xiamen Meiya Pico Information Co Ltd
Original Assignee
Xiamen Meiya Pico Information 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 Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN201911229808.6A priority Critical patent/CN110839135B/en
Publication of CN110839135A publication Critical patent/CN110839135A/en
Application granted granted Critical
Publication of CN110839135B publication Critical patent/CN110839135B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • H04N5/93Regeneration of the television signal or of selected parts thereof

Abstract

The invention provides a recovery method and a recovery system for DV or HDV video files, which comprises the steps of obtaining the cluster size CL allocated and used by the system, and scanning the information of all clusters contained in the DV or HDV video files to be recovered in a physical storage medium; calculating the BeginInstance distance of each cluster in a single file and the corresponding file cluster serial number to obtain a comparison table of the file cluster serial number and the BeginInstance distance; responding to the information of all the clusters in the physical storage medium, acquiring a BeginInstance distance in each cluster, and analyzing the time point and the frame number of the first complete DIF sequence; and sequencing clusters of the DV or HDV video file to be recovered based on the time point, the frame sequence number and the file cluster sequence number, and recombining the clusters into the video file in sequence. The method can restore the video data 100% under the condition that the data is not covered completely, and ensures the completeness of the video.

Description

Recovery method and system for DV or HDV video file
Technical Field
The invention relates to the field of computer data recovery, in particular to a recovery method and a recovery system for DV or HDV video files.
Background
The full English name of DV is Digital Video Format, which is a home Digital Video Format proposed by a plurality of manufacturers such as Sony, Panasonic, JVC and the like. Digital video cameras that are very popular today record video data using this format. The video data can be transmitted to the computer through an IEEE 1394 port of the computer, and the video data edited in the computer can also be recorded back into the digital video camera.
DV/HDV is the most common audio-video coding format for digital video cameras. With the development and popularization of digital video cameras, people have an increasing demand in video. The DV/HDV coding format video is the most important coding mode of the digital video camera. Video files of a digital camera are often lost due to unexpected conditions in daily use, such as equipment failure, file system damage, artificial deletion or formatting and the like.
At present, few software can support the recovery of videos with DV/HDV coding formats at home and abroad. When the video fragments are scattered and discontinuously and irregularly distributed on the physical storage medium, it is difficult to recombine the video fragments into a complete video, and the situations of incapability of playing, disordered frame sequence and the like can occur after the video fragments are simply combined.
Disclosure of Invention
In order to solve the technical problem that videos in DV/HDV coding formats are difficult to recombine in the prior art, the invention provides a recovery method and a recovery system for DV or HDV video files, which are used for solving the problems that when video fragments are scattered, discontinuously and irregularly distributed on a physical storage medium, the video fragments are difficult to recombine into complete videos, the video fragments can not be played after being simply combined, the frame sequence is disordered and the like.
In one aspect, the present invention provides a recovery method for DV or HDV video files, comprising the steps of:
s1: acquiring the cluster size CL allocated and used by a system, and scanning information of all clusters contained in DV or HDV video files to be recovered in a physical storage medium;
s2: calculating the BeginInstance distance of each cluster and the file cluster serial number corresponding to the BeginInstance distance to obtain a comparison table of the file cluster serial number and the BeginInstance distance, wherein the BeginInstance distance represents the distance between the starting position of the first complete DIF sequence in the cluster and the starting position of the cluster in which the first complete DIF sequence is located, and the file cluster serial number represents the position of a certain cluster in a file;
s3: responding to the information of all the clusters in the physical storage medium, acquiring a BeginInstance distance in each cluster, and analyzing the time point and the frame number of the first complete DIF sequence; and
s4: and sequencing clusters of the DV or HDV video file to be recovered based on the time point, the frame sequence number and the file cluster sequence number, and recombining the clusters into the video file in sequence.
Preferably, the cluster size CL allocated for use by the system is set to one of 16K, 32K, 64K, and 128K bytes. Subsequent distance calculations may be facilitated by the definition of cluster size.
Preferably, the length of the DIF sequence is 12000 bytes. And the subsequent calculation and the cluster splicing verification can be completed by utilizing the length of the DIF sequence.
Further preferably, the calculation formula of the BeginInstance distance of each cluster and the corresponding file cluster number in step S2 is as follows:
when i is greater than 1, BeginInstance ═ 12000- ((i-1) × CL)% 12000+ Hlen% CL)% 12000;
when i is 1, BeginInstance is Hlen% CL;
where i denotes a file cluster number, i is 1,2, …, n, Hlen denotes a video file header length, and CL denotes a cluster size allocated for use by the system. Through the formula, the BeginInstance distance of the cluster and the corresponding file cluster serial number can be calculated, and a comparison table is provided for subsequent sequencing.
Preferably, the sorting of step S4 is performed based on a sorting rule. The clusters can be arranged in sequence by utilizing the sequencing rule to sequence, so that the integrity of the recombined video is ensured.
Further preferably, the sorting rule is specifically:
performing ascending arrangement on the clusters based on the time point of the first complete DIF sequence in the clusters;
if the clusters with the same time point are arranged in an ascending order based on the frame number;
and if the time point is the same as the frame sequence number, performing ascending sequence arrangement on the clusters based on the file cluster sequence number.
Preferably, step S3 further includes obtaining the enddistance of the last complete DIF sequence end position relative to the cluster end position where the complete DIF sequence end position is located. The EndInstance distance can be used to verify the correctness of video stitching.
Preferably, in the video file after being reorganized in step S4, the sum of the englnstance distance in the previous cluster and the beginstance distance in the adjacent next cluster is equal to the length of the DIF sequence. By this step it can be verified whether the splice between the clusters is correct.
Preferably, the first complete DIF sequence includes a board section, a Subcode section, a VAUX section, an Audio section, and a Video section. The DIF sequence is formed to facilitate scanning to obtain information such as corresponding time points.
Further preferably, the time point and the frame number are stored in a Subcode section. The time point and the frame number can be obtained through the scanning of the Subcode section, and the sorting reference is convenient.
According to a second aspect of the present invention, a computer-readable storage medium is proposed, on which a computer program is stored, which computer program, when being executed by a computer processor, is adapted to carry out the above-mentioned method.
According to a third aspect of the present invention, there is provided a recovery system for DV or HDV video files, comprising:
the scanning unit is configured to acquire the cluster size CL allocated and used by the system and scan information of all clusters contained in DV or HDV video files to be recovered in a physical storage medium;
the calculation unit is configured to calculate a BeginInstance distance of each cluster in a single file and a file cluster serial number corresponding to the BeginInstance distance to obtain a comparison table of the file cluster serial number and the BeginInstance distance, wherein the BeginInstance distance represents the distance between the starting position of a first complete DIF sequence in the cluster and the starting position of the cluster where the first complete DIF sequence is located;
the analysis unit is configured to respond to the information of all the clusters scanned in the physical storage medium, acquire a BeginInstance distance in each cluster, and analyze a time point and a frame number of a first complete DIF sequence; and
a recombination unit: the configuration is used for sequencing clusters of DV or HDV video files to be recovered based on time points, frame sequence numbers and cluster sequence numbers, and recombining the clusters into the video files in sequence.
Preferably, the parsing unit is further configured to obtain an enddistance of the end position of the last complete DIF sequence from the end position of the cluster where the end position of the last complete DIF sequence is located. The analysis unit further obtains the EndInstance distance which can be used for verification during cluster splicing.
Further preferably, the sequential reorganization of the clusters into the video file in the reorganization unit satisfies the following condition: the sum of the EndInstance distance in the previous cluster and the BeginInstance distance in the next adjacent cluster is equal to the length of the DIF sequence. The above conditions defined in the recombination unit can ensure the correctness of cluster splicing.
The invention provides a recovery method and a recovery system for DV or HDV video files, wherein the method can accurately distinguish the video files of each fragment from the disordered fragments in a physical storage medium, can correctly identify the sequence of the fragments, can accurately recombine the fragments into complete video, and improves the recovery effect of the files. The method can restore the video data 100% under the condition that the data is not covered completely, and ensures the completeness of the video. The method expands the fragment recombination mode of DV/HDV coding format and the recovery mode of the camera memory card, is a supplement to the video fragment recombination algorithm, and has great innovation and practical significance.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and together with the description serve to explain the principles of the invention. Other embodiments and many of the intended advantages of embodiments will be readily appreciated as they become better understood by reference to the following detailed description. Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
fig. 2 is a flow chart of a recovery method for DV or HDV video files according to an embodiment of the present application;
fig. 3 is a DV encoding format composition diagram of a specific embodiment of the present application;
FIG. 4 is a flow chart of a scanning cluster of a specific embodiment of the present application;
FIG. 5 is a flow chart of a timing comparison of a particular embodiment of the present application;
fig. 6 is a framework diagram of a recovery system for DV or HDV video files according to an embodiment of the present application;
FIG. 7 is a block diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 for a DV or HDV video file recovery method to which embodiments of the present application may be applied.
As shown in FIG. 1, system architecture 100 may include a data server 101, a network 102, and a host server 103. Network 102 serves as a medium for providing a communication link between data server 101 and host server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The main server 103 may be a server that provides various services, such as a data processing server that processes information uploaded by the data server 101. The data processing server may perform a recovery process of DV or HDV video files.
It should be noted that the recovery method for DV or HDV video files provided in the embodiment of the present application is generally executed by the main server 103, and accordingly, the apparatus for the recovery method for DV or HDV video files is generally disposed in the main server 103.
The data server and the main server may be hardware or software. When the hardware is used, the hardware can be implemented as a distributed server cluster consisting of a plurality of servers, or can be implemented as a single server. When software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module.
It should be understood that the number of data servers, networks, and host servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 shows a flowchart of a restoration method for DV or HDV video files according to an embodiment of the present application. As shown in fig. 2, the method comprises the steps of:
s201: and acquiring the cluster size CL allocated and used by the system, and scanning information of all clusters contained in the DV or HDV video file to be recovered in the physical storage medium. Usually the physical storage space in the system is applied in the smallest unit of cluster.
In a specific embodiment, DV/HDV is a video encoding format, mainly used in digital cameras. A frame of DV/HDV video is composed of a plurality of Digital Interface (DIF) sequences. Each DIF sequence is fixed with 12000 bytes. It can be classified into a Header section, a Subcode section, a VAUX section, an Audio section, and a Video section. A specific DV encoding format is shown in fig. 3. The Header section contains some Header information including DIF sequence numbers. The Subcode section is used to store some auxiliary information for playing, including the time of video shooting and the frame number of the video. The Subcode section is divided into 12 packets, of which the fourth packet is used to indicate the Time and frame order of the DIF sequence, and this packet is called Time Code Pack (hereinafter referred to as TC packet). The TC packet has 8 bytes. The first three bytes are header information of the TC packet, and the last 5 bytes (hereinafter referred to as PC0, PC1 … PC4) are the time and frame number of the TC packet. PC0 is a fixed value: 0x 13; PC1 contains a frame number; PC2 includes seconds; PC3 contains cents; PC 4.
In a specific embodiment, the cluster size CL allocated for use by the system is set to one of 16K, 32K, 64K, and 128K bytes, which is typically an n-th power of 2. After many experiments, it is preferable that the cluster size of the physical storage medium of the camera is usually 32K or 64K, but it should be appreciated that besides the above values, other cluster values allocated to be used by the computer system, such as 256K, 512K, etc., can be taken, and the technical effect of the present invention can also be obtained by selecting an appropriate CL value according to the specific video file, such as MP4, MXF, FLV, AVI, etc., and the application scene.
S202: and calculating the BeginInstance distance of each cluster and the file cluster serial number corresponding to the BeginInstance distance to obtain a comparison table of the file cluster serial number and the BeginInstance distance, wherein the BeginInstance distance represents the distance between the starting position of the first complete DIF sequence in the cluster and the starting position of the cluster where the first complete DIF sequence is located. The length of the complete DIF sequence is 12000 bytes.
In a specific embodiment, in order to reduce repeated reading and writing of the memory card during shooting, the header length of a video file shot by the same camera is usually fixed, for example, the header information of mxf, assuming that this length is Hlen; assume that the cluster size of the physical storage medium is 32K (32768). The BeginInstance calculation formula for the ith cluster is as follows:
case of i > 1: (12000- ((i-1) × 32768)% 12000+ Hlen% 32768)% 12000
Case where i is 1: hlen% 32768, i represents a file cluster number, 12000 represents the length of a DIF sequence, and 32768 represents the cluster size of the physical storage medium, which can be selected to be 64K, 128K and other cluster sizes according to actual needs.
And continuously calculating a plurality of clusters, and preparing a table after the calculation of the corresponding BeginInstances is completed. The reference table is used for sorting and splicing the clusters in the subsequent step, the file cluster serial number of the cluster where the cluster is located can be obtained through scanning the obtained BeginInstance, the clusters can be directly sorted, and the recovery success rate of the DV/HDV video file is improved.
In a preferred embodiment, the file cluster serial number of a specific cluster can be obtained by immediately searching the reference table after the BeginInstance is scanned, and the efficiency can be improved by simultaneously scanning and searching the table to obtain the file cluster serial number, so that the time is saved, and the efficiency of video recovery is improved.
S203: and responding to the information of all the clusters in the physical storage medium, acquiring a BeginInstance distance in each cluster, and analyzing the time point and the frame number of the first complete DIF sequence. The first complete DIF sequence is represented as a sequence in which 12000bytes of the first DIF sequence all exist in full.
In a specific embodiment, the Subcode section may obtain a time point of each DIF sequence, a frame sequence number, and a number of a current DIF sequence (four upper bits of ID1 of the Header section of the DIF sequence). The distance between the start position of the first complete DIF sequence (12000 bytes exist completely) in each cluster and the start position of the cluster where the start position is located is recorded as BeginInstance. And resolves the time point and frame number of the first complete DIF sequence.
In a specific embodiment, the englnstance distance between the end position of the last complete DIF sequence in each cluster and the end position of the cluster where the complete DIF sequence is located can be obtained through scanning, because one camera can only shoot one video at the same time point, and cannot shoot two videos, when scanning a DV/HDV video file to be restored in a physical storage medium of the camera, the cluster can be sorted based on the physical cluster number, the time point and the frame number in the physical storage medium, and the sorted cluster can be used as a data base for recombining the DV/HDV video file.
S204: and sequencing clusters of the DV or HDV video file to be recovered based on the time point, the frame sequence number and the file cluster sequence number, and recombining the clusters into the video file in sequence. Through the sorting, the DV/HDV video files can be scattered and disorderly and clusters are recombined into a complete video, and the video recovery effect is improved.
In a specific embodiment, the whole storage space is scanned by taking a cluster as a unit to obtain a time point and a frame number of a first complete DIF sequence in each cluster, a distance between a start position and a cluster start position where the start position is located, and a distance between a last complete DIF sequence end position and a cluster end position where the last complete DIF sequence end position is located, all clusters of the physical storage medium are sorted, and all clusters are sorted by using a sorting rule, wherein the specific sorting rule is as follows:
1. sequencing the time points of the first complete DIF sequence in the cluster, wherein the earlier time point is arranged in front;
2. the clusters with the same time point are sorted according to the frame number, and the frame number is arranged in front;
3. the clusters with the same time point and the same frame number are directly sorted according to the physical cluster number, and the cluster number is arranged in front of the cluster number in a small row.
In a specific embodiment, after the sorting is completed, clusters with the same time and the same frame number still exist, and then the clusters with the same time point and the same frame number are searched. And sorting the clusters with the same time and the same frame sequence number according to the file cluster sequence number, so that all file fragments are orderly arranged. The complete video can be recombined by only combining in sequence.
The method can accurately distinguish the video files to which the fragments belong from the disordered fragments in the physical storage medium, can correctly identify the sequence of the fragments, accurately recombines the fragments into the complete video, and improves the recovery effect of the files. The method can restore the video data 100% under the condition that the data is not covered completely, and ensures the completeness of the video. The method expands the fragment recombination mode of DV/HDV coding format and the recovery mode of the camera memory card, is a supplement to the video fragment recombination algorithm, and has great innovation and practical significance.
With continuing reference to FIG. 4, FIG. 4 illustrates a flowchart of scanning clusters according to a specific embodiment of the present application, as shown in FIG. 4, the scanning clusters including the steps of:
s401: the cluster size is obtained. The cluster size CL allocated for use by the system is obtained, and is set to one of 16K, 32K, 64K, and 128K bytes, which is typically an n-th power of 2.
S402: and generating a file cluster sequence number table. And generating a file cluster sequence number table after completing the BeginInstance calculation corresponding to the file cluster sequence numbers of the plurality of clusters.
S403: and judging whether the current cluster is the last cluster. If the current is the last cluster, the cluster scanning is finished; if not, continuing to the step S404;
s404: and judging whether the DIF sequence can be searched. If the DIF sequence can be searched, the step proceeds to step S405, and if the DIF sequence cannot be searched, the step proceeds to step S409;
s405: the start position of the first DIF sequence in the cluster is obtained. The distance between the start position of the first complete DIF sequence (12000 bytes exist completely) in each cluster and the start position of the cluster where the start position is located is recorded as BeginInstance.
S406: and acquiring the remaining length of the end position of the last DIF sequence. And scanning the distance between the end position of the last complete DIF sequence in each cluster and the end position of the cluster where the complete DIF sequence is located, and marking the distance as EndInstance.
S407: and acquiring the first DIF sequence number, time and frame number. The number, time point and frame number of the first complete DIF sequence are parsed.
S408: and reversely checking the table to obtain the serial number of the file cluster. And finding out the serial number of the cluster in the file, namely the serial number of the file cluster, in a BeginInstance reverse table look-up mode of a certain cluster.
S409: and judging whether video playing information is contained. If the video playing information is not contained, step S411 is performed to discard the cluster; if the video playback information is included, step S410 is performed: setting time, frame number and frame number as maximum values. And then returns to the loop step S403 to determine whether it is the last cluster.
In a specific embodiment, fig. 5 shows a flowchart of a timing comparison according to a specific embodiment of the present application, and as shown in fig. 5, the timing comparison specifically includes the following steps:
s501: cluster a is compared to cluster B. Namely, the sequencing of the cluster A and the cluster B is judged, if the cluster A is larger than the cluster B, the cluster A is placed behind the cluster B, and the video recombination sequencing is finished by analogy.
S502: and judging whether the cluster A time is greater than the cluster B time. Judging the ordering of the cluster A and the cluster B based on the time points of the cluster A and the cluster B obtained by scanning, and if the time of the cluster A is longer than that of the cluster B, returning the information that the cluster A is longer than that of the cluster B, namely step S508; if the cluster A time is not longer than the cluster B time, the step S503 is entered for continuous judgment;
s503: it is determined whether the cluster a time is equal to the cluster B time. If the cluster A time is not equal to the cluster B time, indicating that the cluster A time is less than the cluster B time, and returning information that the cluster A is less than the cluster B; if the cluster A time is equal to the cluster B time, continuing to enter the step S504 for judgment;
s504: it is determined whether the cluster a frame number is greater than the cluster B frame number. Judging the sequencing of the cluster A and the cluster B based on the frame sequence numbers of the cluster A and the cluster B obtained by scanning, and if the frame sequence number of the cluster A is greater than that of the cluster B, returning the information that the cluster A is greater than that of the cluster B, namely step S508; if the cluster A frame number is not greater than the cluster B frame number, the step S505 is entered for continuous judgment;
s505: it is determined whether the cluster a frame number is equal to the cluster B frame number. Judging whether the serial number of the frame A of the cluster is equal to the serial number of the frame B of the cluster; if the cluster A frame number is not equal to the cluster B frame number, the cluster A frame number is smaller than the cluster B frame number, and the information that the cluster A is smaller than the cluster B is returned; if the cluster A frame number is equal to the cluster B frame number, the step S506 is continued to judge;
s506: and judging whether the cluster A file cluster serial number is greater than the cluster B file cluster serial number. Judging the ordering of the cluster A and the cluster B based on the file cluster serial numbers of the cluster A and the cluster B obtained by reverse table look-up, and if the cluster A file cluster serial number is greater than the cluster B file cluster serial number, returning the information that the cluster A is greater than the cluster B, namely step S508; if the cluster A file cluster serial number is not greater than the cluster B file cluster serial number, returning the information that the cluster A is smaller than the cluster B, namely step S507.
Based on the steps, the sorting among different clusters can be accurately judged, so that the position relation of the clusters is determined, the whole physical storage medium is traversed, and all the clusters can be orderly recombined into a complete and correct video file.
Fig. 6 shows a recovery system for DV or HDV video files according to another embodiment of the present invention. The system specifically comprises a scanning unit 601, a calculating unit 602, an analyzing unit 603 and a recombining unit 604.
In a specific embodiment, the scanning unit 601 is configured to obtain a cluster size CL allocated by the system, and scan information of all clusters contained in a DV or HDV video file to be recovered in a physical storage medium; a calculating unit 602, configured to calculate a BeginInstance distance of each cluster and a cluster number corresponding to the BeginInstance distance, to obtain a comparison table of cluster numbers and BeginInstance distances, where the BeginInstance distance represents a distance between a start position of a first complete DIF sequence in a cluster and a start position of the cluster where the start position is located; an analyzing unit 603 configured to obtain a begin instance distance in each cluster in response to information of all clusters scanned in the physical storage medium, and analyze a time point and a frame number of a first complete DIF sequence; the recombination unit 604: the configuration is used for sequencing clusters of DV or HDV video files to be recovered based on time points, frame sequence numbers and cluster sequence numbers, and recombining the clusters into the video files in sequence.
In a preferred embodiment, the parsing unit 603 is further configured to obtain an enddistance of the last complete DIF sequence end position from the cluster end position where the complete DIF sequence end position is located. The sequential reorganization of the clusters into video files in the reorganization unit 604 satisfies the following conditions: the sum of the EndInstance distance in the previous cluster and the BeginInstance distance in the next adjacent cluster is equal to the length of the DIF sequence.

Claims (12)

1. A recovery method for DV or HDV video files, characterized in that it comprises the following steps:
s1: acquiring the cluster size CL allocated and used by a system, and scanning information of all clusters contained in DV or HDV video files to be recovered in a physical storage medium;
s2: calculating a BeginInstance distance of each cluster and a file cluster serial number corresponding to the BeginInstance distance to obtain a comparison table of the file cluster serial number and the BeginInstance distance, wherein the BeginInstance distance represents the distance between the starting position of a first complete DIF sequence in the cluster and the starting position of the cluster in which the first complete DIF sequence is located, and the file cluster serial number represents the position of a certain cluster in a file;
s3: responding to the information of all the clusters in the physical storage medium, acquiring the BeginInstance distance in each cluster, and analyzing the time point and the frame number of the first complete DIF sequence; and
s4: sorting the clusters of the DV or HDV video file to be restored based on a sorting rule based on the time point, the frame sequence number and the file cluster sequence number, and recombining the clusters into video files in sequence, wherein the sorting specifically comprises: performing ascending arrangement on the clusters based on the time point of the first complete DIF sequence in the clusters; if the clusters with the same time point are arranged in an ascending order based on the frame sequence number; and if the time point is the same as the frame sequence number, performing ascending sequence arrangement on the clusters based on the file cluster sequence number.
2. The recovery method for DV or HDV video file according to claim 1, wherein said cluster size CL allocated for use by said system is set to one of 16K, 32K, 64K and 128K bytes.
3. A recovery method for DV or HDV video files according to claim 1, characterized in that said DIF sequence is 12000bytes in length.
4. A recovery method for DV or HDV video file according to any one of claims 1 to 3, wherein said BeginInstance distance of each cluster and its corresponding file cluster number in step S2 are calculated by the following formula:
when i is greater than 1, BeginInstance ═ 12000- ((i-1) × CL)% 12000+ Hlen% CL)% 12000;
when i is 1, BeginInstance is Hlen% CL;
where i denotes a file cluster number, Hlen denotes a video file header length, and CL denotes a cluster size allocated for use by the system.
5. The recovery method for DV or HDV video file according to claim 1, wherein said step S3 further comprises obtaining the enddistance of the last complete DIF sequence end position relative to the cluster end position where it is located.
6. The recovery method for DV or HDV video file according to claim 5, wherein in said video file after being recomposed in step S4, the sum of said englnstance distance in the previous cluster and said beginstance distance in the adjacent next cluster is equal to said DIF sequence length.
7. The recovery method for DV or HDV Video files according to claim 1, wherein the first complete DIF sequence comprises a Heard section, a Subcode section, a VAUX section, an Audio section and a Video section.
8. The recovery method for DV or HDV video files according to claim 7, wherein the time point and the frame number are stored in the Subcode section.
9. A computer-readable storage medium having one or more computer programs stored thereon, which when executed by a computer processor perform the method of any one of claims 1 to 8.
10. A recovery system for DV or HDV video files, said system comprising:
the scanning unit is configured to acquire the cluster size CL allocated and used by the system and scan information of all clusters contained in DV or HDV video files to be recovered in a physical storage medium;
the calculation unit is configured to calculate a BeginInstance distance of each cluster in a single file and a file cluster serial number corresponding to the BeginInstance distance, and acquire a comparison table of the file cluster serial number and the BeginInstance distance, wherein the BeginInstance distance represents a distance between a starting position of a first complete DIF sequence in a cluster and a starting position of the cluster where the first complete DIF sequence is located;
the analyzing unit is configured to respond to the information of all the clusters scanned in the physical storage medium, acquire the BeginInstance distance in each cluster, and analyze the time point and the frame number of the first complete DIF sequence; and
a recombination unit: the cluster processing method is configured to sort the cluster of the DV or HDV video file to be restored based on the time point, the frame sequence number and the cluster sequence number, and recombine the cluster into the video file in sequence, wherein the sorting specifically comprises the following steps: performing ascending arrangement on the clusters based on the time point of the first complete DIF sequence in the clusters; if the clusters with the same time point are arranged in an ascending order based on the frame sequence number; and if the time point is the same as the frame sequence number, performing ascending sequence arrangement on the clusters based on the file cluster sequence number.
11. A recovery system for DV or HDV video files according to claim 10, wherein said parsing unit is further configured to obtain the enddistance of the last complete DIF sequence end position relative to the cluster end position where it is located.
12. A recovery system for DV or HDV video files according to claim 11, wherein said reorganizing unit reorganizes said clusters into video files in sequence satisfies the following condition: the sum of the EndInstance distance in the previous cluster and the BeginInstance distance in the adjacent next cluster is equal to the DIF sequence length.
CN201911229808.6A 2019-12-04 2019-12-04 Recovery method and system for DV or HDV video file Active CN110839135B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911229808.6A CN110839135B (en) 2019-12-04 2019-12-04 Recovery method and system for DV or HDV video file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911229808.6A CN110839135B (en) 2019-12-04 2019-12-04 Recovery method and system for DV or HDV video file

Publications (2)

Publication Number Publication Date
CN110839135A CN110839135A (en) 2020-02-25
CN110839135B true CN110839135B (en) 2022-05-27

Family

ID=69578071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911229808.6A Active CN110839135B (en) 2019-12-04 2019-12-04 Recovery method and system for DV or HDV video file

Country Status (1)

Country Link
CN (1) CN110839135B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181738B (en) * 2020-08-24 2022-06-03 苏州浪潮智能科技有限公司 Device cluster serial number identification device and electronic equipment
CN116489458B (en) * 2023-06-26 2023-09-01 深圳麦风科技有限公司 MP4 repairing method, device, terminal and medium based on file byte analysis

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1198447A (en) * 1997-09-25 1999-04-09 Sony Corp Image pickup device, edit device and edit system
JP2000215623A (en) * 1999-01-27 2000-08-04 Matsushita Electric Ind Co Ltd Information recording/reproducing apparatus
JP2002320196A (en) * 2001-04-19 2002-10-31 Sony Corp Digital image recorder and digital image reproducing device
CN1516963A (en) * 2002-04-10 2004-07-28 ������������ʽ���� Data recording device and method, program storage medium and program
CN101690188A (en) * 2007-07-04 2010-03-31 松下电器产业株式会社 Video recording and reproducing apparatus and its method
CN102254048A (en) * 2011-08-24 2011-11-23 深圳市万兴软件有限公司 Data recovering method and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6681052B2 (en) * 2000-01-15 2004-01-20 Sony Corporation Methods and systems for performing inverse quantization and inverse weighting of DV video
JP4345190B2 (en) * 2000-03-30 2009-10-14 ソニー株式会社 Magnetic tape recording apparatus and method
JP3719602B2 (en) * 2002-06-07 2005-11-24 ソニー株式会社 Video tape recorder and recording method
US20060092982A1 (en) * 2004-10-29 2006-05-04 Mediatek Incorporation Methods for media file recording, and recovery after power failure, and related devices

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1198447A (en) * 1997-09-25 1999-04-09 Sony Corp Image pickup device, edit device and edit system
JP2000215623A (en) * 1999-01-27 2000-08-04 Matsushita Electric Ind Co Ltd Information recording/reproducing apparatus
JP2002320196A (en) * 2001-04-19 2002-10-31 Sony Corp Digital image recorder and digital image reproducing device
CN1516963A (en) * 2002-04-10 2004-07-28 ������������ʽ���� Data recording device and method, program storage medium and program
CN101690188A (en) * 2007-07-04 2010-03-31 松下电器产业株式会社 Video recording and reproducing apparatus and its method
CN102254048A (en) * 2011-08-24 2011-11-23 深圳市万兴软件有限公司 Data recovering method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"A forward error recovery technique for real-time MPEG-2 video transport and its performance over wireless IEEE 802.11 LAN";R. Pillai et al.;《Proceedings Ninth International Conference on Computer Communications and Networks》;20020806;全文 *
"NTFS文件系统中的视频数据恢复方法";黄步根 等;《计算机工程》;20100120;全文 *

Also Published As

Publication number Publication date
CN110839135A (en) 2020-02-25

Similar Documents

Publication Publication Date Title
CN110839135B (en) Recovery method and system for DV or HDV video file
CN107534796A (en) Detect the fragment of video frequency program
CN1459198A (en) System and method of processing MPEG stream for file index insertion
CN108769171A (en) The copy of distributed storage keeps verification method, device, equipment and storage medium
CN110502664A (en) Video tab indexes base establishing method, video tab generation method and device
CN110677718B (en) Video identification method and device
CN105933792A (en) Video playing method and mobile terminal
CN110475124A (en) Video cardton detection method and device
CN116339647A (en) Computer data management system based on artificial intelligence
CN101895736A (en) Media stream data processing method and device thereof
CN110781037B (en) Method and system for recovering video file in storage medium and readable storage medium
CN108683879A (en) A kind of feature tag identification based on intelligent video camera head and quickly check system
CN109446827B (en) Data encryption and decryption method and system
CN102737083A (en) Instant competition information editing method and system
CN113569719B (en) Video infringement judging method and device, storage medium and electronic equipment
CN103957070A (en) Method and device for positioning data frame
CN111797060B (en) Offline video recording method, device and equipment and computer readable storage medium
CN109996010B (en) Video processing method and device, intelligent device and storage medium
CN112492248B (en) Video verification method and device
CN112449209B (en) Video storage method and device, cloud server and computer readable storage medium
CN107360457A (en) Multimedia data processing method and relevant device
CN113852857A (en) Sound playing method and system based on HTML5 video frame stepping
US20100027878A1 (en) Content detection of an image comprising pixels
WO2003105489A1 (en) Method and device for online dynamic semantic video compression and video indexing
CN108182459B (en) Digital display caliper data acquisition method based on continuous code scanning

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