editly icon indicating copy to clipboard operation
editly copied to clipboard

[ Bug Report ] the video does not synchronize with sound when i merge with multiple videos

Open carl-jin opened this issue 3 years ago • 6 comments

Version

ffmpeg v4.2 editly v0.11.1@latests systemn window10

Steps to reproduce

    await editly({
      defaults: {
        transition: null,
        layer: { fontPath: fontPath }
      },
      width: config.videoConfig.short.width,
      height: config.videoConfig.short.height,
      outPath: this.output,
      // here is multiple video clips
      clips,
      outputVolume: 0.5,
      loopAudio: true,
      keepSourceAudio: true,
      fast: false
    }).catch(console.error);

the clips kind of like below

  this.data.map((post, index) => {
      clips.push({
        duration: parseInt(post.duration),
        layers: [
          {
            left: 0,
            top: 0,
            width: 1,
            height: 1,
            type: "video",
            path: post.originalPath,
            resizeMode: ""
          }
        ]
      });

      clips.push({
        duration: 1,
        layers: [
          {
            left: 0,
            top: 0,
            width: 1,
            height: 1,
            type: "video",
            path: bPath,
            resizeMode: "cover"
          }
        ]
      });
    });

What is expected?

videos synchronize with sound, even with multiple videos.

What is actually happening?

the video does not synchronize with sound when i merge with multiple videos

carl-jin avatar Jan 05 '21 00:01 carl-jin

or, maybe this bug affected by the ffmpeg?

carl-jin avatar Jan 05 '21 02:01 carl-jin

Same problem here...

andersondn avatar Jan 12 '21 17:01 andersondn

Same problem here...

u can add a filter for audio to fix this bug

put those code below in audio.js

      '-map', 'a:0', '-c:a', 'flac',
      //  ------   start here
      // add apad filter for Pad the end of an audio stream with silence.
      // add loudnorm filter for loudness normalization, if u merge a couple vids , this filter pretty useful
      '-filter:a', 'apad,loudnorm',
      //  ------- end here
      '-y',

or u just can use my package (fork from editly) editly-faster

but i suggest just fork u own project from editly for more customizable

carl-jin avatar Jan 13 '21 01:01 carl-jin

Is this problem caused by video files that have an audio duration which is shorter than the video (or vide versa)?

mifi avatar Jan 24 '21 17:01 mifi

yep

Is this problem caused by video files that have an audio duration which is shorter than the video (or vide versa)?

carl-jin avatar Jan 26 '21 18:01 carl-jin

Same problem here (with around 29 videos) but I do not use video with a shorter audio duration, @carl-jin solution did not help Any idea on that ?

ascae avatar Aug 16 '21 20:08 ascae