Skip to content

Commit bb45b96

Browse files
committed
Cleaned version
1 parent 5073a9b commit bb45b96

11 files changed

Lines changed: 1267 additions & 589 deletions

File tree

README.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Simple Video Converter
2+
3+
A modern video conversion application built with Python, GTK4, and Adwaita. This application provides an intuitive interface for converting videos between different formats, with support for various codecs, hardware acceleration, and advanced encoding options.
4+
5+
Linux only.
6+
7+
![shot1](https://github.com/fdev31/SimpleVideoConverter/blob/main/shots/window_folded.png?raw=true)
8+
![shot2](https://github.com/fdev31/SimpleVideoConverter/blob/main/shots/window_expanded.png?raw=true)
9+
10+
## Features
11+
12+
- **User-friendly Interface**: Clean, modern interface built with GTK4 and Adwaita
13+
- **Multiple Encoding Modes**:
14+
- Constant Quality (CRF/QP)
15+
- Constant Bitrate (CBR)
16+
- Variable Bitrate (VBR)
17+
- Target File Size (VBR or CBR)
18+
- **Wide Format Support**: Support for various video containers and codecs
19+
- **Hardware Acceleration**: Utilize GPU acceleration for faster encoding (when available)
20+
- **Audio Processing**: Options to re-encode, copy, or disable audio tracks
21+
- **Multi-pass Encoding**: Support for multi-pass encoding for improved quality
22+
- **Progress Tracking**: Real-time progress updates during conversion
23+
- **Quality Presets**: Choose between encoding speed and efficiency
24+
25+
<!--- **Drag and Drop**: Conveniently drag video files into the application -->
26+
27+
## Requirements
28+
29+
- Python 3.8 or higher
30+
- GTK4
31+
- [Adwaita](https://gnome.pages.gitlab.gnome.org/libadwaita/)
32+
- FFmpeg (must be installed on your system)
33+
- Python dependencies:
34+
- PyGObject
35+
36+
## Installation
37+
38+
### From Source
39+
40+
1. Clone the repository:
41+
```bash
42+
git clone https://github.com/fdev31/SimpleVideoConverter.git
43+
cd video-converter
44+
```
45+
46+
2. Install the required Python packages:
47+
```bash
48+
pip install .
49+
```
50+
51+
3. Install FFmpeg:
52+
- On Ubuntu/Debian:
53+
```bash
54+
sudo apt update
55+
sudo apt install ffmpeg
56+
```
57+
- On Fedora:
58+
```bash
59+
sudo dnf install ffmpeg
60+
```
61+
- On macOS (using Homebrew):
62+
```bash
63+
brew install ffmpeg
64+
```
65+
- On Windows:
66+
Download from [FFmpeg's official website](https://ffmpeg.org/download.html) and add to PATH
67+
68+
4. Run the application:
69+
```bash
70+
python main.py
71+
```
72+
73+
## Usage
74+
75+
1. **Select Input File**: Click "Browse…" next to "Video to convert" or drag and drop a video file onto the application
76+
2. **Select Output File**: Click "Browse…" next to "Output File" to choose where to save the converted video
77+
3. **Configure Encoding Settings**:
78+
- Choose an encoding mode from the dropdown
79+
- Adjust quality, bitrate, or target size based on the selected mode
80+
- Select video codec and container format
81+
- Configure hardware acceleration if available
82+
4. **Advanced Settings** (optional):
83+
- Adjust number of passes for VBR encoding
84+
- Configure audio settings (codec, bitrate)
85+
5. **Start Conversion**: Click "Start conversion" to begin the process
86+
6. **Monitor Progress**: View the conversion progress and output log in the "Output" tab
87+
88+
## Configuration
89+
90+
The application supports various configuration options:
91+
92+
- **Encoding Modes**:
93+
- *Constant Quality*: Use a quality parameter (CRF/QP) to control output quality
94+
- *Bitrate*: Set a specific bitrate for the output
95+
- *Target Size*: Specify a target file size and let the application calculate the appropriate bitrate
96+
97+
- **Video Settings**:
98+
- Codec selection (H.264, H.265, VP9, AV1, etc.)
99+
- Quality preset (ultrafast, medium, slow, veryslow)
100+
- Scaling factor for resolution adjustment
101+
102+
- **Audio Settings**:
103+
- Audio mode (Re-encode, Copy Original, Disable Audio)
104+
- Audio codec selection
105+
- Audio bitrate adjustment
106+
107+
## Troubleshooting
108+
109+
- **FFmpeg not found**: Ensure FFmpeg is installed and accessible in your system's PATH
110+
- **Conversion fails**: Check the output log for error messages
111+
- **Hardware acceleration not working**: Verify that your system supports the selected hardware acceleration method
112+
113+
## Contributing
114+
115+
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
116+
117+
## License
118+
119+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
120+
121+
## Acknowledgments
122+
123+
- FFmpeg for the powerful video processing capabilities
124+
- GTK and Adwaita for the modern UI framework
125+
- The Python community for the excellent libraries used in this project

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "video_converter"
7+
version = "0.1.0"
8+
authors = [
9+
{ name="Fabien Devaux", email="fdev31@gmail.com" },
10+
]
11+
description = "A video converter with quality and speed hints."
12+
readme = "README.md"
13+
requires-python = ">=3.8"
14+
classifiers = [
15+
"Programming Language :: Python :: 3",
16+
"License :: OSI Approved :: MIT License",
17+
"Operating System :: OS Independent",
18+
]
19+
dependencies = [
20+
"PyGObject",
21+
]
22+
23+
[project.scripts]
24+
video-converter = "video_converter.main:main"

shots/window_expanded.png

81.3 KB
Loading

shots/window_folded.png

39.6 KB
Loading

src/video_converter/app.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
class VideoConverterApp(Adw.Application):
1212
def __init__(self):
1313
super().__init__(application_id="com.example.VideoConverter")
14-
self._hw_accel = "cpu"
14+
self.win = None
15+
16+
def do_startup(self):
17+
Adw.Application.do_startup(self)
18+
self.win = VideoConverterWindow(self)
1519

1620
def do_activate(self):
1721
"""Activate the application."""
18-
window = VideoConverterWindow(self)
19-
window.present()
22+
self.win.present()
2023

2124

2225
def main():

0 commit comments

Comments
 (0)