# Reliable Integrity Preservation Analysis of Video Contents with Support of Blockchain Systems
## 3 Proposed Scheme
### Integrity Preservation Trace of Reretouched Video Files  
Although the mechanism explained in Section 3.1 can quickly verify the name of the video editing tools or camera devices that last touched the target video file, it is unable to discriminate in cases in which video contents are preserved without any modification during retouching of the original video file by some video editing tool. It is common to convert the file format of an original video file into another format suitable for running on portable multimedia devices; for example, from AVI file format to MP4 file format. In this case, the mechanism explained in Section 3.1 determines the converted video file as non-original, but the integrity of the multimedia contents in the converted video file is preserved in its original form. To overcome this drawback, the proposed scheme provides another mechanism, which is not considered in our previous study [25]. The mechanism compares multimedia contents of the original video and those of the retouched video frame by frame. When all corresponding frames of the original video and the retouched video are the same, this mechanism decides that contents of the two videos are equal. If some corresponding frames of the original video and the retouched video are different, this mechanism decides that contents of the two videos are not equal. The comparison result and the integrity analysis result of the original file are stored in the public blockchain system with a hash value of the retouched video file. Then, the integrity of the retouched video file can be traced with its hash value on the blockchain system. The retouched video file is determined as original only when the comparison result is equal and its corresponding source video file has integrity-guaranteed video contents. Figure 5 shows the flow chart of the procedure to compare the multimedia contents of two videos. The scheme opens the original video and the retouched video and extracts their Group of Picture (GoP) sequentially. When the frame rates per second (FPS) of the two videos are different, the comparison of each corresponding frame pair in two videos may result in an incorrect comparison result. So, the scheme compares only the first frame of extracted GoPs, called the I-frame, which is not affected by the different FPSs. The scheme calculates the maximum or average difference of the first frames in two extracted GoPs. If the calculated maximum or average difference is smaller than the given threshold values, the scheme extracts the next GoPs of the two videos and continues to compare the first frames of the extracted GoPs until there are no more GoPs in the two videos. If the numbers of GoPs in the two videos are different, and thus the two videos do not reach their ends simultaneously, the scheme returns the result \"Not Same\". Only when the two videos reach their ends simultaneously with passes of comparing all GoPs, will scheme return the result \"Same\". Figure 6 shows the detailed structure of the integrity preservation trace mechanism. The function modules for \"Video Integrity Analysis\" and \"Source Code Integrity Analysis\" are equal to those in Figure 4. Added function modules are \"Integrity Trace Support\" and \"Stored Integrity Analysis Search\". The proposed mechanism first checks the integrity of the input video file in the module \"Video Integrity Analysis\". If the integrity of the file is not proved, the following comparison procedure is skipped. If the integrity is proved, the proposed mechanism compares the frames of an original video and the frames of its retouched video one by one sequentially in the module \"Integrity Trace Support\". As well as the comparison result, the integrity analysis result of the original file and the hash value of the retouched video file are stored as a form of the single group variable into the blockchain system.