Skip to content

Instantly share code, notes, and snippets.

@JonnyBurger
Created March 28, 2025 10:11
Show Gist options
  • Save JonnyBurger/e8b638f08d712dd38740b3cb8f5de5f1 to your computer and use it in GitHub Desktop.
Save JonnyBurger/e8b638f08d712dd38740b3cb8f5de5f1 to your computer and use it in GitHub Desktop.
Video rendering issue with Remotion on Lambda.

rohitt24k - 3/27/2025, 1:27:33 PM

Hey guys, i am trying to render a video using remotion on lyambda but i am facing some issue related to

errro ----------- An error occurred on chunk 0: Error A delayRender() "Loading

even though other network components like images and audios are properly loading this is the testing composition i am using

import { Video } from 'remotion';

const P0Composition: React.FC = () => { return (

); };

export default P0Composition;

is there anything that i am missing? please help πŸ™

rohitt24k - 3/27/2025, 2:48:12 PM

i was able to solve this using the OffthreadVideo Component and now it works file but i want to loop the video so i used the LoopedOffthreadVideo Component now the rendering stops after 80% or 90% is done.

rohitt24k - 3/27/2025, 3:26:31 PM

still getting the same error

An error occurred on chunk 10: Error A delayRender() was called but not cleared after 28000ms. See https://remotion.dev/docs/timeout for help.

at node_modules/remotion/dist/esm/index.mjs:1535 1533 β”‚ const handle = Math.random(); 1534 β”‚ handles.push(handle); 1535 β”‚ const called = Error().stack?.replace(/^Error/g, "") ?? ""; 1536 β”‚ if (getRemotionEnvironment().isRendering) { 1537 β”‚ const timeoutToUse = (options?.timeoutInMilliseconds ?? (typeof window === "undefined" ? defaultTimeout : window.remotion_puppeteerTimeout ?? defaultTimeout)) - 2000; 1538 β”‚ if (typeof window !== "undefined") {

at src/remotion/utils/LoopableOffthreadVideo.tsx:15 13 β”‚ const LoopedOffthreadVideo: React.FC = (props) => { 14 β”‚ const [duration, setDuration] = useState<number | null>(null); 15 β”‚ const [handle] = useState(() => delayRender()); 16 β”‚ const { fps } = useVideoConfig(); 17 β”‚

rohitt24k - 3/27/2025, 3:27:24 PM

if the video is long enough and doesn't need to loop then its fine but if the video is short and needs to loop i am facing the delayRender issue

jonnyburger - 3/28/2025, 9:24:43 AM

first step: make sure you have added this continueRender(), https://github.com/remotion-dev/remotion/blob/9c34f7475255344450c7a2c32da77cfd6204238c/packages/example/src/LoopedOffthreadVideo.tsx#L40 we have updated the snippet recently

if that still doesn't work, can you send the video that you want to loop? https://remotion.dev/report please also mention the remotion version

jonnyburger - 3/28/2025, 9:25:12 AM

ah I see you already posted it

jonnyburger - 3/28/2025, 9:27:05 AM

I think you run into pexels rate limiting πŸ™ƒ if you request the video a lot from the same IP, they are heavily throttling, we see it a lot on pexels videos

consider re-hosting that pexels video yourself

Technical Note: Rendering Issues with LoopedOffthreadVideo in Remotion

Problem

Users are encountering the following error when rendering a video using the <LoopedOffthreadVideo /> component in Remotion:

An error occurred on chunk X:
Error A delayRender() was called but not cleared after 28000ms. See https://remotion.dev/docs/timeout for help.

This issue is often exacerbated when using short videos that need to loop, leading to complications during rendering.

Reasons

  1. The video may hit rate limits set by the video hosting service, such as Pexels, causing delays in rendering due to throttling.
  2. The absence of the continueRender() call in your code, which is necessary for handling video loading in looping scenarios.

Solution

  1. Ensure to include continueRender(): Add the continueRender() function to your LoopedOffthreadVideo implementation as demonstrated in the Remotion example.

  2. Re-host the video: Consider downloading the video from Pexels and re-hosting it on a separate server to avoid rate limiting issues.

  3. Provide Video Details: If the problem persists, you may need to provide additional details such as the video file and the version of Remotion being used for further troubleshooting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment