Here's a comprehensive README template for your GitHub repository, covering all key points, usage instructions, and setup details. You'll need to add images or screenshots where noted.
This Python-based video converter converts .mkv
files to .mp4
format using FFmpeg and supports multi-threading, as well as hardware acceleration for both NVIDIA and Intel GPUs (or a CPU fallback). It features a simple GUI using Tkinter, making it easy to select folders for batch conversions and monitor progress.
- Features
- Requirements
- Installation
- Usage
- Configuration
- Algorithm
- Hardware Acceleration
- Example Outputs
- Troubleshooting
- Batch Conversion: Select entire folders to convert all
.mkv
files to.mp4
. - Multi-threading: Leverages multi-core processors for parallel processing, speeding up the conversion.
- GPU Acceleration: Utilizes both NVIDIA (NVENC) and Intel (QSV) hardware acceleration (if available).
- Progress Tracking: Displays real-time progress updates in the GUI.
- Fallback to CPU: Automatically uses CPU encoding if GPUs are unavailable.
- FFmpeg: Install FFmpeg and add it to your system PATH. Download it from ffmpeg.org.
- Python 3.7+: Ensure Python is installed.
- Python Packages:
- Install requirements using
pip install -r requirements.txt
.
- Install requirements using
- Clone the Repository:
git clone https://github.com/gichinga03/mkv-to-mp4-main.git cd mkv-to-mp4-main
- Create and Activate a Virtual Environment:
python -m venv myvenv myvenv\Scripts\activate # Windows # or source myvenv/bin/activate # macOS/Linux
- Install Dependencies:
pip install -r requirements.txt
- Setup FFmpeg:
- Download and install FFmpeg.
- Add the FFmpeg path to your environment variables for system-wide access.
- Run the Converter:
python convertor2.py
- Select Folders:
- Click Browse Folder in the GUI to choose the input folder with
.mkv
files. - Select an output folder where the converted
.mp4
files will be saved.
- Click Browse Folder in the GUI to choose the input folder with
(Add your screenshots here to showcase the interface)
The program requires a sample .mkv
file named sample.mkv
in the main directory for detecting GPU encoders. Add this file manually, or update the file path in convertor2.py
if necessary.
The program alternates conversions between available NVIDIA and Intel GPUs, if detected. This configuration optimizes GPU usage and reduces processing time. If no compatible GPU is available, the program falls back to CPU-based conversion.
- Check Available GPUs:
- A sample file (
sample.mkv
) is used to detect encoder support for NVIDIA (h264_nvenc) and Intel (h264_qsv) hardware.
- A sample file (
- Batch Conversion with Multi-threading:
- Converts files in parallel, submitting one conversion per thread up to a maximum of 10 concurrent conversions.
- Encoder Assignment:
- Assigns NVIDIA or Intel GPU encoding for each file alternatively (or CPU if unavailable).
- Progress Monitoring:
- Tracks conversion progress and updates the GUI in real time.
- NVIDIA NVENC (
h264_nvenc
): Uses NVIDIA GPU hardware encoding. - Intel QSV (
h264_qsv
): Uses Intel Quick Sync Video encoding. - CPU Fallback (
libx264
): Uses software encoding if no compatible GPU is detected.
Add a sample image showing GPU encoder selection in action here.
Input File (.mkv) | Output File (.mp4) | Encoder Used |
---|---|---|
input1.mkv |
output1.mp4 |
h264_nvenc |
input2.mkv |
output2.mp4 |
h264_qsv |
input3.mkv |
output3.mp4 |
libx264 (CPU) |
- Error: Sample File Not Found:
- Add a sample
.mkv
file to the directory to enable GPU detection.
- Add a sample
- FFmpeg Not Found:
- Ensure FFmpeg is installed and added to your system PATH.
- GPU Encoder Not Available:
- Update GPU drivers and confirm your GPU model supports NVENC or QSV.
- Program Hangs:
- Reduce the number of threads or check your system resources.
Feel free to open issues or create pull requests to improve this project. Contributions are welcome!
MIT License. See LICENSE
file for more details.