How to check programmatically whether a video file is corrupt in Android

I want to check in my app whether a mp4 or 3gp or any other android supportable format is corrupt or not, its is playable by Android system or not.
Last updated:10/29/2015 7:17:53 AM

1 Answers

Mayank Tripathi
Mayank Tripathi

There is no way to find out unless you decode the file completely. You can decode and not display. So use something like ffmpeg to decode into /dev/null. If there are no error messages and it did not abort in the middle everything is fine. if there are you know you have corruption in the file of some sort.

Generally if they are recoverable errors ffmpeg will continue. So you can get a sense of amount of errors or severity depending on number of error messages and ability to continue till the end.

Answer