+5 votes
1.9k views
How to verify the integrity of a video

in Guides by (552k points)
reopened | 1.9k views

1 Answer

+3 votes
Best answer

How to check the integrity of a video and verify that it has no errors.
Verify that a video file has no errors with FFmpeg.

Sometimes we download videos or movies from the internet, but at some point during its reproduction we find errors. The origin of the problem can be very varied, from a problem of codecs, of the player or that the video is damaged. To cover the problems in which the videos are damaged by downloading them, copy them from a USB flash drive or similar we will publish a tutorial that will teach you to verify the integrity of a video .

image

The video files can be of various types (mkv, mp4, wmv, ...) , but this method that we are going to show you will work in most cases. This is because we will use the FFmepg program to verify that the video file has no errors.

In my case the problem was detected during the video playback, I could see that the sound was playing correctly but the video was freezing for several seconds. In other cases the problem can be detected because the image looks blurred, pixelated or simply because nothing is reproduced.

How to check the integrity of a video and verify that it has no errors.

Whenever possible we should check the integrity of the file in the classic way, that is, using the hash functions and algorithms designed for this purpose. That this does not scare you, it is a very simple process to which we already dedicate a tutorial to verify the integrity of files in Windows and how to do this verification from the Linux terminal .

If the above process does not help us or does not solve the problem, we will download FFmepg to follow the instructions below.

Verify that a video file has no errors with FFmpeg.

When using FFmpeg we have a multiplatform tool, so this tutorial will be applicable from both Windows and Linux. Some experts recommend using tools such as Mediainfo or FFprobe (included in the FFmpeg package) to extract the metadata from the video and verify that there is nothing out of the ordinary. This step takes a few seconds and helps us verify the metadata, but does not detect errors in the integrity of the file.

image

Ideally, to verify the integrity of the video is to execute the following command:

  • On Windows: ffmpeg.exe -v error -i video.mkv -f null - >error.log 2>&1
  • On Linux: ffmpeg -v error -i video.mkv -f null - 2>error.log

When the process is finished in both Windows and Linux, the error.log file will be created, which we will have to examine with a text editor to verify what errors it has detected. If the file is blank, there have been no errors.

image

Note that in the example command we use as a filename to verify video.mkv , but it could be any video file supported by FFmpeg . The verification process can take a long time, depending on the size of the file and the power of the equipment we are using. To give you an idea, verifying a 600MB file on my computer took about a minute.


by (3.5m points)

Related questions

+4 votes
4 answers
asked Aug 9, 2019 in Guides by backtothefuture (552k points) | 74.7k views
+5 votes
1 answer
asked Aug 10, 2019 in Guides by backtothefuture (552k points) | 4.9k views
+3 votes
1 answer
+5 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users