Easily convert simple text files into full-fledged Beluga-style Discord conversation videos with a plethora of text formatting options, sound effects, and much more customisation for free within seconds!
example_video.mp4
Turn on sound to watch the full experience | View on YouTube
*script generated by ChatGPT, ignore the cringe*
- 🖼️ Automatic Message Rendering - Generate Discord-style message images from text
- 🔊 Sound Effect Integration - Add impact sounds and join notifications
- 🎞️ Video Compilation - Create seamless MP4 videos with proper timing
- 📝 Script Validation - Built-in script error checking
- 😎 Advanced Formatting Supports:
- Bold and italic text
- Emojis are supported
- Mention other characters (
@Character
) - Custom durations per message
- Create custom characters
- Roll colours for characters
- Python 3.9+
- FFmpeg (added to system PATH)
- Required Python packages:
pip install -r requirements.txt
-
Clone repository
git clone https://github.com/Binary-Bytes/Text-2-Beluga.git cd Text-2-Beluga
-
Install dependencies
pip install -r requirements.txt
-
Configure character settings
- Add profile pictures in
assets/profile_pictures/temp/
- Character details in
assets/profile_pictures/characters.json
- Add profile pictures in
Create a text file (.txt
) with a format as given below.
A sample chat script file (example_script.txt
) is provided in assets/example/
directory.
WELCOME Character$^Duration#!SoundEffect
Character:
Message Text$^Duration#!SoundEffect
Another Message$^Duration
-
Comments: Lines starting with
#
are ignored -
Join Messages:
WELCOME Character$^Duration#!SoundEffect
- Creates "User joined" image
-
Character Messages:
- Start with
Character:
- Subsequent lines are messages with format:
Message$^Duration[#!sound]
- Start with
-
Formatting:
- Bold:
**text**
- Italic:
__text__
- Combine:
__**text**__
- Mention:
@Character
- Emojis:
Emojis are supported in messages
- Durations:
$^
followed by duration in seconds (must be present at end of each message line, before sound effect, mandatory) - Sound Effects:
#!
followed by exact name (must be present at end of each message line, optional)
- Bold:
-
Sound Effects:
- Reference files in
assets/sounds/mp3/
- Format:
#!sound_name
(at end of message line, optional)
- Reference files in
-
Prepare your script file
-
Run
scripts/main.py
(command-line interface)python scripts/main.py
-
The following options will be presented:
- Generate Video: Generate the chat video
- Validate Script: Check for errors in the script file
(will be enhanced)
- Instructions: Read all the instructions for chat file syntax, or listen to all the sound effects available by default... to add a custom sound effect, add it's
.mp3
version inassets/sounds/mp3/
- Exit: Close the program
-
When "
Generate Video
" is selected, it will take a few seconds to generate the chat images inchat/
directory and compile them into a video with sound effects asfinal_video.mp4
in the root directory. -
The script validator majorly checks for the following errors in chat text file
(will be enhanced)
:- Missing duration markers (
$^
) - Invalid sound effect references
- Incorrect syntax
- Missing character name declaration
- Missing duration markers (
The sample video shown above was generated with Discord's own proprietary font (gg sans
), which is not available for public use. The default font used in this repository is Whitney
. You can replace this font with any other font of your choice in the assets/fonts/
directory with their appropriate bold
, medium
, semibold
, and italic
versions.
To use gg sans
, download the ggsans
folder and add it to the assets/fonts/
directory. Note that this font is not allowed for public use.
If you do use it, make sure to change the value of font
variable (line no. 58) in scripts/generate_chat.py
file to "ggsans"
.
Refer to the TODO list for upcoming features and improvements.
A Text-2-Beluga discord bot is my top priority as of now.