Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
a553079
1
Parent(s):
9bf9d23
try to fix bug
Browse files
src/bug-in-bun/aitube_ffmpeg/overlay/addImageToVideo.ts
CHANGED
@@ -36,14 +36,12 @@ export async function addImageToVideo({
|
|
36 |
|
37 |
// Return a promise that resolves with the path to the output video
|
38 |
return new Promise((resolve, reject) => {
|
39 |
-
ffmpeg(
|
|
|
40 |
.input(inputImagePath)
|
41 |
.complexFilter([
|
42 |
-
`scale=${width}:${height}`, // Scale video
|
43 |
-
|
44 |
-
filter: 'overlay', // Overlay image on scaled video
|
45 |
-
options: { x: '0', y: '0' }
|
46 |
-
}
|
47 |
])
|
48 |
.on("error", (err) => {
|
49 |
reject(new Error(`Error processing video: ${err.message}`));
|
|
|
36 |
|
37 |
// Return a promise that resolves with the path to the output video
|
38 |
return new Promise((resolve, reject) => {
|
39 |
+
ffmpeg()
|
40 |
+
.input(inputVideoPath)
|
41 |
.input(inputImagePath)
|
42 |
.complexFilter([
|
43 |
+
`[0:v]scale=${width}:${height}[scaled]`, // Scale input video
|
44 |
+
`[scaled][1:v]overlay=0:0` // Overlay image
|
|
|
|
|
|
|
45 |
])
|
46 |
.on("error", (err) => {
|
47 |
reject(new Error(`Error processing video: ${err.message}`));
|