Skip to content

Commit 8c9d164

Browse files
committed
feat: add TTS narration + single combined promo video
1 parent cd20d0e commit 8c9d164

2 files changed

Lines changed: 32 additions & 21 deletions

File tree

.github/workflows/video-build.yml

Lines changed: 22 additions & 21 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 eIPC_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+
eIPC_v1.0_promo.mp4
57+
echo "Final video:"
58+
ls -lh eIPC_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: eIPC-promo-video
64+
path: promo/eIPC_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/eIPC_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 | eIPC |" >> $GITHUB_STEP_SUMMARY
89+
echo "| Audio | gTTS narration |" >> $GITHUB_STEP_SUMMARY
8890
echo "| Render | ${{ needs.render-video.result }} |" >> $GITHUB_STEP_SUMMARY
89-
echo "| Trigger | ${{ github.event_name }} |" >> $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 eIPC. Embedded inter-process communication done right. Feature one: Shared memory channels deliver microsecond latency between processes. Feature two: Zero-copy message passing eliminates data duplication overhead. Feature three: Cross-platform portability runs on Linux, RTOS, and bare metal. eIPC. Open source and lightning fast. Visit github dot com slash embeddedos-org slash eIPC."
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)