I have a few .vob
files with "black frames" (it seems that an issue during the acquisition from VHS did that).
I can get where these black frames occur with the command
ffmpeg -i source.vob -vf blackdetect=d=0:pic_th=0.70:pix_th=0.10 -an -f null - 2>&1
which gives me
[...]
[blackdetect @ 0x7fab5b40a3e0] black_start:137.68 black_end:137.72 black_duration:0.04
[blackdetect @ 0x7fab5b40a3e0] black_start:161 black_end:161.04 black_duration:0.04
[blackdetect @ 0x7fab5b40a3e0] black_start:181.96 black_end:182 black_duration:0.04
[...]
(black_duration is always 0.04s for some reason)
I've built a script that cuts the parts between black frames and creates one file for each.
basically, for the three lines above, it runs:
ffmpeg -i "/Users/simon/Documents/projects/encodage VHS/source.vob" -ss 00:02:17.720 -t 23.28 -f avi -c:v libx264 -c:a libmp3lame -crf 0 -preset veryslow -vf "setpts=PTS-STARTPTS" 13.mpeg;
ffmpeg -i "/Users/simon/Documents/projects/encodage VHS/source.vob" -ss 00:02:41.040 -t 20.92 -f avi -c:v libx264 -c:a libmp3lame -crf 0 -preset veryslow -vf "setpts=PTS-STARTPTS" 14.mpeg;
then I merge those files with the concat plugin of ffmpeg.
My issue is: I'm sure the values I use to cut are right, but running the blackdetect filter again, I can see black frames at the beginning of some fragments.
Do you know why I'm still getting those black frames ? Is there a better way to remove them than cut and concat? I'm using a Mac.