transitive-bullshit / ffmpeg-concat

Concats a list of videos together using ffmpeg with sexy OpenGL transitions.
878 stars 115 forks source link

no such file or directory, open '/tmp/b878e22ba8549014a8fef34e17dd8408/scene-4-000000000022.raw' #78

Closed romualdo-ah closed 4 years ago

romualdo-ah commented 4 years ago

Hi, I'm trying to concatenate several videos with transitions. It worked before, but now I am receiving an: Error: ENOENT. Here the code: CURRENT OUTPUT

init-frames: 108738.871ms

ffmpeg-concat: 131181.223ms (node:26213) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/tmp/5eceff663c01c50dc4a0bce1374693d7/scene-4-000000000022.raw' at Object.openSync (fs.js:458:3) at Object.readFileSync (fs.js:360:35) at module.exports (/home/r/Projects/webscrapping/node_modules/ffmpeg-concat/lib/get-pixels.js:15:21) at Object.draw (/home/r/Projects/webscrapping/node_modules/ffmpeg-concat/lib/transition.js:49:28)

CODE

const glob = require('glob');
async function start(){
await withFfmpegConcatVideo();

async function withFfmpegConcatVideo() {
      await new Promise(async (resolve) => {

        const effects = [
          "fade",
          // "fadegrayscale",
          // "directionalwarp",
          // "directionalwipe",
          // "crosswarp",
          // "crosszoom",
          // "dreamy",
          // "swap"
          // "circleopen",
          // "squareswire",
          // "angular",
          // "radial",
          // "cube",
        ];

        function returnTransitions(numberOfvideos){
          let transitions=[];

          for(let e =0;e<numberOfvideos-1;e++){
            transitions.push({
              name: effects[Math.floor(Math.random()*effects.length)],
              duration: 500
            })
          }

          return transitions;
        }
        console.log('\nStarting concatenation...');
        let convertedvideos = glob.sync(`${pathToConverted}/*.mp4`);
        console.log(convertedvideos);
        console.log('There are', convertedvideos.length, 'converted videos');

        await concat({
          output: outputmuted,
          videos: convertedvideos,
          transitions:returnTransitions(convertedvideos.length) 
        })

        resolve();
      })
    }
}
start();

Some guidance

romualdo-ah commented 4 years ago

PROBLEM SOLVED To prevent this error, be sure the time of each video is greater than the time of the effect or time of transition.

DanisHack commented 4 years ago

@romualdo-ah reason is something else I suppose. My transitions are of 500ms and videos are of 3s

still the issue is there?

romualdo-ah commented 4 years ago

@romualdo-ah reason is something else I suppose. My transitions are of 500ms and videos are of 3s

still the issue is there?

Is each video time greater than 500ms? I reduce the time of transition and it works for me.