- Overview
- Quickstart
- How to install
- How it works
- External dependencies
- Useful commands
- Features for the future
- FAQ
- Additional ressources
A short python script to get video meta data.
Notes:
This project uses Python 3.10
This is an very early state of the tool. Many Null/None checks are missing and by now I´m only looking for .mkv files. These problems will be fixed in the future, but I don't have the time to address them currently.
Usage: Run the main python script (main.py) with the root of you movies folder (e.g. 'D:\Movies') as parameter.
Execute this command in the Windows Terminal
or CMD
.
python main.py 'path:\to\movie-root'
The first steps are to install Python (preffered the latest stable, currently 3.10), FFmpeg (short tutorial for windows) and pip.
Run
git clone https://github.com/bennischober/MetaDataScraper.git
pip install -r requirements.txt
The scripts will search recursively for (by now .mkv) movie files. If the script found a movie file, it uses ffmpeg.probe()
and looks specificly for its streams. If the return value is not None
, it proceeds to get all the meta data. Some of the data has to be calculated/created/converted, e.g the raw duration of the movie, the aspect ratio, the size of the movie file (convertion only) and the duration (convertion only).
To detect black bars in the movie, we need to check some frames of the video by using a subprocess
and using the ffmpeg cropdetect
command. The output will checked against the codec data (using a threshold to be 100% sure, its not just some pixels that can be cut).
This is why we you need to install the ffmpeg-python
package and the FFmpeg standalone tool.
Meta data detection: ffmpeg and ffmpeg python(GitHub)
Black bar detection: ffmpeg
Loading bar: tqdm
Python package installer: pip
-csv
generates a csv file of the processed data.
python main.py 'path:\to\movie-root' -csv
- config.json to change the settings (e.g. movie format, language, output, etc.)
- support (almost) all common movie file formats
- get missing meta data from external movie APIs, e.g. OMDB API or List
- The command
python
does not work in the command prompt. Have a look at this. - "No such filter: 'cropdetect'...". On Windows: Make sure you installed the gpl version of ffmpeg. On Linux/UNIX this might help
pip install tqdm
pip install ffmpeg-python
FFmpeg Documentation
How the black bar detection works
tqdm Documentation