Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This title could be somewhat misleading, so let me explain ...

I'm downloading a video file ... mpeg, avi - being one of the popular formats. Now, if I am downloading it, and the download breaks in the middle of the uhm ... download, then, for example, Windows Media Player will give out some error and refuse to play it (although the file is, let's say, 98% complete). But, players like KMPlayer, or MediaPlayer Classic will play it up until that point (as the matter of fact, they can play it while it is being downloaded as well).

So, I'm interested, ... without using any means of download (download managers and alike) to secure the file is completely downloaded, how can one verify whether the video file is downloaded whole, and that it is complete ?

share|improve this question
    
Incomplete MPEG should play with no problems. AVI has indexes for quick seeking at the end of the file, which some players will use and some don't require or will ignore. –  bobince Jan 25 '10 at 13:37
3  
Incomplete MPEG should play with no problems. @bobince, the question was/is how to check for corruption, not how to play an incomplete file. Even if a format supports playing incomplete files, it should still be possible to check for corruption if the file does not conform to the format specifications. For example, you can still read an incomplete plain-text file, but you can still detect if the file has problems like if it ends in the middle of a sentence or there is a chunk of obviously missing information in the middle. –  Synetech Jan 3 at 18:05

3 Answers 3

You can use a feature in ffmpeg video converter: if you will specify it to recode video to nothing it will just read input file and report any errors that will appear. This is very fast process because video frames are just being read, checked and silently dropped.

Example command line: (for Linux)

ffmpeg -v error -i file.avi -f null - 2>error.log

-v error means a certain level of verbosity (to show some errors that are normally hidden because they don't affect playability a much).

You will get a full error log with some generic information about file ffmpeg will output, so this will probably require your attention, through filters can be written to perform batch check of similar files.

FFmpeg is also available for Windows here. The command line will be almost identical with an exception of stderr redirect:

ffmpeg.exe -v error -i file.avi -f null - >error.log 2>&1
share|improve this answer
    
Interesting ... going off to try it. –  ldigas Jan 25 '10 at 13:19
2  
Same speed as if it would been converting. –  Somebody Mar 26 '13 at 0:17
    
Another option is ffprobe that comes in package with ffmpeg. It doesn't do any conversion but simply reads metadata info from file. Therefore it will detect errors in metadata but won't find any problems within file itself. Personally using ffprobe to make fast verification of uploaded before processing further –  mente Oct 1 '13 at 7:41

I liked idea of using ffmpeg -f null above, but I'd actually like to automate process of using that output. In particular, common scenario I have with my music video collection is that I have few clips which have same resolution, and I'd like to diff verification logs for those files to remove ones broken the most.

Unfortunately, ffmpeg so far doesn't have a way to disable its interactive mode, which outputs noise for this case of usage. I ended up hacking simple wrapper script to do filtering:

#!/usr/bin/env python
import sys
import os
import re

t = os.popen('ffmpeg -v 5 -i "%s" -f null - 2>&1' % sys.argv[1]).read()
t = re.sub(r"frame=.+?\r", "", t)
t = re.sub(r"\[(.+?) @ 0x.+?\]", "[\\1]", t)
print t

Example output:

[mpeg1video]ac-tex damaged at 21 17
[mpeg1video]Warning MVs not available
[mpeg1video]concealing 22 DC, 22 AC, 22 MV errors
[mpeg1video]Warning MVs not available
[mpeg1video]concealing 22 DC, 22 AC, 22 MV errors
[mpeg1video]ac-tex damaged at 13 9
share|improve this answer

MediaInfo is a great tool for getting info about any video file you care to throw at it. This may be able to highlight the info you want.

Another tool is GSpot but it hasn't been updated in nearly 3 years.

Try giving each one a known good and known bad file and compare the results.

I used to use GSpot until it stopped being updated, then switched to MediaInfo

share|improve this answer
1  
I have some old version of GSpot on my machine ... but it is a tool for something completely different (determining the code/decode...). It has nothing to do with this. I'll check out mediainfo. –  ldigas Jan 25 '10 at 13:18
    
GSpot will report if file size or frame count do not match the expected from the index (somewhere on the left hand side, it's been a while since I used it!), also later versions added much functionality. –  Shevek Jan 25 '10 at 14:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.