#9044 Audio/Video Speed Sync Stage An Error Occurred argument out of rangeTraceback (most recent call last):

2402**9e8a Posted at: 13 hours ago

Audio/Video Speed Sync Stage An Error Occurred argument out of range
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 175, in run
File "videotrans\task\_stage_align.py", line 44, in align
File "videotrans\task\_rate.py", line 388, in run
File "videotrans\task\_rate.py", line 709, in _concat_audio_aligned
File "videotrans\task\_rate.py", line 762, in _create_silen_file
File "pydub\audio_segment.py", line 895, in export
File "wave.py", line 426, in writeframesraw
File "wave.py", line 467, in _ensure_header_written
File "wave.py", line 479, in _write_header
struct.error: argument out of range

trk=Translation V/A 单视频模式
Select Media File: C:/Users/PC/Downloads/Video/26352160274-1-192.mp4,
Output Directory: C:/video douyin/FDown.vn_douyin_downloader_9ebc-mp4/26352160274-1-192-mp4,
self.cfg.cache_folder='C:/win-pyvideotrans-v4.20/tmp/20012/0f27d6d1a5'
Selected Clear Output, Selected Enable accelerator
STT Service:faster-whisper(Built-in), large-v3-turbo, Spoken: Simplified Chinese
Max Speech Duration (s): 5s
Min Speech Duration (ms): 3000ms
Min Silence Duration for Split (ms): 600ms
VAD Speech Threshold: 0.45
VAD Engine: silero
Compute Type:default
Beam Size:5
Best Of:5
Condition on Previous Text:False
Repetition Penalty:1.0
Compression Ratio Threshold:2.4
TranslateSrt:Google Translate (Free),Spoken:Simplified Chinese,Target:Vietnamese
Traditional Translation Batch Size (Lines): 5
TTS Service:Edge-TTS (Free), Voices:HoaiMy(Female/VN), Target:Vietnamese
Volume:+0%, Speed:+0%, Selected TTS Speedup, Not-Selected Slow Video
Selected Trim Start/End Silence in Dubbed Segments
Silence Removal Intensity: default
Hard Subtitles
Max Line Length (CJK Characters):15, Max Line Length (Non-CJK):40
video duration:33791799ms
video information:{'video_fps': 30.0, 'r_frame_rate': 30.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 1280, 'height': 720, 'time': 33791799, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
self.cfg=TaskCfgVTT(uuid='0f27d6d1a5', name='C:/Users/PC/Downloads/Video/26352160274-1-192.mp4', dirname='C:/Users/PC/Downloads/Video', noextname='26352160274-1-192', basename='26352160274-1-192.mp4', ext='mp4', target_dir='C:/video douyin/FDown.vn_douyin_downloader_9ebc-mp4/26352160274-1-192-mp4', cache_folder='C:/win-pyvideotrans-v4.20/tmp/20012/0f27d6d1a5', is_cuda=True, source_language='Simplified Chinese', source_language_code='zh-cn', source_sub='C:/video douyin/FDown.vn_douyin_downloader_9ebc-mp4/26352160274-1-192-mp4/zh-cn.srt', source_wav='C:/win-pyvideotrans-v4.20/tmp/20012/0f27d6d1a5/zh-cn.wav', source_wav_output='C:/video douyin/FDown.vn_douyin_downloader_9ebc-mp4/26352160274-1-192-mp4/zh-cn.m4a', target_language='Vietnamese', target_language_code='vi', target_sub='C:/video douyin/FDown.vn_douyin_downloader_9ebc-mp4/26352160274-1-192-mp4/vi.srt', target_wav='C:/win-pyvideotrans-v4.20/tmp/20012/0f27d6d1a5/target.wav', target_wav_output='C:/video douyin/FDown.vn_douyin_downloader_9ebc-mp4/26352160274-1-192-mp4/vi.m4a', translate_type=0, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='HoaiMy(Female/VN)', voice_autorate=True, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, tts_model_name=None, detect_language='zh', recogn_type=0, model_name='large-v3-turbo', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=False, fix_punc=0, app_mode='biaozhun', subtitle_language=None, targetdir_mp4='C:/video douyin/FDown.vn_douyin_downloader_9ebc-mp4/26352160274-1-192-mp4/26352160274-1-192.mp4', novoice_mp4='C:/win-pyvideotrans-v4.20/tmp/20012/0f27d6d1a5/novoice.mp4', is_separate=False, embed_bgm=True, instrument='C:/win-pyvideotrans-v4.20/tmp/20012/0f27d6d1a5/instrument.wav', vocal='C:/win-pyvideotrans-v4.20/tmp/20012/0f27d6d1a5/vocal.wav', clear_cache=True, background_music='', subtitle_type=1, only_out_mp4=False, recogn2pass=False, output_srt=0, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.8, batch=False)
video_duration_ms=33791799


=
system:Windows-10-10.0.26200-SP0
version:v4.20
frozen:True
language:en_US
root_dir:C:/win-pyvideotrans-v4.20

1 Replies

#1 DeepSeek reply at 12 hours ago

The cause is not a network or model problem: in the A/V alignment stage the software had to generate a silence audio file of abnormal length, and that file exceeds the 4 GB / 32-bit size limit of the WAV format, so Python's wave module throws struct.error: argument out of range when writing the header (_create_silen_file → pydub.export → wave._write_header).

Note in your log: video duration:33791799ms and video_duration_ms=33791799, i.e. the video is being treated as ≈9.4 hours long. This abnormally large duration makes the final silence filler enormous and overflows the WAV header.

Handling steps:

  1. Check the real duration of 26352160274-1-192.mp4 (play it, or right-click → Properties). If it is actually only tens of seconds, the file's container duration is corrupted/misread. Remux it first: ffmpeg -i input.mp4 -c copy out.mp4 (or re-encode to standard H.264/AAC MP4), then import the new file.
  2. Rename the file to a short ASCII name (e.g. v1.mp4) and move it to a shallow path. Your current paths contain spaces (C:/Users/PC/Downloads/Video/, C:/video douyin/...); spaces and non-ASCII characters in paths/short names frequently cause abnormal parsing and FFmpeg errors. Use something like D:/videotrans/v1.mp4.
  3. Re-run with Clear Output checked (it is checked now, keep it), so the old cached clips/srt in tmp/ are discarded.
  4. If the video is genuinely several hours long, the generated silence file will still exceed the WAV limit — split it into shorter segments before translating.

If the same error occurs again after these steps, provide the last ~30 lines of the error in the latest logs/YYYYMMDD.log under the software directory.

Please refer to the related documentation:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource