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 run it.

Accepted arguments:

-m Absolute path to the MP4 video

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

cli.ini contains all the complete parameters. The first parameter, source_mp4, represents the video to be processed. If the command line passes a value through -m, the command-line parameter is used; otherwise, source_mp4 is used from the ini file.

-c Absolute path to the configuration file

You can also copy cli.ini to another location and specify the configuration file to use on the command line using -c absolute path to cli.ini, 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 simply indicates that CUDA acceleration should be enabled (if available). python cli.py -cuda

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

Specific Parameters and Descriptions in cli.ini


; Command-line arguments
; Absolute address of the video to be processed, with forward slashes as path separators. Can also be passed in the command-line parameter after -m
source_mp4=
; Network proxy address, required for official google chatGPT in China
proxy=
; Output result files to directory
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 of the soft subtitles during embedding.  Do not fill in.
subtitle_language=
; true = Enable CUDA
cuda=false
; Role name. For openaiTTS, role names are "alloy,echo,fable,onyx,nova,shimmer". For edgeTTS, find the role name in voice_list.json corresponding to the language. For elevenlabsTTS, find the role name in elevenlabs.json.
voice_role=en-CA-ClaraNeural
; Dubbing speed value. Must start with a + or - sign. + represents acceleration, - represents deceleration, ending with %.
voice_rate=+0%
; Optional TTS engines: edgetTTS openaiTTS elevenlabsTTS
tts_type=edgeTTS
; Silence duration between voice segments, in ms
voice_silence=500
; Whether to keep background music. true = yes, very slow
is_separate=false
; all = overall recognition, split = pre-segment voice clips and then recognize
whisper_type=all
; Speech recognition model options: base small medium large-v3
whisper_model=base
model_type=faster
; Translation channels: google baidu chatGPT Azure Gemini tencent DeepL DeepLX
translate_type=google
; 0 = no subtitles, 1 = embed hard subtitles, 2 = embed soft subtitles
subtitle_type=1
; true = automatic dubbing speed
voice_autorate=false

; deepl translation interface address
deepl_authkey=asdgasg
; Interface address of 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 interface address, ending with /v1.  Can fill in a third-party interface address.
chatgpt_api=
; chatGPT key
chatgpt_key=
; chatGPT model options: gpt-3.5-turbo gpt-4
chatgpt_model=gpt-3.5-turbo
; Azure API interface 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