feat: completed with all features
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
# Video Generator Voiceover
|
||||
|
||||
Small helper scripts for creating timed tutorial voiceovers from `.srt` files and replacing a video's original audio with the generated voiceover.
|
||||
|
||||
## Files
|
||||
|
||||
- `scripts/make_voiceover_macos.py` — creates timed WAV/optional MP3 voiceover on macOS
|
||||
- `scripts/make_voiceover_windows.py` — creates timed WAV/optional MP3 voiceover on Windows
|
||||
- `scripts/combine_video_audio.py` — replaces video audio and exports final MP4
|
||||
- `subtitles/` — optional place to keep SRT files
|
||||
- `output/` — optional place to save generated audio/video files
|
||||
|
||||
## Install
|
||||
|
||||
### Windows
|
||||
|
||||
```powershell
|
||||
winget install Gyan.FFmpeg
|
||||
```
|
||||
|
||||
Install Python from `python.org` or Microsoft Store, then reopen PowerShell and check:
|
||||
|
||||
```powershell
|
||||
ffmpeg -version
|
||||
python --version
|
||||
```
|
||||
|
||||
### macOS
|
||||
|
||||
```bash
|
||||
brew install ffmpeg
|
||||
```
|
||||
|
||||
Python is already available on most Macs. If needed, install it from `python.org`.
|
||||
|
||||
## Create voiceover
|
||||
|
||||
Run from the `video-generator` folder. Pass your own SRT and output paths.
|
||||
|
||||
### Windows
|
||||
|
||||
```powershell
|
||||
python scripts/make_voiceover_windows.py `
|
||||
--srt "video-generator/subtitles/your_subtitles.srt" `
|
||||
--voice "Microsoft David Desktop" `
|
||||
--rate 0 `
|
||||
--wav "video-generator/output/voiceover.wav" `
|
||||
--mp3 "video-generator/output/voiceover.mp3"
|
||||
```
|
||||
|
||||
### macOS
|
||||
|
||||
```bash
|
||||
python video-generator/scripts/make_voiceover_macos.py \
|
||||
--srt "video-generator/subtitles/your_subtitles.srt" \
|
||||
--voice "Daniel" \
|
||||
--rate 185 \
|
||||
--wav "video-generator/output/voiceover.wav" \
|
||||
--mp3 "video-generator/output/voiceover.mp3"
|
||||
```
|
||||
|
||||
`--mp3` is optional. Use WAV when combining with video.
|
||||
|
||||
## Combine video + audio
|
||||
|
||||
This removes the original video audio and uses the generated voiceover.
|
||||
|
||||
### Windows
|
||||
|
||||
```powershell
|
||||
python video-generator/scripts/combine_video_audio.py `
|
||||
--video "video-generator/input/your_video.mp4" `
|
||||
--audio "video-generator/output/voiceover.wav" `
|
||||
--output "video-generator/output/final_video.mp4"
|
||||
```
|
||||
|
||||
### macOS
|
||||
|
||||
```bash
|
||||
python video-generator/scripts/combine_video_audio.py \
|
||||
--video "video-generator/input/your_video.mp4" \
|
||||
--audio "video-generator/output/voiceover.wav" \
|
||||
--output "video-generator/output/final_video.mp4"
|
||||
```
|
||||
|
||||
Use absolute paths if files are outside this folder.
|
||||
|
||||
## Voice and speed options
|
||||
|
||||
### Windows voice list
|
||||
|
||||
```powershell
|
||||
Add-Type -AssemblyName System.Speech
|
||||
$synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
|
||||
$synth.GetInstalledVoices() | ForEach-Object { $_.VoiceInfo.Name }
|
||||
```
|
||||
|
||||
Good tutorial voices: `Microsoft David Desktop`, `Microsoft Mark` if available.
|
||||
|
||||
Windows speed uses `-10` to `10`:
|
||||
|
||||
```powershell
|
||||
python video-generator/scripts/make_voiceover_windows.py `
|
||||
--srt "video-generator/subtitles/your_subtitles.srt" `
|
||||
--wav "video-generator/output/voiceover.wav" `
|
||||
--voice "Microsoft David Desktop" `
|
||||
--rate 2
|
||||
```
|
||||
|
||||
To add voices: `Settings > Time & language > Speech > Manage voices > Add voices`.
|
||||
|
||||
### macOS voice list
|
||||
|
||||
```bash
|
||||
say -v '?'
|
||||
```
|
||||
|
||||
Good tutorial voices: `Daniel`, `Reed (English (US))`, `Eddy (English (UK))`.
|
||||
|
||||
Speed example:
|
||||
|
||||
```bash
|
||||
python video-generator/scripts/make_voiceover_macos.py \
|
||||
--srt "video-generator/subtitles/your_subtitles.srt" \
|
||||
--wav "video-generator/output/voiceover.wav" \
|
||||
--voice "Daniel" \
|
||||
--rate 190
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
If a caption has too much text for its time slot, the script keeps the SRT timing and trims the speech. Fix that by increasing the subtitle duration, shortening the sentence, or increasing speed.
|
||||
|
||||
If the final MP4 has compatibility issues, add `--reencode-video` to the combine command.
|
||||
Reference in New Issue
Block a user