Last active
November 16, 2015 08:56
-
-
Save greatvc/fb36220e1b3b3a77c7f3 to your computer and use it in GitHub Desktop.
Check videos if they are corrupted at the end by seeking to 99% of the video. Return true if it is corrupted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import os | |
| import sys | |
| MyVideo="" | |
| def checkfile(filename): | |
| command = "echo 'seek 99 1' | mplayer -slave -msglevel all=4 -benchmark -vo null -nosound \"" + filename + "\" 2>&1" | |
| output = os.popen(command).read() | |
| if output.lower().find('error') == -1: | |
| return True | |
| else: | |
| return False | |
| if __name__ == "__main__": | |
| for filename in sys.argv[1:]: | |
| if not checkfile(filename): | |
| head,tail=os.path.split(filename) | |
| MyVideo=tail[:-4] | |
| print MyVideo | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment