Replies: 1 comment
-
I didn't notice a difference when using
But it's difficult to automate parsing the resulting log because it is full of specific details. I wrapped the above 1-4 options in the $ pip install xklb
$ library media-check -h
usage: library media-check [--chunk-size SECONDS] [--gap SECONDS OR 0.0-1.0*DURATION] [--delete-corrupt >0-100] [--full-scan] [--audio-scan] PATH ...
Defaults to decode 0.5 second per 10% of each file
library media-check ./video.mp4
Decode all the frames of each file to evaluate how corrupt it is (very slow; about 150 seconds for an hour-long file)
library media-check --full-scan ./video.mp4
Decode all the packets of each file to evaluate how corrupt it is (about one second of each file but only accurate for formats where 1 packet == 1 frame)
library media-check --full-scan --gap 0 ./video.mp4
Decode all audio of each file to evaluate how corrupt it is (about four seconds per file)
library media-check --full-scan --audio ./video.mp4
Decode at least one frame at the start and end of each file to evaluate how corrupt it is (takes about one second per file)
library media-check --chunk-size 0.05 --gap 0.999 ./video.mp4
Decode 3s every 5% of a file to evaluate how corrupt it is (takes about three seconds per file)
library media-check --chunk-size 3 --gap 0.05 ./video.mp4
Delete the file if 20 percent or more of checks fail
library media-check --delete-corrupt 20 ./video.mp4 https://github.com/chapmanjacobd/library/blob/main/xklb/media/media_check.py |
Beta Was this translation helpful? Give feedback.
-
in response to feature request in issue #704
It is actually possible to detect broken videos using the cmdline version of ffmpeg (already included in some distributions of Czkawka) by asking it to decode a video into a null output, with options to only write to stderr if an error is encountered:
ffmpeg -v error -i $FILENAME -f null -
The level of error detection can be configured with the -err_detect commandline option.
Detecting broken videos will be slow (maybe even slower than creating a video hash) because the entire video must be scanned.
Beta Was this translation helpful? Give feedback.
All reactions