Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/farishijazi/deblack
remove black frames from a video. Simple python file to create ffmpeg commands. Originally started in a stackexchange question (https://superuser.com/a/1697654/739491)
https://github.com/farishijazi/deblack
automation ffmpeg ffmpeg-script python script video-editing video-editor
Last synced: about 2 months ago
JSON representation
remove black frames from a video. Simple python file to create ffmpeg commands. Originally started in a stackexchange question (https://superuser.com/a/1697654/739491)
- Host: GitHub
- URL: https://github.com/farishijazi/deblack
- Owner: FarisHijazi
- License: mit
- Created: 2022-10-18T16:10:42.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-18T05:17:09.000Z (8 months ago)
- Last Synced: 2024-10-15T01:23:22.014Z (2 months ago)
- Topics: automation, ffmpeg, ffmpeg-script, python, script, video-editing, video-editor
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 21
- Watchers: 1
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deblack
remove black frames from a video. Simple python file to create ffmpeg commands
## Usage
Download:
```sh
pip install git+https://github.com/FarisHijazi/deblack
```And then just run the bellow command, and the output should be saved as `myvideo.out.mp4`
```
deblack path/to/myvideo.mp4
```If the above doesn't work, then check the [prerequisites](#prerequisites) section for more detailed installation instructions.
## prerequisites
Click to expand
### Python3
You need to have python 3 installed in the command line
### FFmpeg
You need to have `ffmpeg` installed somehow, there are many ways to download it, one way is to download the binary (.exe) and put it in the same directory (make sure it's called ffmpeg.exe)
https://ffmpeg.org/download.html```sh
# windows (run this in powershell)
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install -y ffmpeg# linux ubuntu
sudo apt install -y ffmpeg# mac
brew install ffmpeg
```## History
Click to expand
This project originally started in as a Gist [here](https://gist.github.com/FarisHijazi/eff7a7979440faa84a63657e085ec504).
This is a combination from multiple solutions found in the bellow 2 links:
- https://video.stackexchange.com/a/16571/37220
- https://superuser.com/a/1498811/739491helpful resources
- https://video.stackexchange.com/questions/16564/how-to-trim-out-black-frames-with-ffmpeg-on-windows#new-answer?newreg=d534934be5774bd1938b535cd76608cd
- https://github.com/kkroening/ffmpeg-python/issues/184#issuecomment-493847192## Development
Click to expand
### Create test video
```sh
python test/gen_bw_video.py --outpath test/bw.mp4 # create test video
python deblack/deblack.py test/bw.mp4 # run deblack on test video
```### Add pre-commit hooks
this will format files before commiting
```sh
pip install pre-commit
pre-commit install
```