Skip to content

πŸŽ₯ Make videos programmatically with React

`@remotion/media`: Add HLS support via Mediabunny beta

Jonny Burgera70ea10c90ea
diff --git a/bun.lock b/bun.lock
index b68df8563c..d9e329c9a6 100644
--- a/bun.lock
+++ b/bun.lock
@@ -2501,7 +2501,7 @@
"@vitejs/plugin-react": "4.3.4",
"@vitest/browser-playwright": "4.0.9",
"eslint": "9.19.0",
- "mediabunny": "1.39.2",
+ "mediabunny": "1.42.0-beta.4",
"next": "16.2.3",
"openai": "4.67.1",
"playwright": "1.55.1",
@@ -6408,7 +6408,7 @@
"media-typer": ["[email protected]", "", {}, "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="],
- "mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg=="],
+ "mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-y4S0KujyBX8mJ+bifVE6dEx5/ZcJlCifhpu5MPQ9lKAtRXOJbv3PFwD3mZgOme4vgXs/YUWBVza9rTKj+SATnQ=="],
"mem": ["[email protected]", "", { "dependencies": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^2.0.0", "p-is-promise": "^2.0.0" } }, "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w=="],
@@ -8758,6 +8758,16 @@
"@mdx-js/react/react": ["[email protected]", "", {}, "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ=="],
+ "@mediabunny/aac-encoder/mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg=="],
+
+ "@mediabunny/ac3/mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg=="],
+
+ "@mediabunny/flac-encoder/mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg=="],
+
+ "@mediabunny/mp3-encoder/mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg=="],
+
+ "@mediafox/core/mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg=="],
+
"@modelcontextprotocol/sdk/ajv": ["[email protected]", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g=="],
"@modelcontextprotocol/sdk/express": ["[email protected]", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="],
@@ -10758,6 +10768,8 @@
"template-electron/tailwindcss": ["[email protected]", "", {}, "sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw=="],
+ "template-music-visualization/mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg=="],
+
"template-next-app/@eslint/js": ["@eslint/[email protected]", "", {}, "sha512-UZ1VpFvXf9J06YG9xQBdnzU+kthors6KjhMAl6f4gH4usHyh31rUf2DLGInT8RFYIReYXNSydgPY0V2LuWgl7A=="],
"template-next-app/@typescript-eslint/eslint-plugin": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/type-utils": "8.46.0", "@typescript-eslint/utils": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.46.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-hA8gxBq4ukonVXPy0OKhiaUh/68D0E88GSmtC1iAEnGaieuDi38LhS7jdCHRLi6ErJBNDGCzvh5EnzdPwUc0DA=="],
@@ -10820,8 +10832,6 @@
"template-react-router/tsx": ["[email protected]", "", { "dependencies": { "esbuild": "0.25.0", "get-tsconfig": "4.8.1" }, "optionalDependencies": { "fsevents": "2.3.3" }, "bin": { "tsx": "dist/cli.mjs" } }, "sha512-4H8vUNGNjQ4V2EOoGw005+c+dGuPSnhpPBPHBtsZdGZBk/iJb4kguGlPWaZTZ3q5nMtFOEsY0nRDlh9PJyd6SQ=="],
- "template-react-router/vite": ["[email protected]", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-2N/55r4JDJ4gdrCvGgINMy+HH3iRpNIz8K6SFwVsA+JbQScLiC+clmAxBgwiSPgcG9U15QmvqCGWzMbqda5zGQ=="],
-
"template-recorder/@radix-ui/react-dialog": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.2", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.10", "@radix-ui/react-focus-guards": "1.1.2", "@radix-ui/react-focus-scope": "1.1.7", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.4", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-controllable-state": "1.2.2", "aria-hidden": "1.2.4", "react-remove-scroll": "2.7.1" }, "peerDependencies": { "@types/react": "19.0.0", "@types/react-dom": "19.0.0", "react": "19.0.0", "react-dom": "19.0.0" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-+CpweKjqpzTmwRwcYECQcNYbI8V9VSQt0SNFKeEBLgfucbsLssU6Ppq7wUdNXEGb573bMjFhVjKVll8rmV6zMw=="],
"template-recorder/@radix-ui/react-dropdown-menu": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.2", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-menu": "2.1.15", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "19.0.0", "@types/react-dom": "19.0.0", "react": "19.0.0", "react-dom": "19.0.0" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-mIBnOjgwo9AH3FyKaSWoSu/dYj6VdhJ7frEPiGTeXCdUFHjl9h3mFh2wwhEtINOmYXWhdpf1rY2minFsmaNgVQ=="],
@@ -10840,6 +10850,8 @@
"template-recorder/lucide-react": ["[email protected]", "", { "peerDependencies": { "react": "19.0.0" } }, "sha512-aybBJzLHcw1CIn3rUcRkztB37dsJATtpffLNX+0/w+ws2p21nYIlOwX/B5fqxq8F/BjqVemnJX8chKwRidvROg=="],
+ "template-recorder/mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg=="],
+
"template-recorder/postcss": ["[email protected]", "", { "dependencies": { "nanoid": "3.3.11", "picocolors": "1.1.1", "source-map-js": "1.2.1" } }, "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ=="],
"template-recorder/prettier-plugin-organize-imports": ["[email protected]", "", { "peerDependencies": { "prettier": "3.6.0", "typescript": "5.8.2" } }, "sha512-KFvk8C/zGyvUaE3RvxN2MhCLwzV6OBbFSkwZ2OamCrs9ZY4i5L77jQ/w4UmUr+lqX8qbaqVq6bZZkApn+IgJSg=="],
@@ -10858,6 +10870,8 @@
"template-still/p-limit": ["[email protected]", "", { "dependencies": { "yocto-queue": "0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="],
+ "template-three/mediabunny": ["[email protected]", "", { "dependencies": { "@types/dom-mediacapture-transform": "^0.1.11", "@types/dom-webcodecs": "0.1.13" } }, "sha512-VcrisGRt+OI7tTPrziucJoCIPYIS/DEWY37TqzQVLWSUUHiyvsiRizEypQ3FOlhfIZ4ytAG/Mw4zxfetCTyKUg=="],
+
"template-vercel/@eslint/js": ["@eslint/[email protected]", "", {}, "sha512-UZ1VpFvXf9J06YG9xQBdnzU+kthors6KjhMAl6f4gH4usHyh31rUf2DLGInT8RFYIReYXNSydgPY0V2LuWgl7A=="],
"template-vercel/@typescript-eslint/eslint-plugin": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/type-utils": "8.46.0", "@typescript-eslint/utils": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.46.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-hA8gxBq4ukonVXPy0OKhiaUh/68D0E88GSmtC1iAEnGaieuDi38LhS7jdCHRLi6ErJBNDGCzvh5EnzdPwUc0DA=="],
@@ -12168,6 +12182,16 @@
"@mdx-js/react/@types/react/csstype": ["[email protected]", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
+ "@mediabunny/aac-encoder/mediabunny/@types/dom-webcodecs": ["@types/[email protected]", "", {}, "sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ=="],
+
+ "@mediabunny/ac3/mediabunny/@types/dom-webcodecs": ["@types/[email protected]", "", {}, "sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ=="],
+
+ "@mediabunny/flac-encoder/mediabunny/@types/dom-webcodecs": ["@types/[email protected]", "", {}, "sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ=="],
+
+ "@mediabunny/mp3-encoder/mediabunny/@types/dom-webcodecs": ["@types/[email protected]", "", {}, "sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ=="],
+
+ "@mediafox/core/mediabunny/@types/dom-webcodecs": ["@types/[email protected]", "", {}, "sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ=="],
+
"@modelcontextprotocol/sdk/ajv/json-schema-traverse": ["[email protected]", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
"@modelcontextprotocol/sdk/express/accepts": ["[email protected]", "", { "dependencies": { "mime-types": "3.0.1", "negotiator": "1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="],
@@ -13782,6 +13806,8 @@
"template-electron/@tailwindcss/postcss/postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg=="],
+ "template-music-visualization/mediabunny/@types/dom-webcodecs": ["@types/[email protected]", "", {}, "sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ=="],
+
"template-next-app-tailwind/@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0" } }, "sha512-lWETPa9XGcBes4jqAMYD9fW0j4n6hrPtTJwWDmtqgFO/4HF4jmdH/Q6wggTw5qIT5TXjKzbt7GsZUBnWoO3dqw=="],
"template-next-app-tailwind/@typescript-eslint/eslint-plugin/@typescript-eslint/type-utils": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0", "@typescript-eslint/utils": "8.46.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-hy+lvYV1lZpVs2jRaEYvgCblZxUoJiPyCemwbQZ+NGulWkQRy0HRPYAoef/CNSzaLt+MLvMptZsHXHlkEilaeg=="],
@@ -13916,12 +13942,6 @@
"template-prompt-to-motion-graphics/typescript-eslint/@typescript-eslint/utils": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.46.0", "@typescript-eslint/types": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-nD6yGWPj1xiOm4Gk0k6hLSZz2XkNXhuYmyIrOWcHoPuAhjT9i5bAG+xbWPgFeNR8HPHHtpNKdYUXJl/D3x7f5g=="],
- "template-react-router/vite/picomatch": ["[email protected]", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
-
- "template-react-router/vite/postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg=="],
-
- "template-react-router/vite/tinyglobby": ["[email protected]", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
-
"template-recorder/@radix-ui/react-dialog/@radix-ui/primitive": ["@radix-ui/[email protected]", "", {}, "sha512-XnbHrrprsNqZKQhStrSwgRUQzoCI1glLzdw79xiZPoofhGICeZRSQ3dIxAKH1gb3OHfNf4d6f+vAv3kil2eggA=="],
"template-recorder/@radix-ui/react-dialog/@radix-ui/react-compose-refs": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "19.0.0", "react": "19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg=="],
@@ -13998,6 +14018,8 @@
"template-recorder/lucide-react/react": ["[email protected]", "", {}, "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ=="],
+ "template-recorder/mediabunny/@types/dom-webcodecs": ["@types/[email protected]", "", {}, "sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ=="],
+
"template-recorder/tailwindcss/postcss": ["[email protected]", "", { "dependencies": { "nanoid": "3.3.11", "picocolors": "1.1.1", "source-map-js": "1.2.1" } }, "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ=="],
"template-recorder/tailwindcss/resolve": ["[email protected]", "", { "dependencies": { "is-core-module": "2.15.1", "path-parse": "1.0.7", "supports-preserve-symlinks-flag": "1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw=="],
@@ -14034,6 +14056,8 @@
"template-still/p-limit/yocto-queue": ["[email protected]", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
+ "template-three/mediabunny/@types/dom-webcodecs": ["@types/[email protected]", "", {}, "sha512-O5hkiFIcjjszPIYyUSyvScyvrBoV3NOEEZx/pMlsu44TKzWNkLVBBxnxJz42in5n3QIolYOcBYFCPZZ0h8SkwQ=="],
+
"template-vercel/@typescript-eslint/eslint-plugin/@typescript-eslint/scope-manager": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "@typescript-eslint/visitor-keys": "8.46.0" } }, "sha512-lWETPa9XGcBes4jqAMYD9fW0j4n6hrPtTJwWDmtqgFO/4HF4jmdH/Q6wggTw5qIT5TXjKzbt7GsZUBnWoO3dqw=="],
"template-vercel/@typescript-eslint/eslint-plugin/@typescript-eslint/type-utils": ["@typescript-eslint/[email protected]", "", { "dependencies": { "@typescript-eslint/types": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0", "@typescript-eslint/utils": "8.46.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-hy+lvYV1lZpVs2jRaEYvgCblZxUoJiPyCemwbQZ+NGulWkQRy0HRPYAoef/CNSzaLt+MLvMptZsHXHlkEilaeg=="],
diff --git a/package.json b/package.json
index 63de391de0..1452a3299c 100644
--- a/package.json
+++ b/package.json
@@ -108,7 +108,7 @@
"@types/node": "20.12.14",
"@types/web": "0.0.166",
"@types/bun": "1.3.3",
- "mediabunny": "1.39.2",
+ "mediabunny": "1.42.0-beta.4",
"@mediabunny/mp3-encoder": "1.39.2",
"@mediabunny/aac-encoder": "1.39.2",
"@mediabunny/flac-encoder": "1.39.2",
diff --git a/packages/docs/docs/media/video.mdx b/packages/docs/docs/media/video.mdx
index 94899d8a21..fc479cbc40 100644
--- a/packages/docs/docs/media/video.mdx
+++ b/packages/docs/docs/media/video.mdx
@@ -43,6 +43,23 @@ export const MyComposition = () => {
};
```
+You can also load HLS playlists (`.m3u8`):
+
+```tsx twoslash
+import {AbsoluteFill} from 'remotion';
+import {Video} from '@remotion/media';
+// ---cut---
+export const MyComposition = () => {
+ return (
+ <AbsoluteFill>
+ <Video src="https://stream.mux.com/nqGuji1CJuoPoU3iprRRhiy3HXiQN0201HLyliOg44HOU.m3u8" />
+ </AbsoluteFill>
+ );
+};
+```
+
+For more information on HLS support, see the [HLS documentation](/docs/miscellaneous/snippets/hls).
+
## Props
### `src`
@@ -429,6 +446,7 @@ Logs audio scheduling information to the console. This is useful for debugging a
## See also
- [Source code for this component](https://github.com/remotion-dev/remotion/blob/main/packages/media/src/video/video.tsx)
+- [HLS support (HTTP Live Streaming)](/docs/miscellaneous/snippets/hls)
- [Comparison of video tags](/docs/video-tags)
- [`<Audio>` (from `@remotion/media`)](/docs/media/audio)
- [`<Html5Video>` (from `remotion`)](/docs/html5-video)
diff --git a/packages/docs/docs/mediabunny/formats.mdx b/packages/docs/docs/mediabunny/formats.mdx
index e1c1cf871f..3601fcb3e9 100644
--- a/packages/docs/docs/mediabunny/formats.mdx
+++ b/packages/docs/docs/mediabunny/formats.mdx
@@ -25,6 +25,7 @@ Mediabunny's compatibility data is mirrored on this page.
- ADTS (`.aac`)
- FLAC (`.flac`)
- MPEG Transport Stream (`.ts`)
+- HLS (`.m3u8`) - HTTP Live Streaming playlists (VOD only)
## Video codecs
diff --git a/packages/docs/docs/mediabunny/index.mdx b/packages/docs/docs/mediabunny/index.mdx
index f714c86da8..ed36393dfc 100644
--- a/packages/docs/docs/mediabunny/index.mdx
+++ b/packages/docs/docs/mediabunny/index.mdx
@@ -23,7 +23,7 @@ Here are some notable ones:
**Features exclusive to Media Parser**:
-- `.m3u8` and `.avi` container support
+- `.avi` container support
- Foreign file probing
**Features exclusive to Mediabunny**:
diff --git a/packages/docs/docs/miscellaneous/snippets/hls.mdx b/packages/docs/docs/miscellaneous/snippets/hls.mdx
index dbfe6157b1..7f88e841f5 100644
--- a/packages/docs/docs/miscellaneous/snippets/hls.mdx
+++ b/packages/docs/docs/miscellaneous/snippets/hls.mdx
@@ -6,13 +6,40 @@ id: hls
crumb: 'Video'
---
-Remotion does not currently support HLS / HTTP Live streaming / `.m3u8` files natively.
+import {AvailableFrom} from '../../components/AvailableFrom';
-For full HLS support across all browsers and during rendering, we will support HLS through [`@remotion/media`](/docs/media/video) once [Mediabunny](/docs/mediabunny) has added support for it.
-While we don't control the timeline, we have mutually agreed that HLS should be put high on the roadmap.
-[Follow the status of this issue here](https://github.com/Vanilagy/mediabunny/issues/89).
+## Using `<Video>` from `@remotion/media`<AvailableFrom v="4.0.TBD" />
-## Using hls.js to play HLS videos during Preview
+[`<Video>`](/docs/media/video) from [`@remotion/media`](/docs/media) supports HLS / HTTP Live Streaming / `.m3u8` files natively via [Mediabunny](https://mediabunny.dev).
+
+Simply pass an `.m3u8` URL as the `src` prop:
+
+```tsx twoslash
+import {AbsoluteFill} from 'remotion';
+import {Video} from '@remotion/media';
+
+export const HlsExample = () => {
+ return (
+ <AbsoluteFill>
+ <Video src="https://stream.mux.com/nqGuji1CJuoPoU3iprRRhiy3HXiQN0201HLyliOg44HOU.m3u8" />
+ </AbsoluteFill>
+ );
+};
+```
+
+This works across all browsers and during rendering.
+When a master playlist with multiple quality variants is used, Remotion will automatically select the highest-quality video track and its accompanying audio.
+
+:::note
+Only VOD (Video on Demand) HLS playlists are supported.
+Live HLS streams are not supported.
+:::
+
+## Legacy approaches
+
+The following approaches are still available but are no longer recommended now that native HLS support is available.
+
+### Using hls.js to play HLS videos during Preview
You can play HLS videos during preview in the [`<Player>`](/docs/player) and in the Remotion Studio.
@@ -75,4 +102,6 @@ This means [`<OffthreadVideo />`](/docs/offthreadvideo) can play HLS / HTTP Live
## See also
+- [`<Video>` from `@remotion/media`](/docs/media/video)
+- [Mediabunny HLS reading guide](https://mediabunny.dev/guide/reading-hls)
- [GitHub issue for this feature request](https://github.com/remotion-dev/remotion/issues/2930)
diff --git a/packages/docs/docs/video-tags.mdx b/packages/docs/docs/video-tags.mdx
index 5aab9eba11..9220c6bdae 100644
--- a/packages/docs/docs/video-tags.mdx
+++ b/packages/docs/docs/video-tags.mdx
@@ -20,9 +20,9 @@ This page offers a comparison to help you decide which tag to use.
| **Partial download of asset** | ❌ | Only with `muted` prop | βœ… |
| **Preview** | HTML5 `<video>` | HTML5 `<video>` | WebCodecs |
| **Render Speed** | Fast | Medium | <span style={{color: 'green', fontWeight: 'bold'}}> Fastest </span> |
-| **Supported containers** | `.aac`, `.avi`, `.caf`, `.flac`, `.flv`, `.m4a`, `.mkv`, `.mp3`, `.mp4`, `.ogg`, `.wav`, `.webm` | `.aac`, `.flac`, `.m4a`, `.mkv`, `.mp3`, `.mp4`, `.ogg`, `.wav`, `.webm` | `.aac`, `.flac`, `.mkv`, `.mov`, `.mp3`, `.mp4`, `.ogg`, `.wav`, `.webm` <br/><br/> Fallback to `<OffthreadVideo>` for unsupported containers |
+| **Supported containers** | `.aac`, `.avi`, `.caf`, `.flac`, `.flv`, `.m4a`, `.mkv`, `.mp3`, `.mp4`, `.ogg`, `.wav`, `.webm` | `.aac`, `.flac`, `.m4a`, `.mkv`, `.mp3`, `.mp4`, `.ogg`, `.wav`, `.webm` | `.aac`, `.flac`, `.m3u8`, `.mkv`, `.mov`, `.mp3`, `.mp4`, `.ogg`, `.wav`, `.webm` <br/><br/> Fallback to `<OffthreadVideo>` for unsupported containers |
| **Supported codecs** | AAC, AC3, AV1, FLAC, H.264, H.265, M4A, MP3, Opus, PCM, ProRes, VP8, VP9, Vorbis | AAC, FLAC, H.264, MP3, Opus, VP8, VP9, Vorbis | AAC, FLAC, H.264, MP3, Opus, VP8, VP9, Vorbis <br/><br/> Fallback to `<OffthreadVideo>` for unsupported codecs |
-| **HLS Support** | [Chrome v142+](/docs/miscellaneous/snippets/hls) | [Only during preview](/docs/miscellaneous/snippets/hls) | [Planned](/docs/miscellaneous/snippets/hls) |
+| **HLS Support** | [Chrome v142+](/docs/miscellaneous/snippets/hls) | [Only during preview](/docs/miscellaneous/snippets/hls) | [βœ… Supported](/docs/miscellaneous/snippets/hls) |
| **CORS required** | No | No | Yes |
| **Loopable** | ❌ | βœ… | βœ… |
| **`playbackRate`** <br/> (Speed Change) | βœ… | βœ… | βœ… |
diff --git a/packages/media/src/create-input.ts b/packages/media/src/create-input.ts
new file mode 100644
index 0000000000..8181f0e1fe
--- /dev/null
+++ b/packages/media/src/create-input.ts
@@ -0,0 +1,50 @@
+import type {UrlSourceOptions} from 'mediabunny';
+import {
+ ALL_FORMATS,
+ HLS_FORMATS,
+ Input,
+ PathedSource,
+ UrlSource,
+} from 'mediabunny';
+
+export const isHlsSource = (src: string): boolean => {
+ try {
+ const url = new URL(src, 'http://placeholder');
+ return url.pathname.toLowerCase().endsWith('.m3u8');
+ } catch {
+ return src.toLowerCase().endsWith('.m3u8');
+ }
+};
+
+export const createInput = ({
+ src,
+ credentials,
+ urlSourceOptions,
+}: {
+ src: string;
+ credentials: RequestCredentials | undefined;
+ urlSourceOptions?: Partial<UrlSourceOptions>;
+}): Input => {
+ const requestInit = credentials ? {credentials} : undefined;
+ const sourceOptions: UrlSourceOptions | undefined =
+ requestInit || urlSourceOptions
+ ? {
+ ...urlSourceOptions,
+ ...(requestInit ? {requestInit} : undefined),
+ }
+ : undefined;
+
+ if (isHlsSource(src)) {
+ return new Input({
+ source: new PathedSource(src, ({path}) => {
+ return new UrlSource(path, sourceOptions);
+ }),
+ formats: HLS_FORMATS,
+ });
+ }
+
+ return new Input({
+ source: new UrlSource(src, sourceOptions),
+ formats: ALL_FORMATS,
+ });
+};
diff --git a/packages/media/src/media-player.ts b/packages/media/src/media-player.ts
index ff587b4bef..9ef943eb2f 100644
--- a/packages/media/src/media-player.ts
+++ b/packages/media/src/media-player.ts
@@ -1,4 +1,4 @@
-import {ALL_FORMATS, Input, UrlSource} from 'mediabunny';
+import type {Input} from 'mediabunny';
import type {LogLevel, useBufferState} from 'remotion';
import {Internals} from 'remotion';
import type {ScheduleAudioNodeResult} from 'remotion';
@@ -6,6 +6,7 @@ import {
audioIteratorManager,
type AudioIteratorManager,
} from './audio-iterator-manager';
+import {createInput} from './create-input';
import {drawPreviewOverlay} from './debug-overlay/preview-overlay';
import type {DelayPlaybackIfNotPremounting} from './delay-playback-if-not-premounting';
import {calculateEndTime, getTimeInSeconds} from './get-time-in-seconds';
@@ -135,16 +136,9 @@ export class MediaPlayer {
this.onVideoFrameCallback = onVideoFrameCallback;
this.playing = playing;
this.sequenceOffset = sequenceOffset;
- this.input = new Input({
- source: new UrlSource(
- this.src,
- credentials
- ? {
- requestInit: {credentials},
- }
- : undefined,
- ),
- formats: ALL_FORMATS,
+ this.input = createInput({
+ src: this.src,
+ credentials,
});
if (canvas) {
@@ -163,7 +157,7 @@ export class MediaPlayer {
}
}
- private input: Input<UrlSource>;
+ private input: Input;
private isDisposalError(): boolean {
return this.input.disposed === true;
diff --git a/packages/media/src/video-extraction/get-frames-since-keyframe.ts b/packages/media/src/video-extraction/get-frames-since-keyframe.ts
index 3141ff9a75..6f15a471cc 100644
--- a/packages/media/src/video-extraction/get-frames-since-keyframe.ts
+++ b/packages/media/src/video-extraction/get-frames-since-keyframe.ts
@@ -1,15 +1,13 @@
-import type {InputFormat, UrlSourceOptions} from 'mediabunny';
+import type {Input, InputFormat, UrlSourceOptions} from 'mediabunny';
import {
- ALL_FORMATS,
AudioSampleSink,
EncodedPacketSink,
- Input,
MATROSKA,
- UrlSource,
VideoSampleSink,
WEBM,
} from 'mediabunny';
import {canBrowserUseWebGl2} from '../browser-can-use-webgl2';
+import {createInput} from '../create-input';
import {isNetworkError} from '../is-type-of-error';
import {rememberActualMatroskaTimestamps} from './remember-actual-matroska-timestamps';
@@ -57,12 +55,10 @@ export const getSinks = async (
src: string,
credentials: RequestCredentials | undefined,
) => {
- const input = new Input({
- formats: ALL_FORMATS,
- source: new UrlSource(src, {
- getRetryDelay,
- ...(credentials ? {requestInit: {credentials}} : undefined),
- }),
+ const input = createInput({
+ src,
+ credentials,
+ urlSourceOptions: {getRetryDelay},
});
const format = await getFormatOrNullOrNetworkError(input);