Skip to content

CLI Command Line Mode

Open In Colab

cli.py is the command-line execution script. python cli.py is the simplest way to execute it.

Accepted parameters:

-m Absolute path of the MP4 video

Specific configuration parameters can be set in cli.ini located in the same directory as cli.py. Other MP4 video addresses to be processed can also be configured via the command-line parameter -m absolute path of the MP4 video, for example, python cli.py -m D:/1.mp4.

cli.ini contains complete parameters. The first parameter source_mp4 represents the video to be processed. If the command line passes the parameter via -m, the command-line parameter will be used; otherwise, source_mp4 will be used.

-c Configuration file address

You can also copy cli.ini to another location and specify the configuration file to use via -c absolute path of cli.ini on the command line, for example, python cli.py -c E:/conf/cli.ini. This will use the configuration information in that file and ignore the configuration file in the project directory.

-cuda does not require a value. Adding it indicates that CUDA acceleration is enabled (if available). python cli.py -cuda

Example: python cli.py -cuda -m D:/1.mp4

Specific Parameters and Explanations in cli.ini


;Command-line parameters
;Absolute path of the video to be processed, use forward slashes as path separators. Can also be passed via the -m parameter on the command line.
source_mp4=
;Network proxy address, required for Google ChatGPT official in China
proxy=
;Directory to output the result files to
target_dir=
;Video pronunciation language, choose from here: zh-cn zh-tw en fr de ja ko ru es th it pt vi ar tr
source_language=zh-cn
;Speech recognition language, no need to fill in
detect_language=
;Language to translate to: zh-cn zh-tw en fr de ja ko ru es th it pt vi ar tr
target_language=en
;Language for soft subtitle embedding, leave blank if not needed
subtitle_language=
;true=Enable CUDA
cuda=false
;Role name, openaiTTS role names are "alloy, echo, fable, onyx, nova, shimmer", edgeTTS role names can be found in voice_list.json corresponding to the language. elevenlabsTTS role names can be found in elevenlabs.json.
voice_role=en-CA-ClaraNeural
;Voice speed value, must start with + or -, + represents acceleration, - represents deceleration, ending with %
voice_rate=+0%
;Optional: edgeTTS openaiTTS elevenlabsTTS
tts_type=edgeTTS
;Silent segment, in ms
voice_silence=500
;Whether to keep the background music, true=yes, very slow
is_separate=false
;all=Recognize as a whole, split=Recognize after pre-splitting the sound segments
whisper_type=all
;Speech recognition model options: base small medium large-v3
whisper_model=base
model_type=faster
;Translation channel options: google baidu chatGPT Azure Gemini tencent DeepL DeepLX
translate_type=google
;0=Do not embed subtitles, 1=Embed hard subtitles, 2=Embed soft subtitles
subtitle_type=1
;true=Automatic voice acceleration
voice_autorate=false

;API address for deepl translation
deepl_authkey=asdgasg
;API address for your own configured deeplx service
deeplx_address=http://127.0.0.1:1188
;Tencent translation ID
tencent_SecretId=
;Tencent translation key
tencent_SecretKey=
;Baidu translation ID
baidu_appid=
;Baidu translation secret key
baidu_miyue=
;elevenlabstts key
elevenlabstts_key=
;ChatGPT API address, ending with /v1, can fill in a third-party API address
chatgpt_api=
;ChatGPT key
chatgpt_key=
;ChatGPT model, options: gpt-3.5-turbo gpt-4
chatgpt_model=gpt-3.5-turbo
;Azure API address
azure_api=
;Azure key
azure_key=
;Azure model name, options: gpt-3.5-turbo gpt-4
azure_model=gpt-3.5-turbo
openaitts_role=alloy,echo,fable,onyx,nova,shimmer

gemini_key=
gemini_template=

clone_api=
ttsapi_url=
ttsapi_voice_role=
ttsapi_extra=pyvideotrans

trans_api_url=
trans_secret=

gptsovits_url=
gptsovits_role=
gptsovits_extra=pyvideotrans
;google Gemini key
gemini_key=
back_audio=
only_video=
auto_ajust=false