Skip to content

Instantly share code, notes, and snippets.

@ridvanaltun
Last active October 14, 2024 10:09
Show Gist options
  • Save ridvanaltun/8880ab207e5edc92a58608d466095dec to your computer and use it in GitHub Desktop.
Save ridvanaltun/8880ab207e5edc92a58608d466095dec to your computer and use it in GitHub Desktop.
How to check if a video file is corrupted?

Download ffmpeg from here, download *-win64-gpl.zip for Windows.

Install ffmpeg for Ubuntu

sudo apt install ffmpeg

Below command will give you a log file. If no error found, the log file will be empty.

# scan a single file
ffmpeg.exe -v error -i C:\to\path\file.avi -f null - >error.log 2>&1

# batch scan
find C:\to\path\ -name "*.mp4" -exec sh -c "ffmpeg -v error -i '{}' -map 0:1 -f null - 2>'{}.log'" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment