JSON2Video uses OpenAI's Whisper to transcribe the audio and generate subtitles for you, supporting a wide variety of languages and accents.
The subtitle element
The subtitle element is a bit different from the other elements. It's processed always once the scene or the movie is rendered to make sure it captures and transcribes the audio correctly.
You can add a subtitle element to any scene or movie:
- In case you add it to a scene, the subtitles will be created for the scene only, and other scenes in the movie may not have subtitles.
- In case you add it to a movie, the subtitles will be created for the full movie.
- If you add the subtitle element to a scene and to the movie at the same time, the subtitles will be overlapped on top of each other, so try to avoid this.
The subtitle element has the following format:
language
The language
property defines the expected language of the voice-over. It defaults to "en" (English).
Other posible values are:
es
: Spanishfr
: Frenchde
: Germanit
: Italianja
: Japaneseko
: Koreanca
: Catalanpt-BR
: Brazilian Portuguese
Check the supported languages in the API specification.
Settings object
The settings
object allows you to customize the style of the subtitles using the following properties:
style
The style of the subtitle element. Styles are like presets of settings to start with that you can customize further using the settings
object.
The default style is classic
. These are the available styles:
font-family
Sets the font family of the subtitle text. There is a short list of fonts to choose from:
If you need any additional fonts, please let us know.
font-size
Sets the font size of the subtitle text. Defaults to a 10% of the video resolution.
max-words-per-line
Sets the maximum number of words per line. Defaults to 4. If you set it to 1, the subtitle will display just one word at once.
position
Sets the subtitle position on the video. Defaults to bottom-center
.
word-color, line-color
Sets the color of the subtitle text. The word-color
refers to the color of the word that is being spoken and
the line-color
refers to the rest of the text.
Setting different values to word-color
and line-color
makes the spoken word to be highlighted.
Setting these properties to the same value makes the whole line of text to look the same color.
Colors can be set in hexadecimal format like #00B140
, but can also include alpha (opacity) values, like #00B14008
.
outline-width, outline-color
Some styles support an outline (classic styles, for example).
outline-width
sets the width of the outline, that can be set to 0 to disable the outline.
outline-color
sets the color of the outline.
box-color
A few styles, instead of outline, support a box around the text. This property sets the color of the box framing the subtitle.
Again, like all color properties, it must be in hexadecimal format like #00B140
, but can also include alpha (opacity) values, like #00B14008
.
shadow-color, shadow-offset
Some styles support a shadow. These properties set the color of the shadow, and the offset of the shadow.