upload-r2

โดย remotion-dev

Upload large Remotion repository assets to the Cloudflare R2 bucket behind remotion.media and replace local public/ assets with hosted URLs. Use when a file is…

npx skills add https://github.com/remotion-dev/remotion --skill upload-r2

Upload R2 Asset

Use this for large media assets that should be hosted on https://remotion.media/ instead of committed to Git.

Do not use this skill for Remotion Element previews. Follow the submit-element or accept-element skill instead; the dedicated uploader runs from packages/docs and loads packages/docs/.env.

Workflow

  1. Find the main worktree:

    git worktree list --porcelain
    

    Prefer the worktree on refs/heads/main, usually /Users/jonathanburger/remotion.

  2. Load R2 credentials from the main worktree:

    --env-file=/Users/jonathanburger/remotion/packages/remotion-media/.env
    

    Do not print secret values. The required variables are AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

  3. Upload the file to the parser-media bucket using Bun's S3-compatible client:

    bun --env-file=/Users/jonathanburger/remotion/packages/remotion-media/.env -e "import {S3Client} from 'bun'; const filePath='<local-file>'; const key='<remote-file-name>'; const client=new S3Client({accessKeyId:Bun.env.AWS_ACCESS_KEY_ID, secretAccessKey:Bun.env.AWS_SECRET_ACCESS_KEY, endpoint:'https://2fe488b3b0f4deee223aef7464784c46.r2.cloudflarestorage.com', bucket:'parser-media'}); const file=Bun.file(filePath); if (await client.exists(key)) { const stat=await client.stat(key); if (stat.size===file.size) { console.log('exists-same-size', key, file.size); process.exit(0); } } await client.write(key, file); const stat=await client.stat(key); console.log('uploaded', key, stat.size);"
    
  4. Verify the public URL:

    curl -I --fail https://remotion.media/<remote-file-name>
    
  5. Replace local asset usage with the hosted URL and delete the local binary.

    Do not wrap remote URLs in staticFile(): staticFile() rejects http:// and https:// URLs. Use the URL string directly, for example:

    <Video src="https://remotion.media/example.mp4" />
    
  6. Run the focused lint or stylecheck for touched packages, then commit and push.

Skills เพิ่มเติมจาก remotion-dev

pr-name
remotion-dev
การตั้งชื่อที่ถูกต้องสำหรับ PR
official
pr-ready
remotion-dev
แก้ไข CI ที่ล้มเหลว, แก้ไขความขัดแย้งในการรวมโค้ด, หรือการเปลี่ยนแปลงในสาขาท้องถิ่นเพื่อเตรียม PR ให้พร้อม
official
release
remotion-dev
ปล่อยเวอร์ชัน Remotion ใหม่
official
remotion-captions
remotion-dev
การจัดการกับคำบรรยายใน Remotion
official
remotion-create
remotion-dev
กำลังสร้างวิดีโอ Remotion ใหม่
official
video-report
remotion-dev
สร้างรายงานเกี่ยวกับวิดีโอ
official
add-bug
remotion-dev
เพิ่มรายการบั๊ก Remotion ใหม่ไปยัง packages/bugs/api/[v].ts ใช้เมื่อผู้ใช้อธิบายบั๊กและเวอร์ชัน Remotion ที่ได้รับผลกระทบซึ่งควรแสดงผ่านทาง…
official
add-cli-option
remotion-dev
เพิ่มตัวเลือก CLI หรือการกำหนดค่า Remotion ใหม่ โดยการสร้าง AnyRemotionOption, ลงทะเบียนการแยกวิเคราะห์ CLI, เชื่อมต่อตัวตั้งค่าการกำหนดค่า และอัปเดตเอกสาร ใช้เมื่อ...
official