remotion-dev / remotion

🎥 Make videos programmatically with React
https://remotion.dev
Other
19.61k stars 956 forks source link

Issue with offthreadvideo extracting frames on lambda with preflight request differences. #3865

Closed JonnyBurger closed 1 month ago

JonnyBurger commented 1 month ago

From message posted on Discord by jonnyburger

hmm, thanks for posting! that seems problematic actually, something that might have gone under my radar and might have just surfaced it

offthreadvideo should not try to extract frames when there is a preflight request normally there is no preflight request except when the domains differ

but I just realized that on lambda this is different the website is hosted on S3 but the asset is proxied through localhost

I'll file that! currently I am a bit slower because I am going to react conf but I'm trying to get it this fixed in a new update soon

did you delete the original message? I cannot read it anymore 🤔

tsejerome commented 1 month ago

In my situation, sometimes the video gets generated but sometimes it doesn't. My guess is the RAM usage.

IDK if this helps but these are my below configs -

Bundle: https://remotionlambda-d5o59m07tl.s3.ap-southeast-1.amazonaws.com/sites/video-staging/index.html

InputProps example (let me know if you need more):

 {
    "created_at": "2024-05-12T13:14:18.357Z",
    "id": "7tSi1uUWgHzz6eiiawjdSA",
    "author_id": "cIqVZ0PDqrXLYvhdY7zKMpKSayD2",
    "video_title": "Atelier Autohypnose",
    "duration": 104.559456,
    "file_size_in_MB": 3.25,
    "subtitle_status": "generated",
    "last_updated": "2024-05-12T13:15:39.229Z",
    "url": "https://remotionlambda-d5o59m07tl.s3.ap-southeast-1.amazonaws.com/renders/4m7q2g2vmy/out.mp4",
    "is_debian": true,
    "assets": [
      {
        "t": "103.88",
        "f": 102.62,
        "original_keyword": "reunion",
        "offset_time": 0,
        "id": "twKVHUy7JTfFrVJY8Km4wz",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/3198251/3198251-sd_240_426_25fps.mp4"
      },
      {
        "t": "101.84",
        "f": 94.6,
        "original_keyword": "registration link, website",
        "offset_time": 0,
        "id": "gfqzYeSFeLq4xrWgXeuBRA",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/5585988/5585988-sd_540_960_30fps.mp4"
      },
      {
        "t": "93.6",
        "f": "89.54",
        "manual_keyword": "headphones",
        "original_keyword": "guided meditation, quality",
        "offset_time": 0,
        "id": "kRBfNMPWBuCkV61iof5yeY",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/6689313/6689313-hd_720_1280_25fps.mp4"
      },
      {
        "t": "88.67",
        "f": 87.67,
        "original_keyword": "training, 7 hours",
        "offset_time": 0,
        "id": "5V5TJ18izaNFbmBvpQnAJB",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/8322053/8322053-sd_226_426_25fps.mp4"
      },
      {
        "t": "87.67",
        "f": 85.11,
        "original_keyword": "online classes",
        "offset_time": 0,
        "id": "7TpeQAfaZMJ5gHjGfi7QUz",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/7189835/7189835-uhd_1440_2560_25fps.mp4"
      },
      {
        "t": "85.11",
        "manual_keyword": "online class",
        "f": "79.01",
        "original_keyword": "exclusive workshop, affordable price",
        "offset_time": 0,
        "id": "2WLs9P2GLp5uwZGD2B1ZGB",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/6986948/6986948-hd_1080_1920_25fps.mp4"
      },
      {
        "t": "78.33",
        "f": 71.75,
        "original_keyword": "online workshop, self-hypnosis",
        "offset_time": 0,
        "id": "5WKDVoyddeXYFYd79d7Qsm",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/4873106/4873106-sd_240_426_25fps.mp4"
      },
      {
        "t": "71.35",
        "manual_keyword": "meditation",
        "f": "66.17",
        "original_keyword": "open-mindedness, invitation",
        "offset_time": 0,
        "id": "j6d7nxGvE3xYk9VsrcRwCC",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/6019741/6019741-hd_720_1280_25fps.mp4"
      },
      {
        "t": "65.35",
        "f": "61.39",
        "manual_keyword": "child reading",
        "original_keyword": "curiosity, spiritual journey",
        "offset_time": 0,
        "id": "ephQbQiwrr2Vr42JEANUvJ",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/3677121/3677121-hd_720_1366_50fps.mp4"
      },
      {
        "t": "59.65",
        "f": 57.05,
        "original_keyword": "learning, activation",
        "offset_time": 0,
        "id": "n6sMXHrkQCWucC7JAGQJNc",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/6943342/6943342-uhd_1440_2560_30fps.mp4"
      },
      {
        "t": "56.33",
        "f": 54.59,
        "original_keyword": "inner potential",
        "offset_time": 0,
        "id": "5DtYeprDwnEr5MiT3Py5xC",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/5389090/5389090-sd_506_960_30fps.mp4"
      },
      {
        "t": "53.07",
        "f": "48.83",
        "manual_keyword": "machinery",
        "original_keyword": "simplicity",
        "offset_time": 0,
        "id": "t6aAi3kuDgp9TDsriLzEJY",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/6498240/6498240-hd_720_1280_25fps.mp4"
      },
      {
        "t": "48.21",
        "f": "44.33",
        "manual_keyword": "imagination",
        "original_keyword": "imagination",
        "offset_time": 0,
        "id": "qVWkm9cC54KC9hwrr4Wa3C",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/5670460/5670460-hd_1080_1920_30fps.mp4"
      },
      {
        "t": "43.35",
        "f": "39.77",
        "manual_keyword": "spiritual guidance",
        "original_keyword": "spiritual guidance",
        "offset_time": 0,
        "id": "7v7P1QMMr7FHf4vxTzrSPd",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/5385957/5385957-hd_720_1366_25fps.mp4"
      },
      {
        "t": "38.71",
        "f": 36.29,
        "original_keyword": "pyramid construction in Egypt",
        "offset_time": 0,
        "id": "hKpARNBGBHyfL7nKWpBhAx",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/4205789/4205789-sd_540_722_30fps.mp4"
      },
      {
        "t": "34.9",
        "f": "29.62",
        "manual_keyword": "kid flying rocket",
        "original_keyword": "energy scanning",
        "offset_time": 0,
        "id": "aguyWdMDaBwCzMaMt1bjts",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/7106859/7106859-hd_720_1280_30fps.mp4"
      },
      {
        "t": "30.28",
        "manual_keyword": "x-ray",
        "f": "28.7",
        "original_keyword": "energy scanning",
        "offset_time": 0,
        "id": "dCtF8rnKusvrr5H4C9NfPp",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/5453582/5453582-hd_1080_1920_25fps.mp4"
      },
      {
        "t": "28.16",
        "manual_keyword": "universe",
        "f": "24.48",
        "original_keyword": "cellular exploration",
        "offset_time": 0,
        "id": "vNsCtgEvYCsRX29CQP7jKT",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/7649294/7649294-hd_1080_1920_30fps.mp4"
      },
      {
        "t": "23.12",
        "f": "19.16",
        "manual_keyword": "success",
        "original_keyword": "project development",
        "offset_time": 0,
        "id": "216hwTxV33dMCUMTC3u5vG",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/4065921/4065921-hd_720_1366_50fps.mp4"
      },
      {
        "t": "18.58",
        "manual_keyword": "woman walking road sun",
        "f": "15.02",
        "original_keyword": "exploration, future",
        "offset_time": 0,
        "id": "okVV5uLXq9wqkpf88z3K9G",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/8045821/8045821-hd_720_1280_25fps.mp4"
      },
      {
        "t": "14.54",
        "f": 12.24,
        "original_keyword": "knowledge, rediscovery",
        "offset_time": 0,
        "id": "ix7y7FK9eK4i4TVBnLHszw",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/4769627/4769627-uhd_1440_2732_25fps.mp4"
      },
      {
        "t": "11.38",
        "f": 7.06,
        "original_keyword": "past lives, liberation",
        "offset_time": 0,
        "id": "q6tnqPFhdxpqsvBZmWhR7T",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/6945035/6945035-sd_540_960_24fps.mp4"
      },
      {
        "t": "6.34",
        "f": "3.78",
        "manual_keyword": "sun field",
        "original_keyword": "time travel",
        "offset_time": 0,
        "id": "dPtRZY3pwxG1YdUWoJNkEy",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/4434150/4434150-hd_1080_1920_30fps.mp4"
      },
      {
        "t": "3.06",
        "f": "0",
        "original_keyword": "Saturday, June 15",
        "offset_time": 0,
        "id": "5juQvmVv3TDUW2z2H95FUw",
        "type": "video",
        "url": "https://videos.pexels.com/video-files/8128725/8128725-hd_720_834_60fps.mp4"
      },
      {
        "t": "104.559456",
        "f": "0",
        "id": "nMjTvtzTEvMDB6zCEuMAQZ",
        "type": "audio",
        "url": "https://jupitrr-ugc.s3-accelerate.amazonaws.com/cIqVZ0PDqrXLYvhdY7zKMpKSayD2/slideshow-7tSi1uUWgHzz6eiiawjdSA--nMjTvtzTEvMDB6zCEuMAQZ.m4a"
      }
    ],
    "preferences": {
      "positionY": 27,
      "dimensionType": "portrait",
      "fontFamily": "Lexend",
      "capitalization": false,
      "color": "#ffffff",
      "hidePromotion": true,
      "hideOnboarding": true,
      "primaryColor": "#ff9b62",
      "fontSize": 100,
      "wordLimit": 20,
      "animationColor": "#008DCB",
      "animation": "None"
    },
    "subtitlesContent":[]
  }
tsejerome commented 1 month ago

Please note that we didn't face this situation in lambda, but it happens in a ubuntu pm2 server, we are trying to have an instance of g4dn.xlarge, with 6GB ram within the pm2 (reserving the remaining RAM for basic operations like ls

tsejerome commented 1 month ago

Also attaching our error log and out log in case it is helpful

out-log link (too large so I put on google drive): https://drive.google.com/file/d/1Q-FJI5S27ug6NcK7kATZbMJ6qs3zEfQk/view?usp=sharing error-log link: remotion-debian-error-0.log

Attaching some screenshots that might be relevant -

image image
JonnyBurger commented 1 month ago

We'll still investigate the issue until the end, but I am closing the issue because OffthreadVideo doesn't have the problem as described in the title.

OffthreadVideo does reply to preflight requests correctly (if there are any) and immediately.

This issue is just the same as https://remotion-git-delay-render-proxy-docs-remotion.vercel.app/docs/troubleshooting/delay-render-proxy