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. Use this powerful video tool to automate your video processing tasks.

Accepted arguments:

-m Absolute path to the MP4 video

Specific configuration parameters can be set in cli.ini, located in the same directory as cli.py. Additional MP4 video addresses to be processed can also be configured via the command-line argument -m absolute path to the 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 a parameter is passed via the command line using -m, the command-line parameter is used; otherwise, the value from source_mp4 in the ini file is used.

-c Configuration file address

You can copy cli.ini to another location and specify the configuration file to use via the command line with -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 enables CUDA acceleration (if available). python cli.py -cuda

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

Specific Parameters and Explanations in cli.ini

ini
;Command-line parameters
;Absolute address of the video to be processed, use forward slashes as path separators. Can also be passed in the command line 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 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 subtitles, leave blank if not needed
subtitle_language=
;true=Enable CUDA
cuda=false
;Role name, openaiTTS role names "alloy,echo,fable,onyx,nova,shimmer", edgeTTS role names are found in voice_list.json corresponding to the language. elevenlabsTTS role names are found in elevenlabs.json
voice_role=en-CA-ClaraNeural
;Voice speed value, must start with + or -, + means speed up, - means slow down, ending with %
voice_rate=+0%
;Optional edgetTTS openaiTTS elevenlabsTTS
tts_type=edgeTTS
;Silence duration, unit ms
voice_silence=500
;Whether to keep the background music, true=yes, very slow
is_separate=false
;all=overall recognition, split=recognize after pre-splitting sound clips
whisper_type=all
;Speech recognition model options, base small medium large-v3
whisper_model=base
model_type=faster
;Translation channel, optional 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 voice speedup
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 key
baidu_miyue=
; elevenlabstts key
elevenlabstts_key=
;chatGPT interface address, ending with /v1, can fill in third-party interface address
chatgpt_api=
;chatGPT key
chatgpt_key=
;chatGPT model, optional 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, optional 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