mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Added new option: Subtitle format
This commit is contained in:
+6
-15
@@ -7,9 +7,10 @@ https://github.com/user-attachments/assets/9e4fc237-a3cd-46bd-b82c-c608336d6411
|
||||
### What You Need
|
||||
|
||||
- A background image (bg.jpg)
|
||||
- The subtitle file (.srt) **(created by Abogen)**
|
||||
- The subtitle file (.ass) **(created by Abogen)**
|
||||
- Select `ass(centered narrow)` as subtitle format in settings.
|
||||
- The audio recording (.wav) **(created by Abogen)**
|
||||
- [Python](https://www.python.org/downloads/) and FFmpeg installed on your computer:
|
||||
- FFmpeg installed on your computer:
|
||||
|
||||
```bash
|
||||
# Windows
|
||||
@@ -22,22 +23,12 @@ brew install ffmpeg
|
||||
sudo apt install ffmpeg
|
||||
```
|
||||
|
||||
### Step 1: Process the Subtitle File
|
||||
|
||||
Run this command to process Abogen's subtitle file:
|
||||
|
||||
```
|
||||
python convert.py your_subtitle.srt
|
||||
```
|
||||
|
||||
This creates a properly formatted subtitle file called "your_subtitle_demo.ass" with centered text and appropriate styling.
|
||||
|
||||
### Step 2: Create the Video (.webm)
|
||||
### Create the Video (.webm)
|
||||
|
||||
Run this FFmpeg command to create the tiny video:
|
||||
|
||||
```
|
||||
ffmpeg -loop 1 -framerate 24 -i bg.jpg -i audio.wav -vf "ass=your_subtitle_demo.ass" -c:v libvpx-vp9 -b:v 0 -crf 30 -c:a libopus -shortest demo.webm
|
||||
ffmpeg -loop 1 -framerate 24 -i bg.jpg -i audio.wav -vf "ass=subtitle.ass" -c:v libvpx-vp9 -b:v 0 -crf 30 -c:a libopus -shortest demo.webm
|
||||
```
|
||||
|
||||
## For Higher Quality (But Larger) Video (.mp4)
|
||||
@@ -45,7 +36,7 @@ ffmpeg -loop 1 -framerate 24 -i bg.jpg -i audio.wav -vf "ass=your_subtitle_demo.
|
||||
If you need better quality for distribution, use this command instead:
|
||||
|
||||
```
|
||||
ffmpeg -loop 1 -framerate 24 -i bg.jpg -i audio.wav -vf "ass=your_subtitle_demo.ass" -c:v libx264 -preset slow -crf 18 -movflags +faststart -c:a copy -shortest demo.mp4
|
||||
ffmpeg -loop 1 -framerate 24 -i bg.jpg -i audio.wav -vf "ass=subtitle.ass" -c:v libx264 -preset slow -crf 18 -movflags +faststart -c:a copy -shortest demo.mp4
|
||||
```
|
||||
|
||||
This creates an MP4 file that's compatible with more devices but larger in size.
|
||||
|
||||
Reference in New Issue
Block a user