B Lolo
B Lolo

Reputation: 71

How to check if video have visually corrupted frames?

I'm using ffmpeg to convert and analyze video, mostly avi to mkv. Sometimes video that I work on have one frame corrupted in random place, , it looks like:

Digital scramble

How to check if frame is visually corrupted in ffmpeg?

It's not file corruption (not byte corruption), I know that because this video artifact is present in source file, it's just visual corruption.

This command line gives error free result: ffmpeg -i myinput.avi {params} out.mkv 2> error_log.txt

How to find if similar pattern is on any more frames in video file? Can something from signalstats could be helpful?

Upvotes: 7

Views: 2148

Answers (2)

Ade Miller
Ade Miller

Reputation: 13723

In the case of your bad frame you might be able to use the entropy filter or similar to detect it as the frame is "static" and has a very high pixel to pixel variance, far higher than you would see with normal video.

@Jack Frame counting will not detect valid video frames that are not due to file level corruption. I think the OP is saying they have a file where the source input was bad but correctly encoded.

Upvotes: 0

Jack
Jack

Reputation: 302

The only way I've found so far is to use ffprobe and force to count the frame, which takes a little more time than the usual way described above ..

ffprobe -v error -hide_banner -i $mediaFile -threads 0 -count_frames  -show_format \
-show_streams -print_format json 2>error.log

Upvotes: 1

Related Questions