This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Re-encode source video with one keyframe every 5 frames | |
ffmpeg -i source.mkv -g 5 tmp.mkv | |
# Search black frames | |
ffmpeg -i tmp.mkv -vf blackframe -f null - | |
# Use output to locate black frames right on keyframes | |
# Then cut video at those keyframes | |
ffmpeg -i tmp.mkv -ss 6.089 -to 180.263 -c copy tmp2.mkv |