Reputation: 1
I am currently upgrading Node.js version (18 to 20) and Firebase Functions (Gen 1 to Gen 2).
I encountered an issue during development:
import ffmpeg from "fluent-ffmpeg";
import ffmpeg_static from "ffmpeg-static";
export async function generateThumbnail() {
const playUrl = 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8'
return new Promise((resolve, reject) => {
const command = ffmpeg(playUrl).setFfmpegPath(ffmpeg_static);
command
.on("error", (error: any) => {
console.log("library ffmpeg is error: " + error);
reject(error);
})
.on("end", async () => {
console.log('successfully generated thumbnail');
resolve(null);
})
.duration(1)
.frames(1)
.output('abc.jpg')
.run();
});
}
With the above code, everything works fine when running locally, but after deploying to Google Cloud Run, I get the following error:
Error: ffmpeg was killed with signal SIGSEGV
[enter image description here]([https://i.sstatic.net/fj1hOE6t.png][1])
Here is the artifact registry I used to build the Cloud Run service:
FROM node:20.18.1 AS app-env
RUN npm install -g firebase-tools
ENTRYPOINT ["/usr/local/bin/firebase"]
I researched and found that this issue might be related to the Ubuntu version, and it appears to have been resolved:
However, my project still encounters the same issue.
Upvotes: 0
Views: 72