How to check video integrity. mp4?

Asked

Viewed 1,240 times

-2

I have at hand about 10,000 videos in . mp4 format, but some of them are corrupted. Such files are corrupted as follows: videos should have a certain length of time, however, when they are played, such videos are automatically closed before time. I believe this error comes from a failed download.

I would like to know some program/ method that analyzes all these videos, and point out which ones are corrupted. No need to repair the corrupted videos, just point out which ones are wrong.

NOTE: I am using Windows 7

1 answer

2


Thiago Benine, see step by step how I would do (whereas the video files are in a folder only in C:\videos and that the filenames are without space and accent (use the Bulk Rename Utility if you need to standardize file names at once):

  1. Create a list in a text document with ALL video file names:
    1. Open MS-DOS, navigate to the folder with the videos (cd C:\videos for example)
    2. Still in MS-DOS, export the name of . mp4 files using:
      • dir *.mp4 /b >>arquivos_de_video.txt
  2. With the names of the video files on C:\videos\arquivos_de_video.txt, lower the FFMPEG for Windows.
  3. Open the file C:\videos\arquivos_de_video.txtwith a good text editor (recommend the Sublime Text 3, because with it, it is possible to click the MIDDLE button of the mouse and drag by selecting MULTIPLE LINES) and insert the command line of the FFMPEG to check EACH video file:
    • ffmpeg.exe -v error -i video.mp4 -f null - >video.txt 2>&1
  4. Rename C:\videos\arquivos_de_video.txt for C:\videos\verifica_videos.bat (extension .bat)
  5. Execute via MS-DOS your new file . bat: C:\videos\verifica_videos.bat

Example of what the C:\videos\verifica_videos.bat:

ffmpeg.exe -v error -i video1.mp4 -f null - >video1_erro.txt 2>&1
ffmpeg.exe -v error -i video2.mp4 -f null - >video2_erro.txt 2>&1
ffmpeg.exe -v error -i video3.mp4 -f null - >video3_erro.txt 2>&1
(...)

This is obviously the simplest example that could be given. The ideal would be to program (C# or other language) a more dynamic and fast output.

Don’t forget to correctly enter the path of ffmpeg.exe lowered in step 2).

Don’t forget to also change the error file name video.txt to the nome_do_video_erro.txt Thus, the errors files will be displayed in the same order in your Windows Explorer.

Unfortunately the check time (with or without FFMPEG) is pretty much the same as converting a video, so 10,000 videos can take quite a while.

SUMMARY

  1. Create a list of videos in a text document.
  2. Edit the text file with the names of the videos with a good text editor (Sublime, for example) and insert the FFMPEG verification command line in each line of the text file.
  3. Rename video file list to . bat extension
  4. Run the new. bat file via MS-DOS
  • Good evening Felipe, I noticed that you have collaborated a lot and always with great answers, but note that before answering some questions it would be nice to take a look at what is part of the scope of the site http://answall.com/help/on-topic . Making a comment may help, but formulating an answer can encourage you to have many questions that are not within the scope of the site and when the questioner has your question you will feel frustrated, due before it get answer to something Offtopic and then not get more.

  • Felipe, could you give me an example of what . txt would look like after completing step 3?

  • @Guilhermenascimento, good evening. I understood well the scope of help/on-topic. But don’t you think your message could be meant for @Thiago Benine, who asked the question? Anyway, now I know exactly the scope of the questions, thank you.

  • @Thiago Benine, the example would be exactly what is after step 5 in Exemplo de como ficaria o C:\videos\verifica_videos.bat.

  • @Felipedouradinho When the question is off-topic there is a system that "closes" or "suspends" the question and a message appears in the footer. The comment was intended for you, because the moment you answered indirectly you are encouraging off-topic questions. There is no harm in answering, but I recommend either avoiding or "flagging" off-topic questions, even if you have or have not answered.

  • @Felipedouradinho how do I enter the ffmpeg code of step 3, to check 10,000 videos? Have to write manually?

  • Doubt solved by @Felipedouradinho

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.