Skip to content

Commit 8bcf942

Browse files
committed
feat: add TTS narration + single combined promo video
1 parent 79b69f7 commit 8bcf942

2 files changed

Lines changed: 33 additions & 22 deletions

File tree

.github/workflows/video-build.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,45 +28,47 @@ jobs:
2828
with:
2929
python-version: '3.11'
3030

31-
- name: Install Manim & dependencies
31+
- name: Install Manim, gTTS & dependencies
3232
run: |
3333
sudo apt-get update
3434
sudo apt-get install -y ffmpeg libcairo2-dev libpango1.0-dev
35-
pip install manim==0.18.1
35+
pip install manim==0.18.1 gTTS
3636
37-
- name: Render promo video (1080p)
37+
- name: Generate narration audio
3838
run: |
3939
cd promo
40-
manim render -qh --format mp4 promo_scene.py ProductPromo
41-
echo "Video rendered"
40+
python generate_audio.py
41+
ls -lh narration.mp3
4242
43-
- name: Render social media variants
43+
- name: Render promo video (1080p)
4444
run: |
4545
cd promo
46-
# Square (1080x1080) for Instagram/LinkedIn
47-
manim render -qh --format mp4 \
48-
--resolution 1080,1080 \
49-
promo_scene.py ProductPromo \
50-
-o eOffice_square.mp4 || true
51-
echo "Social variants rendered"
46+
manim render -qh --format mp4 promo_scene.py ProductPromo
5247
53-
- name: List outputs
48+
- name: Merge video + audio into final MP4
5449
run: |
55-
echo "=== Generated Videos ==="
56-
find promo/media -name "*.mp4" -exec ls -lh {} \;
50+
cd promo
51+
VIDEO=$(find media/videos -name "ProductPromo.mp4" | head -1)
52+
ffmpeg -y -i "$VIDEO" -i narration.mp3 \
53+
-c:v copy -c:a aac -b:a 192k \
54+
-map 0:v:0 -map 1:a:0 \
55+
-shortest \
56+
eOffice_v1.0_promo.mp4
57+
echo "Final video:"
58+
ls -lh eOffice_v1.0_promo.mp4
5759
58-
- name: Upload video artifacts
60+
- name: Upload final video
5961
uses: actions/upload-artifact@v4
6062
with:
61-
name: promo-videos
62-
path: promo/media/videos/**/*.mp4
63+
name: eOffice-promo-video
64+
path: promo/eOffice_v1.0_promo.mp4
6365
retention-days: 90
6466

6567
- name: Attach to release
6668
if: github.event_name == 'release'
6769
uses: softprops/action-gh-release@v2
6870
with:
69-
files: promo/media/videos/**/*.mp4
71+
files: promo/eOffice_v1.0_promo.mp4
7072
tag_name: ${{ github.event.release.tag_name }}
7173
fail_on_unmatched_files: false
7274
env:
@@ -81,9 +83,8 @@ jobs:
8183
- name: Report
8284
run: |
8385
echo "## Promo Video Build" >> $GITHUB_STEP_SUMMARY
84-
echo "" >> $GITHUB_STEP_SUMMARY
8586
echo "| Detail | Value |" >> $GITHUB_STEP_SUMMARY
8687
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
8788
echo "| Product | eOffice |" >> $GITHUB_STEP_SUMMARY
88-
echo "| Render | ${{ needs.render-video.result }} |" >> $GITHUB_STEP_SUMMARY
89-
echo "| Trigger | ${{ github.event_name }} |" >> $GITHUB_STEP_SUMMARY
89+
echo "| Audio | gTTS narration |" >> $GITHUB_STEP_SUMMARY
90+
echo "| Render | ${{ needs.render-video.result }} |" >> $GITHUB_STEP_SUMMARY

promo/generate_audio.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Generate narration audio using Google Text-to-Speech."""
2+
from gtts import gTTS
3+
4+
NARRATION = (
5+
"Introducing eOffice. A complete open-source productivity suite. Feature one: Document editor with rich formatting and collaboration. Feature two: Spreadsheet engine with formulas, charts, and data analysis. Feature three: Presentation builder with templates and animations. eOffice. Open source and fully featured. Visit github dot com slash embeddedos-org slash eOffice."
6+
)
7+
8+
tts = gTTS(text=NARRATION, lang="en", slow=False)
9+
tts.save("narration.mp3")
10+
print(f"Generated narration.mp3 ({len(NARRATION)} chars)")

0 commit comments

Comments
 (0)