LENGTH TEST · UPDATED 29 NOVEMBER 2026

SadTalker Max Video LengthHow long a clip can be, and how to make long videos by splitting the audio

We rendered the same photo with 10-second to 2-minute audio on a free Colab T4 (15 GB) and measured GPU memory, RAM and render time for each length. We also tested the commands to split a 2-minute voice track and join the clips back into one video.

On this page

01 / QUICK ANSWER

Is there a maximum video length?

No fixed limit. SadTalker has no length setting; the limit is memory. It keeps every frame of the clip on the GPU until rendering ends, then copies the frames to system RAM, so longer audio needs more of both. 512 px needs about four times more per second than 256 px.

In our test on a 15 GB T4: a 120-second clip at 256 px worked but used 7.6 GB of GPU memory and 9.9 GB of RAM, close to what a free Colab machine has. A 30-second clip at 512 px already needed 11.3 GB of GPU memory. For anything over about 30 seconds, split the audio, render the chunks and join them: memory stays at the 30-second level, and you can redo one bad chunk instead of the whole video.

02 / ORIGINAL TEST

Length test on a T4

Same photo (SadTalker’s people_0.png example), English speech built from SadTalker’s own example clips, --preprocess crop, batch size 2, no enhancer, still mode off. One fresh process per run, so times include model loading.

On a small screen, swipe the table sideways.

Google Colab Tesla T4, 15360 MiB
Size · audio lengthResultTimeGPU memory usedPeak RAM
256 px · 10 sOK1 min 47 s2.9 GB3.5 GB
256 px · 30 sOK4 min 12 s3.9 GB4.6 GB
256 px · 60 sOK8 min 17 s5.1 GB6.4 GB
256 px · 120 sOK16 min 25 s7.6 GB9.9 GB
512 px · 10 sOK5 min 19 s8.6 GB5.2 GB
512 px · 30 sOK15 min 26 s11.3 GB9.9 GB

GPU memory is the peak above the idle baseline, sampled every 0.5 s with nvidia-smi. Peak RAM is the maximum resident memory of the SadTalker process. One run each on a shared free GPU. Raw numbers: results.json.

Colab output lines for each SadTalker length test run
Raw output from our Colab T4 notebook, one line per run.
  • Render time grows in a straight line: about 8 s of rendering per second of audio at 256 px and 30 s at 512 px on the T4.
  • GPU memory grows too: about 43 MB per second of audio at 256 px and 139 MB at 512 px, on top of 2.6 GB and 7.2 GB to start.
  • RAM grows fastest: about 60 MB per second at 256 px and 238 MB at 512 px.

Not run: 512 px at 60 s (we stopped it before it finished). We tested the split and join commands locally with ffmpeg, not on the GPU.

03 / WHY

Why longer clips need more GPU memory

The face renderer loops over every frame, appends each result to a list that stays on the GPU, and stacks the whole list into one tensor at the end. Until the clip finishes, nothing is released.

SadTalker make_animation code: frames appended on the GPU and stacked at the end
From src/facerender/modules/make_animation.py in the official repository.
  • Per frame: one 256 × 256 frame is 0.75 MB on the GPU; a 512 × 512 frame is 3 MB. At 25 frames per second that is about 19 MB per second of audio at 256 and 75 MB per second at 512, and the final stack briefly doubles it.
  • Measured slope: at 256 px our runs grew by about 43 MB of GPU memory per second of audio; at 512 px, about 139 MB per second.
  • System RAM: the rendered frames are then copied to RAM. With GFPGAN on, the enhancer first loads every frame of the video into RAM, so long clips with the enhancer can fill a 12 GB Colab machine.

04 / LIMITS

Rough max length by GPU memory

On a small screen, swipe the table sideways.

Estimated from a straight line through our T4 runs, using 90% of the card
GPU memory256 px, one render512 px, one renderUse chunks of
8 GB~1 min 51 sNot even 10 s20–30 s at 256 px
12 GB~3 min 16 s~26 s30 s (15 s at 512)
15 GB (Colab T4)~4 min 20 s~46 s30 s
24 GB~7 min 33 s~1 min 46 s30–60 s
On free Colab, RAM runs out first. With about 12.7 GB of system RAM, our measured RAM growth reaches the limit at about 2 min 48 s at 256 px and 42 s at 512 px, earlier than the T4’s GPU memory. Plan on 30-second chunks there.

Estimated from a straight line through our measured runs, using 90% of the card; 512 px uses only two points. Other programs, drivers and settings change the numbers. If you hit CUDA out of memory, use shorter chunks or 256 px.

05 / STEP 1

Split the audio into chunks

Cut at pauses, not at fixed times. A fixed cut can land in the middle of a word and leaves a tiny last chunk: our 120.06-second file split every 30 seconds left a 0.06-second fifth chunk.

Best: cut at pauses (our script)

python split_on_pauses.py voice.wav 30

