0

I am trying to get video from s3 on lambda and save tmp folder. From tmp folder , video is being used to edit and again save on s3 object.

I have uploaded executable file and set the FFMPEG_PATH enviroment variable. Here unable to overlay text on video.That is an issue

var params = {
    Bucket: "Bucket name",
    Key: "Sample.mp4",
};

const s3Object = s3.getObject(params).promise();
await s3Object
    .then((data) => {
        console.log("jhkjkk");
        console.log(data);
        writeFileSync(`/tmp/Sample.mp4`, data.Body);
        console.log("provess comp");
        //ffmpegM.setFfmpegPath("/opt/ffmpeglib/ffmpeg");
        console.log(ffmpegM);
        ffmpegM("/tmp/Sample.mp4")
            .output(`/tmp/Samples.mp4`)
            .on("error", (error) => {
                console.log("Error converting to mp4", error); // this does NOT get logged out
            })
            .on("end", () => {
                // this code block does not get hit
                console.log("Successfully converted to mp4");
            })
            .run();
        })
    .catch((err) => {
        console.log("dd");
        console.log(err);
    });
j sharma
  • 669
  • 1
  • 5
  • 7
  • Can someone pls reply – j sharma Jun 08 '21 at 07:03
  • Hi, if you want people to provide you answers you need to add more detail to your question. What have you tried so far? What is not working? What are specific errors you get? Your question does not provide any detail of what you are trying to achieve and what is missing so that you can achieve your goal? I recommend you read [How to ask a good question?](https://stackoverflow.com/help/how-to-ask) – Jens Jun 08 '21 at 07:12
  • I have edited code – j sharma Jun 08 '21 at 07:23
  • What do you mean by "video is not editing"? Are you receiving any errors in the log file? How did you get ffmpeg into the Lambda function (eg Lambda Layer)? More information, please. – John Rotenstein Jun 08 '21 at 07:26
  • ffmpegM("/tmp/Sample.mp4") this code not working.Nething error not success msg..I have download ffmpeg executable file and uploaded on layer using s3. AFter fluent-ffmpg module installed on layer..and set ffmpeg path in environment variable. – j sharma Jun 08 '21 at 07:29
  • Maybe your Lambda times out? What is the timeout setting of your Lambda? It needs to be long enough for the process to end? Can you please add the Cloudwatch output of the function to your question? – Jens Jun 08 '21 at 07:33
  • timeout is for 15 mins – j sharma Jun 08 '21 at 07:38
  • Can anyone help – j sharma Jun 08 '21 at 08:16
  • Please post CloudWatch logs. – Jens Jun 08 '21 at 11:37

0 Answers0