Inspired by the superuser post here. This script removes all black sections in a by FFMPEG supported video. There's a couple params you can tweak, the default ones are tested and confirmed working.
- First up you'll have to download FFMPEG yourself, which can be found here.
- Put the ffmpeg.exe file in the appropriate location (indicated by the file called "ffmpegEXEgoeshere").
- Stash your black framed video files inside the video folder.
- Run the python script.
- The stripped files will be inside the video folder and have "RED" appended to their file name.
There's a couple parameters you can tweak. These are located inside the "detect.py" file itself.
dur
Set the minimum detected black duration (in seconds)
pic
Set the threshold for considering a picture as "black" (in percent)
pix
Set the threshold for considering a pixel "black" (in luminance)
If you find bugs you can notify me by opening an issue. Already solved the bug? Great! Make a pull request and I'll merge it.
Released under the Apache 2.0 License