Download split_on_pauses.py. It finds pauses with ffmpeg’s silencedetect and cuts at the pause nearest every 30 seconds. On our 2-minute test file it produced chunks of 30.54, 38.24, 30.58, 20.7 seconds, every cut in a pause.

Quick: fixed 30-second chunks

ffmpeg -i voice.wav -ar 16000 -ac 1 -f segment -segment_time 30 chunk_%03d.wav

Check the last chunk; if it is under a second long, merge it into the previous one or pick a different chunk length.

06 / STEP 2

Render each chunk with the same settings

for c in chunk_*.wav; do
  python inference.py --driven_audio "$c" --source_image face.png \
    --result_dir "results/${c%.wav}" --size 256 --preprocess crop --still
done
  • Keep the same photo, --size, --preprocess, --pose_style, --expression_scale and --enhancer for every chunk.
  • Time stays about the same: render time grows in a straight line with length, so four 30-second chunks take about as long as one 2-minute render (4 min 12 s × 4 vs 16 min 25 s in our T4 test), but peak GPU memory stays at the 30-second level (3.9 GB instead of 7.6 GB) and RAM at 4.6 GB instead of 9.9 GB.

07 / STEP 3

Stitch the clips into one video

ls results/chunk_*/*.mp4 | sort | sed "s/.*/file '&'/" > parts.txt
ffmpeg -f concat -safe 0 -i parts.txt -c copy long_video.mp4

All chunks share SadTalker’s output format (H.264 at 25 fps, 16 kHz AAC), so -c copy joins them without re-encoding.

Our test: we split a 120.06-second track into 4 chunks, made one clip per chunk in SadTalker’s exact output format (H.264 25 fps + AAC 16 kHz mono, frames = floor(seconds x 25) as SadTalker writes them), and joined them. The result had 2,999 frames, 119.96 s of video and 120.02 s of audio, so sound and picture stay in sync. Each chunk can lose up to 0.04 s at its end, because SadTalker rounds down to whole frames.

08 / CONSISTENCY

Keep pose and identity consistent across chunks

SadTalker audio2pose code: random head motion every 32 frames, starting from the photo’s pose
From src/audio2pose_models/audio2pose.py in the official repository.
  • Use --still: it copies the photo’s head pose into every frame, so every chunk ends and starts in the same position and the joins are clean.
  • Without still mode: head motion is random, redrawn every 32 frames with no seed, so each chunk moves differently. Every chunk starts from the photo’s pose, so expect a small jump back at each join.
  • About --ref_pose: it adds a reference video’s head movement on top of SadTalker’s own random motion, and each chunk replays that video from its first frame. It does not make chunks match, and still mode overrides it. For clean joins, use --still.
  • Identity: always use the exact same image file. Re-cropping or re-exporting the photo between chunks changes the face slightly.
  • Cut in pauses: the mouth is closed at a pause, so the join is hard to see.

09 / QUICK HELP

Frequently asked questions

What is the maximum video length in SadTalker?

There is no length setting or hard cap in the code. The limit is memory: SadTalker keeps every rendered frame on the GPU until the clip finishes, then copies them to RAM. On a free Colab T4 a 2-minute clip at 256 px worked but used 7.6 GB of GPU memory and 9.9 GB of RAM; we estimate RAM runs out at about 2 min 48 s at 256 px and about 42 s at 512 px.

How do I make a long video with SadTalker?

Split the audio into 20–40 second chunks at pauses, render each chunk with the same photo and settings (still mode keeps the head steady), then join the MP4 files with ffmpeg’s concat demuxer and -c copy. In our ffmpeg test of a 2-minute track, the joined video stayed in sync.

Why does SadTalker run out of memory on long audio?

In the face renderer, each generated frame is appended to a list on the GPU, and the whole list is stacked into one tensor at the end, which briefly needs a second copy. Longer audio means more frames held at once. 512 px frames are four times larger than 256 px frames.

Does still mode help with long videos?

It does not lower memory, but it makes chunks join cleanly. Still mode copies the photo’s head pose into every frame, so each chunk ends and starts in the same position. Without it, SadTalker draws new random head motion for every chunk.

How long can audio be on the Hugging Face demo?

Free public Spaces are shared and slow; one Space we tested recommends no more than 30 seconds. For anything longer, use Google Colab or your own GPU and the split-and-stitch method on this page.

Why did my long video crash on Google Colab?

Usually system RAM, not the GPU. In our test a 2-minute clip at 256 px used 9.9 GB of RAM, and a 30-second clip at 512 px used 9.9 GB, close to the roughly 12.7 GB a free Colab machine has. Split the audio into 30-second chunks.

Does GFPGAN make long videos harder?

Yes, on RAM. The enhancer loads every frame of the rendered video into system memory before it starts, and it adds a lot of time. For long videos, render without it first and enhance only the final cut if you need to.

SOURCES