Unexpected end of JSON input
axelv71 opened this issue · comments
Axel commented
Hello, I have a problem with the RenderMediaOnLambda, in fact, every time it returns the error : panic: unexpected end of JSON input
. I use remotion version 4.0.130 on my lambda. This is my code
My function:
func Render(renderOptions RenderOptions) (*lambda_go_sdk.RemotionRenderResponse, error) {
renderInputRequest := lambda_go_sdk.RemotionOptions{
ServeUrl: os.Getenv("REMOTION_APP_SERVE_URL"),
Codec: "h264",
Region: renderOptions.Region,
FunctionName: os.Getenv("REMOTION_APP_FUNCTION_NAME"),
Composition: "TRIM-COMP",
TimeoutInMilliseconds: 60000,
FrameRange: []int{renderOptions.Start, renderOptions.End},
InputProps: map[string]interface{}{
"videoUrl": renderOptions.VideoUrl,
"trimStart": renderOptions.Start,
"trimEnd": renderOptions.End,
"duration": renderOptions.Duration,
"fps": renderOptions.Fps,
},
DownloadBehavior: map[string]interface{}{
"type": "download",
"fileName": "video.mp4",
},
Webhook: map[string]interface{}{
"url": os.Getenv("CALLBACK_URL"),
"customData": map[string]interface{}{
"video_id": renderOptions.VideoId,
"video_url": renderOptions.VideoUrl,
"user_id": renderOptions.UserId,
"short_id": renderOptions.VideoReframeId,
},
"secret": nil,
},
}
_, renderError := lambda_go_sdk.RenderMediaOnLambda(renderInputRequest)
if renderError != nil {
return nil, renderError
}
return nil, nil
}
When I call it:
region := remotion.GetRegion()
renderOptions := remotion.RenderOptions{
Region: region,
Start: 0,
End: 120,
VideoId: 0,
VideoUrl: signedUrl,
VideoReframeId: 0,
Duration: 600,
Fps: 30,
UserId: 0,
}
res, err := remotion.Render(renderOptions)
if err != nil {
panic(err)
}
I don't understand, am I doing something wrong?
Axel commented
I've just looked at the lambda logs and the rendering is correct.
Jonny Burger commented
Axel commented
Thank you for your response, how will I be able to deploy the update?
Jonny Burger commented