Discussions
`fit` parameter ignored for video backgrounds in /v2/video/generate
The fit parameter on video backgrounds is being ignored in the Create Avatar Video V2
API (POST /v2/video/generate). A landscape video used as background in a 720×1280
(portrait) video is always cropped/zoomed to fill the frame, regardless of the fit
value. This was working correctly last week.
Steps to Reproduce
Run the following curl (API key redacted):
curl -X POST 'https://api.heygen.com/v2/video/generate'
-H 'x-api-key: '
-H 'Content-Type: application/json'
-d '{"caption":false,"title":"fit-test","dimension":{"width":720,"height":1280},"video_i
nputs":[{"voice":{"type":"silence","duration":23},"background":{"type":"video","url":"http
s://coursefiles.quix.work/programacion-dinamica-765/module-03/scene-bg-video_fe8af3f8-91df
-49b5-be88-ebe54b701dc0_1772715583860.mp4","fit":"contain","play_style":"once"}}]}'
Expected Behavior
With "fit": "contain", the horizontal video should be letterboxed — scaled to fit inside
the 720×1280 frame with black bars on top and bottom, preserving aspect ratio.
Actual Behavior
The video is cropped/zoomed to fill the entire frame, cutting off left and right edges.
Tested all four values (contain, cover, crop, none) — all produce the same cropped
result.
Video ID
48aeabb0698e468b9dc635c9af7c5e45 — generated with "fit": "contain" but video is
cropped.
Additional Question
Is there a way to preserve the original video's audio when using a video background?
Currently the audio track from the background video is not included in the output.
This was de production curl used
curl -X POST 'https://api.heygen.com/v2/video/generate'
-H 'x-api-key: <API_KEY>'
-H 'Content-Type: application/json'
-d '{"caption":false,"title":"AAA","callback":"completed
message","dimension":{"width":720,"height":1280},"video_inputs":[{"character":{"type":"tal
king_photo","talking_photo_id":"f25f57b4a4d3486e8dfe40dbab876233","scale":1.2,"offset":{"x
":0,"y":0}},"voice":{"type":"audio","audio_url":"https://audiogenerations.quix.work/progra
macion-dinamica-765/module-03/scene-01_1772715468712.mp3"}},{"voice":{"type":"silence","du
ration":23},"background":{"type":"video","url":"https://coursefiles.quix.work/programacion
-dinamica-765/module-03/scene-bg-video_fe8af3f8-91df-49b5-be88-ebe54b701dc0_1772715583860.
mp4","fit":"contain","play_style":"once"}},{"character":{"type":"talking_photo","talking_p
hoto_id":"f25f57b4a4d3486e8dfe40dbab876233","talking_photo_style":"circle","offset":{"x":-
0.38,"y":0.43},"scale":0.2},"voice":{"type":"audio","audio_url":"https://audiogenerations.
quix.work/programacion-dinamica-765/module-03/scene-03_1772715468712.mp3"},"background":{"
type":"image","url":"https://pub-cd6f1ca12bfb493bb4b6e6c8317c35a0.r2.dev/programacion-dina
mica-765/Fp55dQQVTwes-bffcb1ba-720e-4f56-8cf8-a2fe118dd7e2.png","fit":"crop"}},{"character
":{"type":"talking_photo","talking_photo_id":"f25f57b4a4d3486e8dfe40dbab876233","scale":1.
2,"offset":{"x":0,"y":0}},"voice":{"type":"audio","audio_url":"https://audiogenerations.qu
ix.work/programacion-dinamica-765/module-03/scene-04_1772715468783.mp3"}}]}'