Skip to content

🎥 Make videos programmatically with React

Embed `Made with Remotion` metadata in video

Jonny Burger2bd1c06d024b
diff --git a/packages/renderer/src/stitch-frames-to-video.ts b/packages/renderer/src/stitch-frames-to-video.ts
index 25338ed77b..9f1041e153 100644
--- a/packages/renderer/src/stitch-frames-to-video.ts
+++ b/packages/renderer/src/stitch-frames-to-video.ts
@@ -1,4 +1,5 @@
import execa from 'execa';
+import fs from 'fs';
import path from 'path';
import {
Codec,
@@ -28,6 +29,10 @@ import {tmpDir} from './tmp-dir';
import {validateEvenDimensionsWithCodec} from './validate-even-dimensions-with-codec';
import {validateFfmpeg} from './validate-ffmpeg';
+const packageJson = JSON.parse(
+ fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf-8')
+);
+
export type StitcherOptions = {
fps: number;
width: number;
@@ -258,6 +263,7 @@ export const spawnFfmpeg = async (
audioCodecName ? ['-c:a', audioCodecName] : null,
// Ignore metadata that may come from remote media
['-map_metadata', '-1'],
+ ['-metadata', `comment=Made with Remotion ${packageJson.version}`],
options.force ? '-y' : null,
options.outputLocation,
];