Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

How can I process a file multiple times #1207

Open
@OriX0

Description

@OriX0

Version information

  • fluent-ffmpeg version:2.1.2
  • ffmpeg version: 2023-04-03 v38
  • OS: window 10

Code to reproduce

I need to edit a video multiple times, which means there are multiple startTimes and durations. But I don't know what to do. When I run the following code, I can only handle the first one, and then the processor goes crazy and gets stuck. I think it should be a resource occupation, but I don't know how to make a release.

const videoPath = '1.mp4';
ffmpeg
  .addInput(videoPath)
  .outputOptions("-y")
  .setStartTime("00:00:30")
  .setDuration(10)
  .withVideoCodec("copy")
  .output("outPut1.mp4")
  .on("end", function (err) {
    console.log("end");
    if (!err) {
      console.log("conversion Done");
    }
  })
  .on("error", function (err) {
    console.log("error: ", err);
  })
  .run();

ffmpeg
  .addInput(videoPath)
  .outputOptions("-y")
  .setStartTime("00:00:30")
  .setDuration(10)
  .withVideoCodec("copy")
  .output("outPut1.mp4")
  .on("end", function (err) {
    console.log("end");
    if (!err) {
      console.log("conversion Done");
    }
  })
  .on("error", function (err) {
    console.log("error: ", err);
  })
  .run();

(note: if the problem only happens with some inputs, include a link to such an input file)

Expected results

Normal speed operation

Observed results

the processor goes crazy and gets stuck

Checklist

  • I have read the FAQ
  • I tried the same with command line ffmpeg and it works correctly (hint: if the problem also happens this way, this is an ffmpeg problem and you're not reporting it to the right place)
  • I have included full stderr/stdout output from ffmpeg

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions