Reputation: 71
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:
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
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
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