Skip to content

🎥 Make videos programmatically with React

update lock

Jonny Burgerdb2effd5e03b
diff --git a/packages/it-tests/src/monorepo/php-package.test.ts b/packages/it-tests/src/monorepo/php-package.test.ts
index 9967f128c7..f2f7390c68 100644
--- a/packages/it-tests/src/monorepo/php-package.test.ts
+++ b/packages/it-tests/src/monorepo/php-package.test.ts
@@ -1,7 +1,7 @@
import { execSync } from "child_process";
import { readFileSync, writeFileSync } from "fs";
import path from "path";
-import { expect, test } from "vitest";
+import { describe, expect, test } from "vitest";
import { LambdaInternals } from "@remotion/lambda";
const referenceVersion = readFileSync(
@@ -11,138 +11,140 @@ const referenceVersion = readFileSync(
const referenceVersionJson = JSON.parse(referenceVersion);
const version = referenceVersionJson.version;
-test("Set the right version for phpunit", () => {
- expect(typeof version).toBe("string");
+describe("These should run serially", () => {
+ test("Set the right version for phpunit", () => {
+ expect(typeof version).toBe("string");
- const VERSION = `<?php \nnamespace Remotion\\LambdaPhp;\n\nconst VERSION = "${version}";`;
- writeFileSync(
- path.join(process.cwd(), "..", "lambda-php", "src", "Version.php"),
- VERSION
- );
-});
-
-test("Set the right version for composer.json", () => {
- const composerJson = readFileSync(
- path.join(process.cwd(), "..", "lambda-php", "composer.json"),
- "utf-8"
- );
- const composerJsonJson = JSON.parse(composerJson);
- composerJsonJson.version = version;
- writeFileSync(
- path.join(process.cwd(), "..", "lambda-php", "composer.json"),
- JSON.stringify(composerJsonJson, null, 2) + "\n"
- );
-});
-
-test("Set the right version for composer.json in example", () => {
- const composerJson = readFileSync(
- path.join(process.cwd(), "..", "lambda-php-example", "composer.json"),
- "utf-8"
- );
- const composerJsonJson = JSON.parse(composerJson);
- composerJsonJson.require["remotion/lambda"] = version;
- writeFileSync(
- path.join(process.cwd(), "..", "lambda-php-example", "composer.json"),
- JSON.stringify(composerJsonJson, null, 2) + "\n"
- );
-});
-
-test("PHP package should create the same renderMedia payload as normal Lambda package", async () => {
- execSync("php composer.phar --quiet update", {
- cwd: path.join(process.cwd(), "..", "lambda-php"),
+ const VERSION = `<?php \nnamespace Remotion\\LambdaPhp;\n\nconst VERSION = "${version}";`;
+ writeFileSync(
+ path.join(process.cwd(), "..", "lambda-php", "src", "Version.php"),
+ VERSION
+ );
});
- execSync("php composer.phar --quiet install", {
- cwd: path.join(process.cwd(), "..", "lambda-php"),
- });
- const phpOutput = execSync("phpunit ./src/PHPClientTest.php", {
- cwd: path.join(process.cwd(), "..", "lambda-php"),
+
+ test("Set the right version for composer.json", () => {
+ const composerJson = readFileSync(
+ path.join(process.cwd(), "..", "lambda-php", "composer.json"),
+ "utf-8"
+ );
+ const composerJsonJson = JSON.parse(composerJson);
+ composerJsonJson.version = version;
+ writeFileSync(
+ path.join(process.cwd(), "..", "lambda-php", "composer.json"),
+ JSON.stringify(composerJsonJson, null, 2) + "\n"
+ );
});
- const output = phpOutput.toString().split("\n");
- const toParse = output[3];
- const nativeVersion = await LambdaInternals.makeLambdaRenderMediaPayload({
- region: "us-east-1",
- composition: "react-svg",
- functionName: "remotion-render",
- serveUrl: "testbed",
- codec: "h264",
- inputProps: {
- hi: "there",
- },
- audioBitrate: null,
- audioCodec: null,
- chromiumOptions: {},
- colorSpace: "default",
- concurrencyPerLambda: 1,
- crf: undefined,
- deleteAfter: null,
- downloadBehavior: { type: "play-in-browser" },
- envVariables: {},
- everyNthFrame: 1,
- forceBucketName: null,
- forceHeight: null,
- forceWidth: null,
- frameRange: null,
- framesPerLambda: null,
- imageFormat: "jpeg",
- jpegQuality: 80,
- logLevel: "info",
- maxRetries: 1,
- muted: false,
- numberOfGifLoops: 0,
- offthreadVideoCacheSizeInBytes: null,
- outName: null,
- overwrite: false,
- pixelFormat: undefined,
- privacy: "public",
- proResProfile: undefined,
- rendererFunctionName: null,
- scale: 1,
- timeoutInMilliseconds: 30000,
- videoBitrate: null,
- encodingMaxRate: null,
- encodingBufferSize: null,
- webhook: null,
- x264Preset: null,
- preferLossless: false,
+
+ test("Set the right version for composer.json in example", () => {
+ const composerJson = readFileSync(
+ path.join(process.cwd(), "..", "lambda-php-example", "composer.json"),
+ "utf-8"
+ );
+ const composerJsonJson = JSON.parse(composerJson);
+ composerJsonJson.require["remotion/lambda"] = version;
+ writeFileSync(
+ path.join(process.cwd(), "..", "lambda-php-example", "composer.json"),
+ JSON.stringify(composerJsonJson, null, 2) + "\n"
+ );
});
- const jsonOutput = toParse.substring(0, toParse.lastIndexOf("}") + 1);
- console.log({ phpOutput: phpOutput.toString("utf8") });
- const parsedJson = JSON.parse(jsonOutput);
- expect(
- removeUndefined({
- ...parsedJson,
- type: "start",
- })
- ).toEqual(removeUndefined(nativeVersion));
-});
+ test("PHP package should create the same renderMedia payload as normal Lambda package", async () => {
+ execSync("php composer.phar --quiet update", {
+ cwd: path.join(process.cwd(), "..", "lambda-php"),
+ });
+ execSync("php composer.phar --quiet install", {
+ cwd: path.join(process.cwd(), "..", "lambda-php"),
+ });
+ const phpOutput = execSync("phpunit ./src/PHPClientTest.php", {
+ cwd: path.join(process.cwd(), "..", "lambda-php"),
+ });
+ const output = phpOutput.toString().split("\n");
+ const toParse = output[4];
+ const nativeVersion = await LambdaInternals.makeLambdaRenderMediaPayload({
+ region: "us-east-1",
+ composition: "react-svg",
+ functionName: "remotion-render",
+ serveUrl: "testbed",
+ codec: "h264",
+ inputProps: {
+ hi: "there",
+ },
+ audioBitrate: null,
+ audioCodec: null,
+ chromiumOptions: {},
+ colorSpace: "default",
+ concurrencyPerLambda: 1,
+ crf: undefined,
+ deleteAfter: null,
+ downloadBehavior: { type: "play-in-browser" },
+ envVariables: {},
+ everyNthFrame: 1,
+ forceBucketName: null,
+ forceHeight: null,
+ forceWidth: null,
+ frameRange: null,
+ framesPerLambda: null,
+ imageFormat: "jpeg",
+ jpegQuality: 80,
+ logLevel: "info",
+ maxRetries: 1,
+ muted: false,
+ numberOfGifLoops: 0,
+ offthreadVideoCacheSizeInBytes: null,
+ outName: null,
+ overwrite: false,
+ pixelFormat: undefined,
+ privacy: "public",
+ proResProfile: undefined,
+ rendererFunctionName: null,
+ scale: 1,
+ timeoutInMilliseconds: 30000,
+ videoBitrate: null,
+ encodingMaxRate: null,
+ encodingBufferSize: null,
+ webhook: null,
+ x264Preset: null,
+ preferLossless: false,
+ });
+ const jsonOutput = toParse.substring(0, toParse.lastIndexOf("}") + 1);
+ console.log({ toParse: phpOutput.toString().split("\n") });
+ const parsedJson = JSON.parse(jsonOutput);
-// Skip PHP tests temporarily
-// https://github.com/shivammathur/setup-php/issues/823
-test("PHP package should create the same progress payload as normal Lambda package", async () => {
- execSync("php composer.phar --quiet update", {
- cwd: path.join(process.cwd(), "..", "lambda-php"),
- });
- execSync("php composer.phar --quiet install", {
- cwd: path.join(process.cwd(), "..", "lambda-php"),
- });
- const phpOutput = execSync("phpunit ./src/PHPRenderProgressTest.php", {
- cwd: path.join(process.cwd(), "..", "lambda-php"),
+ expect(
+ removeUndefined({
+ ...parsedJson,
+ type: "start",
+ })
+ ).toEqual(removeUndefined(nativeVersion));
});
- const output = phpOutput.toString().split("\n");
- const toParse = output[3];
- const nativeVersion = LambdaInternals.getRenderProgressPayload({
- region: "us-east-1",
- functionName: "remotion-render",
- bucketName: "remotion-render",
- renderId: "abcdef",
- logLevel: "info",
+
+ // Skip PHP tests temporarily
+ // https://github.com/shivammathur/setup-php/issues/823
+ test("PHP package should create the same progress payload as normal Lambda package", async () => {
+ execSync("php composer.phar --quiet update", {
+ cwd: path.join(process.cwd(), "..", "lambda-php"),
+ });
+ execSync("php composer.phar --quiet install", {
+ cwd: path.join(process.cwd(), "..", "lambda-php"),
+ });
+ const phpOutput = execSync("phpunit ./src/PHPRenderProgressTest.php", {
+ cwd: path.join(process.cwd(), "..", "lambda-php"),
+ });
+ const output = phpOutput.toString().split("\n");
+ const toParse = output[4];
+ const nativeVersion = LambdaInternals.getRenderProgressPayload({
+ region: "us-east-1",
+ functionName: "remotion-render",
+ bucketName: "remotion-render",
+ renderId: "abcdef",
+ logLevel: "info",
+ });
+ const jsonOutput = toParse.substring(0, toParse.lastIndexOf("}") + 1);
+ const parsedJson = JSON.parse(jsonOutput);
+ expect(parsedJson).toEqual({ ...nativeVersion, s3OutputProvider: null });
});
- const jsonOutput = toParse.substring(0, toParse.lastIndexOf("}") + 1);
- const parsedJson = JSON.parse(jsonOutput);
- expect(parsedJson).toEqual({ ...nativeVersion, s3OutputProvider: null });
-});
-const removeUndefined = (data: unknown) => {
- return JSON.parse(JSON.stringify(data));
-};
+ const removeUndefined = (data: unknown) => {
+ return JSON.parse(JSON.stringify(data));
+ };
+});
diff --git a/packages/lambda-php/composer.lock b/packages/lambda-php/composer.lock
index 469742cc41..8eddb60632 100644
--- a/packages/lambda-php/composer.lock
+++ b/packages/lambda-php/composer.lock
@@ -62,16 +62,16 @@
},
{
"name": "aws/aws-sdk-php",
- "version": "3.304.1",
+ "version": "3.304.2",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "6dac9b3257873a807ac73f6dc4418bdc49a5d9db"
+ "reference": "2435079c3e1a08148d955de15ec090018114f35a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/6dac9b3257873a807ac73f6dc4418bdc49a5d9db",
- "reference": "6dac9b3257873a807ac73f6dc4418bdc49a5d9db",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2435079c3e1a08148d955de15ec090018114f35a",
+ "reference": "2435079c3e1a08148d955de15ec090018114f35a",
"shasum": ""
},
"require": {
@@ -151,9 +151,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.304.1"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.304.2"
},
- "time": "2024-04-09T19:25:27+00:00"
+ "time": "2024-04-10T18:05:32+00:00"
},
{
"name": "guzzlehttp/guzzle",