Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ts-manuel/ffmpeg-batch
Batch process media files with ffmpeg
https://github.com/ts-manuel/ffmpeg-batch
ffmpeg python
Last synced: 3 months ago
JSON representation
Batch process media files with ffmpeg
- Host: GitHub
- URL: https://github.com/ts-manuel/ffmpeg-batch
- Owner: ts-manuel
- License: mit
- Created: 2024-07-27T20:12:46.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-08-19T18:49:24.000Z (6 months ago)
- Last Synced: 2024-10-13T08:22:30.788Z (4 months ago)
- Topics: ffmpeg, python
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FFMPEG-BATCH
![Screenshot 2024-08-03 104345](https://github.com/user-attachments/assets/386996db-d94f-41ab-83ff-bbe4bd0f861d)Table of Contents
## About The Project
This is a python script to batch process videos using ffmpeg. The script evaluates the list of input files and directories provided and converts all files to the specified output directory. The conversion is done with ffmpeg using the command line argument from one of the available presets.### Usage
usage: ffbatch [-h] [-r] [-f] [-v] [-p PRESET] -i INPUT [INPUT ...] -o OUTPUTBatch precess media files with ffmpeg.
options:
-h, --help show this help message and exit
-r recursive evaluation (include sub directories) (default: False)
-f do not skip already existing output files (default: False)
-v show debug output on console (default: False)
-p PRESET preset to use for file conversion (default: None)
-i INPUT [INPUT ...] input file paths or directories to be evaluated (default: None)
-o OUTPUT output directory where to store converted files (default: None)### Presets
Presets are stored in the `"presets.json"` file as a dictionary,
every entry must have the folllowing keys:
+ "output_file_ext" : the file extension of the output file
+ "ffmpeg_args" : the arguments to pass to ffmpeg#### Example
{
"Preset 1":{
"output_file_ext": ".m2ts",
"ffmpeg_args":{
"c:v": "libx264",
"c:a": "ac3",
...
}
},
"Preset 2":{
"output_file_ext": ".mp4",
"ffmpeg_args":{
...
}
}
}## Installing
After cloning the repository from the root directory run the commandpip install .
## Development
After cloning the repository create a python virtual enviroment.
From the repository root directory run the follwing command:python -m venv .venv
After the enviroment has been created it must be activated
.venv/Scripts/activate (windows)
source .venv/bin/activate (linux)
And then required packages installed
pip install -r requirements.txt
For testing the package can be installed in editable mode, changes to the code are instantly applied to the package. In editable mode there is no need to install the pakage after every change to the code.
pip install -e .
**NOTE:** The requirements.txt file is genrated with
pip freeze > requirements.txt