CN110839135A - 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
CN110839135A
CN110839135A CN201911229808.6A CN201911229808A CN110839135A CN 110839135 A CN110839135 A CN 110839135A CN 201911229808 A CN201911229808 A CN 201911229808A CN 110839135 A CN110839135 A CN 110839135A
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.)
Granted
Application number
CN201911229808.6A
Other languages
Chinese (zh)
Other versions
CN110839135B (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 at home and abroad can support the recovery of videos in DV/HDV coding formats. 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 and the frame serial number are the same, performing ascending sequence arrangement on the clusters based on the file cluster serial 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 VAUXsection, 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 Subcodection, 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 file cluster serial numbers and BeginInstance distances, wherein the BeginInstance distances represent distances between starting positions of first complete DIF sequences in the clusters and the starting positions of the clusters where the first complete DIF sequences are 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 block 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, to name a few.
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. Can be divided 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, where the fourth packet is used to indicate the Time and frame sequence 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 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. Through a plurality of experiments by the inventor of the present application, it is preferable that the cluster size of the physical storage medium of the video 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 system of the computer, 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 of i ═ 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, the cluster A time is smaller than the cluster B time, and information that the cluster A is smaller than the cluster B is returned; 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 ordering of the cluster A and the cluster B based on the frame numbers of the cluster A and the cluster B obtained by scanning, if the frame number of the cluster A is greater than the frame number of the cluster B, returning the information that the cluster A is greater than 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.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by a Central Processing Unit (CPU)701, performs the above-described functions defined in the method of the present application. It should be noted that the computer readable storage medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware.
As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: 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; 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; 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 above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (14)

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: and sequencing the 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.
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 sorting of step S4 is based on a sorting rule.
6. The recovery method for DV or HDV video file according to claim 5, wherein said ordering 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 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.
7. 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.
8. The recovery method for DV or HDV video file according to claim 7, wherein in said video file reformed in said 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.
9. 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.
10. The recovery method for DV or HDV video file according to claim 9, wherein said time point and said frame sequence number are stored in said Subcode section.
11. 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 10.
12. 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: and the cluster management unit is configured to sort the clusters 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 clusters into the video file in sequence.
13. A recovery system for DV or HDV video files according to claim 12, 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.
14. A recovery system for DV or HDV video files according to claim 13, 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 true CN110839135A (en) 2020-02-25
CN110839135B 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)

Cited By (2)

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

Citations (10)

* 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
US20010043785A1 (en) * 2000-03-30 2001-11-22 Hidehiko Teshirogi Magnetic-tape recording apparatus and method, magnetic-tape reproduction apparatus and method, and recording medium
US20020012470A1 (en) * 2000-01-15 2002-01-31 Sony Corporation And Sony Electronics, Inc. Methods and systems for performing inverse quantization and inverse weighting of DV video
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
US20050238331A1 (en) * 2002-06-07 2005-10-27 Fumiyoshi Abe 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
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

Patent Citations (10)

* 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
US20020012470A1 (en) * 2000-01-15 2002-01-31 Sony Corporation And Sony Electronics, Inc. Methods and systems for performing inverse quantization and inverse weighting of DV video
US20010043785A1 (en) * 2000-03-30 2001-11-22 Hidehiko Teshirogi Magnetic-tape recording apparatus and method, magnetic-tape reproduction apparatus and method, and recording medium
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
US20050238331A1 (en) * 2002-06-07 2005-10-27 Fumiyoshi Abe 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
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
R. PILLAI ET AL.: ""A forward error recovery technique for real-time MPEG-2 video transport and its performance over wireless IEEE 802.11 LAN"", 《PROCEEDINGS NINTH INTERNATIONAL CONFERENCE ON COMPUTER COMMUNICATIONS AND NETWORKS》 *
黄步根 等: ""NTFS文件系统中的视频数据恢复方法"", 《计算机工程》 *

Cited By (4)

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

Also Published As

Publication number Publication date
CN110839135B (en) 2022-05-27

Similar Documents

Publication Publication Date Title
AU2016291690B2 (en) Prediction of future views of video segments to optimize system resource utilization
KR101921354B1 (en) Video signature
CN107534796A (en) Detect the fragment of video frequency program
CN108769171A (en) The copy of distributed storage keeps verification method, device, equipment and storage medium
CN110264280A (en) A kind of outdoor advertising monitoring method
CN110839135B (en) Recovery method and system for DV or HDV video file
CN109618236A (en) Video comments treating method and apparatus
CN110502664A (en) Video tab indexes base establishing method, video tab generation method and device
CN112532998B (en) Method, device and equipment for extracting video frame and readable storage medium
CN107770624A (en) It is a kind of it is live during multimedia file player method, device and storage medium
CN112104909A (en) Interactive video playing method and device, computer equipment and readable storage medium
CN110191364B (en) Video data migration method, storage medium, device and system
CN110781037B (en) Method and system for recovering video file in storage medium and readable storage medium
CN109446827B (en) Data encryption and decryption method and system
CN110851301A (en) Recovery method and system for MP4 file
JP7389423B2 (en) Information processing method, information processing device, program, and information processing system
CN114143486A (en) Video stream synchronization method and device, computer equipment and storage medium
CN103957070A (en) Method and device for positioning data frame
EP1643764A1 (en) Video reproducing apparatus
CN110347597B (en) Interface testing method and device of picture server, storage medium and mobile terminal
CN109996010B (en) Video processing method and device, intelligent device and storage medium
CN110262752A (en) A kind of method, apparatus for stored stream media data, storage medium
BR112018000838B1 (en) METHOD AND SYSTEM TO IMPROVE WORKLOAD MANAGEMENT IN A TELEVISION MONITORING SYSTEM WITH AUTOMATED CONTENT AWARENESS
EP3737109A1 (en) Verification code generation method, data verification method and electronic device
CN115374003A (en) Flow playback method and system and computer equipment

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