Customizing AI Translation Prompts
pyVideoTrans lets you customize the prompts used for AI translation and LLM resegmentation to optimize translation results. This guide explains how to find and edit these prompt files.
1. Subtitle Translation Prompts
There are two different subtitle translation prompts, selected based on whether "Send Full SRT" is checked.
When "Send Full SRT" Is Checked
This prompt is used when the "Send Full SRT" checkbox is enabled.
Location: videotrans/prompts/srt/ directory
This folder contains prompt files for each channel, named by channel:
| Filename | Channel |
|---|---|
chatgpt.txt | OpenAI ChatGPT |
deepseek.txt | DeepSeek |
gemini.txt | Google Gemini |
zhipuai.txt | ZhipuAI |
xiaomi.txt | Xiaomi AI |
minimax.txt | MiniMax |
bailian.txt | Alibaba Bailian |
localllm.txt | Local LLM / Compatible AI |
This mode sends the complete SRT string (line numbers, timestamps, and subtitle text) to the AI model, expecting a valid SRT response in return.
Important: Variables wrapped in curly braces, such as {lang} and {batch_input}, are automatically replaced by the program. Do not modify or delete them.
Line-by-Line Translation Prompt (When "Send Full SRT" Is Unchecked)
This prompt is used when "Send Full SRT" is unchecked.
Location: videotrans/prompts/text/ directory, e.g., deepseek.txt
This folder also contains prompt files for each channel, with the same structure as the srt/ directory.
Important: Variables wrapped in curly braces, such as {lang}, are automatically replaced by the program. Do not modify or delete them.
2. LLM Resegmentation Prompt
AI models can re-segment speech recognition results to fix typos, trim overly long subtitle lines, and more.
Location: videotrans/prompts/recharge/recharge-llm.txt
If LLM Resegment is enabled and STT again (secondary recognition) is checked, the secondary recognition results will also be processed with LLM resegmentation. The prompt is located at videotrans/prompts/recharge/recharge-llm2.txt.
When you select LLM Resegment from the "Default Segmentation" dropdown, the transcription results and this prompt are sent together to the AI model for subtitle restructuring. Two channels support LLM resegmentation: DeepSeek and OpenAI ChatGPT & Compatible AI. You can switch between them in Menu > Tools/Options(T) > More Settings... > General. The default is OpenAI ChatGPT & Compatible AI.
Note: Do not use
LLM Resegmentwhen using aclonedubbing voice (cloning mode), as it alters the timeline and prevents accurate reference audio slicing.
3. Speech Recognition Prompt
Custom prompts are also supported during speech recognition, primarily for Gemini and similar models.
Location: videotrans/prompts/recogn/gemini_recogn.txt
4. Quick Reference
| Scenario | File to Edit |
|---|---|
| AI translation results are poor (Full SRT mode) | videotrans/prompts/srt/<channel>.txt |
| AI translation results are poor (Line-by-line mode) | videotrans/prompts/text/<channel>.txt |
| LLM resegmentation quality is poor | videotrans/prompts/recharge/recharge-llm.txt |
| Post-recognition resegmentation quality is poor | videotrans/prompts/recharge/recharge-llm2.txt |
Important: Back up the original files before editing. Do not delete curly-brace variables like
{lang}or{batch_input}-- they are replaced with actual values at runtime.
Related Documents
- Improving AI Translation Subtitle Quality — Translation mode comparison and glossary usage
- Using Local LLMs as a Translation Channel — Local LLM configuration guide
- Customizing AI Translation Prompts — Custom translation prompts
- Recommended Settings for Best Video Translation — Optimal configuration for each stage
- Why "Blank Subtitle Lines" Appear After Translation
