GithubHelp home page GithubHelp logo

Error: write EPIPE about editly HOT 19 CLOSED

mifi avatar mifi commented on May 19, 2024
Error: write EPIPE

from editly.

Comments (19)

mifi avatar mifi commented on May 19, 2024 1

It doesn't finish rendering the two first clips, it just opens them and starts streaming from them. Because editly is based on streams, it will buffer up a bit first, and then try to write to output ffmpeg. What fails is when it's trying to write to the output:

editly/index.js

Line 396 in 4a6d593

await new Promise((r) => outProcess.stdin.write(outFrameData, () => r()));

So it indicates that the output ffmpeg failed to start or has stopped.

I agree we should add a lock file, but we need one for yarn and one for npm. I'm not sure the best way to keep them in sync. I usually use yarn, but when users run npm install -g they need npm lockfile

from editly.

NickBusey avatar NickBusey commented on May 19, 2024 1

Huh, apparently I'm a dummy and didn't have ffmpeg on this machine, thought I did. Maybe could add a check and error message? Or a note in the readme maybe, either way I'll close this.

from editly.

mifi avatar mifi commented on May 19, 2024 1

Yes I want to add a better check, so keeping it open until that's done

from editly.

mifi avatar mifi commented on May 19, 2024

Whoops! I suspect your ffmpeg doesnt support gif output. Can you try to set these and run again:

enableFfmpegLog: true,
Verbose: true,

from editly.

NickBusey avatar NickBusey commented on May 19, 2024
nick@Nicks-2013-MacBook-Pro-2 ~/Code/editly/examples ±master⚡ » cat simple.json5                                                                      1 ↵
{
  width: 720, height: 1280, fps: 30,
  enableFfmpegLog: true,
  Verbose: true,
  defaults: {
    transition: { name: 'random' },
  },
  clips: [
    { duration: 3, transition: { name: 'directional-left' }, layers: [{ type: 'title-background', text: 'EDITLY\nVideo editing framework', background: { type: 'linear-gradient', colors: ['#02aab0', '#00cdac'] } }] },
    { duration: 4, transition: { name: 'dreamyzoom' }, layers: [{ type: 'title-background', text: 'Multi-line text with animated linear or radial gradients', background: { type: 'radial-gradient' } }] },
    { duration: 3, transition: { name: 'directional-right' }, layers: [{ type: 'rainbow-colors' }, { type: 'title', text: 'Colorful backgrounds' }] },
  ],
}
nick@Nicks-2013-MacBook-Pro-2 ~/Code/editly/examples ±master⚡ » editly simple.json5 --out test.gif
720x1280 30fps
createFrameSource linear-gradient clip 0 layer 0
createFrameSource title clip 0 layer 1
createFrameSource radial-gradient clip 1 layer 0
createFrameSource title clip 1 layer 1
  0%   3%   7%  11%  14%  18%  22%  25%  29% Done with transition, switching to next clip
createFrameSource gl clip 2 layer 0
Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:154:25)
    at writeGeneric (internal/stream_base_commons.js:145:3)
    at Socket._writeGeneric (net.js:784:11)
    at Socket._write (net.js:796:8)
    at doWrite (_stream_writable.js:403:12)
    at writeOrBuffer (_stream_writable.js:387:5)
    at Socket.Writable.write (_stream_writable.js:318:11)
    at /usr/local/lib/node_modules/editly/index.js:396:51
    at new Promise (<anonymous>)
    at module.exports (/usr/local/lib/node_modules/editly/index.js:396:15)

A docker image for this would be great. I could maybe look at putting a Dockerfile together if there's interest.

from editly.

mifi avatar mifi commented on May 19, 2024

oops my phone auto-capitalized the V in Verbose. try verbose: true instead. As for why you are not getting any ffmpeg output is a bit strange. with verbose, it should print the ffmpeg gif output command, maybe you can try to run it on the command line.
also does it work with mp4?

Docker file could be possible, but since editly uses headless openGL and GLSL, it may be a bit tricky to set up

from editly.

chapmanjacobd avatar chapmanjacobd commented on May 19, 2024

this situation actually looks like the problem might not be ffmpeg because it renders the first two clips successfully right? so maybe it is a problem with createFrameSource gl


we might want to look keeping package.json.lock or yarn.lock in the repo. that way we can have much more predictable results: https://medium.com/the-guild/how-should-you-pin-your-npm-dependencies-and-why-2b8d545c7312

from editly.

chapmanjacobd avatar chapmanjacobd commented on May 19, 2024

found this:

https://stackoverflow.com/questions/46904544/sync-yarn-lock-back-into-package-json-and-lock
https://classic.yarnpkg.com/blog/2018/06/04/yarn-import-package-lock/

from editly.

mifi avatar mifi commented on May 19, 2024

I want some solution that "just works" without having to run any extra commands before or after npm install or commit, and I prefer to use yarn during development, because it's much faster and more stable.

Also I also found this:
https://medium.com/@gajus/stop-using-package-lock-json-or-yarn-lock-909035e94328

editly is kind of in a limbo here because it is a library which can be a dependency of other packages, but at the same time it is also a stand alone CLI.

So if it's right to provide a lockfile, I think we need to provide a package-lock and a yarn lock. But when developing I prefer yarn, so I think package-lock should automatically be generated from yarn lock (I'm not sure though)

https://github.com/imsnif/synp

from editly.

chapmanjacobd avatar chapmanjacobd commented on May 19, 2024

maybe we should move this discussion into another issue to get more feedback from other users. I agree that we should provide both package-lock and yarn lock.

I think one of the big problems with libraries in the npm ecosystem is that it has become a practice to not include lock files for minor reasons or to follow some convention. Yes there are some costs like potential duplication but we will have less confusion if we know for sure that everyone is on the same page running the same dependencies.

Responsible development requires that your script works with the latest versions of dependencies (and yes that includes transitive dependencies) satisfied by semver.
https://medium.com/@gajus/stop-using-package-lock-json-or-yarn-lock-909035e94328

I don't at all believe this is true. When we don't commit package lock then we are setting up future devs for failure. We can't be expected to predict the future and know that none of the upstream dependencies breaks this library in some way (breaking semVar is absolutely possible)

from editly.

NickBusey avatar NickBusey commented on May 19, 2024
nick@Nicks2013MBP2 ~/Code/editly/examples ±master⚡ » cat simple.json5
{
  width: 720, height: 1280, fps: 30,
  enableFfmpegLog: true,
  verbose: true,
  defaults: {
    transition: { name: 'random' },
  },
  clips: [
    { duration: 3, transition: { name: 'directional-left' }, layers: [{ type: 'title-background', text: 'EDITLY\nVideo editing framework', background: { type: 'linear-gradient', colors: ['#02aab0', '#00cdac'] } }] },
    { duration: 4, transition: { name: 'dreamyzoom' }, layers: [{ type: 'title-background', text: 'Multi-line text with animated linear or radial gradients', background: { type: 'radial-gradient' } }] },
    { duration: 3, transition: { name: 'directional-right' }, layers: [{ type: 'rainbow-colors' }, { type: 'title', text: 'Colorful backgrounds' }] },
  ],
}
nick@Nicks2013MBP2 ~/Code/editly/examples ±master⚡ » editly simple.json5 --out test.gif
{
  width: 720,
  height: 1280,
  fps: 30,
  enableFfmpegLog: true,
  verbose: true,
  defaults: {
    transition: {
      name: 'random',
    },
  },
  clips: [
    {
      duration: 3,
      transition: {
        name: 'directional-left',
      },
      layers: [
        {
          type: 'title-background',
          text: 'EDITLY\nVideo editing framework',
          background: {
            type: 'linear-gradient',
            colors: [
              '#02aab0',
              '#00cdac',
            ],
          },
        },
      ],
    },
    {
      duration: 4,
      transition: {
        name: 'dreamyzoom',
      },
      layers: [
        {
          type: 'title-background',
          text: 'Multi-line text with animated linear or radial gradients',
          background: {
            type: 'radial-gradient',
          },
        },
      ],
    },
    {
      duration: 3,
      transition: {
        name: 'directional-right',
      },
      layers: [
        {
          type: 'rainbow-colors',
        },
        {
          type: 'title',
          text: 'Colorful backgrounds',
        },
      ],
    },
  ],
  outPath: 'test.gif',
}
{
  width: 720,
  height: 1280,
  fps: 30,
  enableFfmpegLog: true,
  verbose: true,
  defaults: {
    transition: {
      name: 'random',
    },
  },
  clips: [
    {
      duration: 3,
      transition: {
        name: 'directional-left',
      },
      layers: [
        {
          type: 'title-background',
          text: 'EDITLY\nVideo editing framework',
          background: {
            type: 'linear-gradient',
            colors: [
              '#02aab0',
              '#00cdac',
            ],
          },
        },
      ],
    },
    {
      duration: 4,
      transition: {
        name: 'dreamyzoom',
      },
      layers: [
        {
          type: 'title-background',
          text: 'Multi-line text with animated linear or radial gradients',
          background: {
            type: 'radial-gradient',
          },
        },
      ],
    },
    {
      duration: 3,
      transition: {
        name: 'directional-right',
      },
      layers: [
        {
          type: 'rainbow-colors',
        },
        {
          type: 'title',
          text: 'Colorful backgrounds',
        },
      ],
    },
  ],
  outPath: 'test.gif',
}
[
  {
    transition: {
      name: 'directional',
      duration: 0.5,
      params: {
        direction: [
          1,
          0,
        ],
      },
    },
    duration: 3,
    layers: [
      {
        type: 'linear-gradient',
        colors: [
          '#02aab0',
          '#00cdac',
        ],
      },
      {
        type: 'title',
        text: 'EDITLY\nVideo editing framework',
      },
    ],
  },
  {
    transition: {
      name: 'dreamyzoom',
      duration: 0.5,
    },
    duration: 4,
    layers: [
      {
        type: 'radial-gradient',
      },
      {
        type: 'title',
        text: 'Multi-line text with animated linear or radial gradients',
      },
    ],
  },
  {
    transition: {
      name: 'directional',
      duration: 0.5,
      params: {
        direction: [
          -1,
          0,
        ],
      },
    },
    duration: 3,
    layers: [
      {
        type: 'gl',
        fragmentPath: '/usr/local/lib/node_modules/editly/shaders/rainbow-colors.frag',
      },
      {
        type: 'title',
        text: 'Colorful backgrounds',
      },
    ],
  },
]
720x1280 30fps
ffmpeg -f rawvideo -vcodec rawvideo -pix_fmt rgba -s 720x1280 -r 30 -i - -map 0:v:0 -vf fps=30,scale=720:1280:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse -loop 0 -y test.gif
createFrameSource linear-gradient clip 0 layer 0
createFrameSource title clip 0 layer 1
createFrameSource radial-gradient clip 1 layer 0
createFrameSource title clip 1 layer 1
Frame 0 from 0 (clip 0) to 0 (clip 1)
Frame 1 from 1 (clip 0) to 0 (clip 1)
Frame 2 from 2 (clip 0) to 0 (clip 1)
Frame 3 from 3 (clip 0) to 0 (clip 1)
Frame 4 from 4 (clip 0) to 0 (clip 1)
Frame 5 from 5 (clip 0) to 0 (clip 1)
Frame 6 from 6 (clip 0) to 0 (clip 1)
Frame 7 from 7 (clip 0) to 0 (clip 1)
Frame 8 from 8 (clip 0) to 0 (clip 1)
Frame 9 from 9 (clip 0) to 0 (clip 1)
Frame 10 from 10 (clip 0) to 0 (clip 1)
Frame 11 from 11 (clip 0) to 0 (clip 1)
Frame 12 from 12 (clip 0) to 0 (clip 1)
Frame 13 from 13 (clip 0) to 0 (clip 1)
Frame 14 from 14 (clip 0) to 0 (clip 1)
Frame 15 from 15 (clip 0) to 0 (clip 1)
Frame 16 from 16 (clip 0) to 0 (clip 1)
Frame 17 from 17 (clip 0) to 0 (clip 1)
Frame 18 from 18 (clip 0) to 0 (clip 1)
Frame 19 from 19 (clip 0) to 0 (clip 1)
Frame 20 from 20 (clip 0) to 0 (clip 1)
Frame 21 from 21 (clip 0) to 0 (clip 1)
Frame 22 from 22 (clip 0) to 0 (clip 1)
Frame 23 from 23 (clip 0) to 0 (clip 1)
Frame 24 from 24 (clip 0) to 0 (clip 1)
Frame 25 from 25 (clip 0) to 0 (clip 1)
Frame 26 from 26 (clip 0) to 0 (clip 1)
Frame 27 from 27 (clip 0) to 0 (clip 1)
Frame 28 from 28 (clip 0) to 0 (clip 1)
Frame 29 from 29 (clip 0) to 0 (clip 1)
Frame 30 from 30 (clip 0) to 0 (clip 1)
Frame 31 from 31 (clip 0) to 0 (clip 1)
Frame 32 from 32 (clip 0) to 0 (clip 1)
Frame 33 from 33 (clip 0) to 0 (clip 1)
Frame 34 from 34 (clip 0) to 0 (clip 1)
Frame 35 from 35 (clip 0) to 0 (clip 1)
Frame 36 from 36 (clip 0) to 0 (clip 1)
Frame 37 from 37 (clip 0) to 0 (clip 1)
Frame 38 from 38 (clip 0) to 0 (clip 1)
Frame 39 from 39 (clip 0) to 0 (clip 1)
Frame 40 from 40 (clip 0) to 0 (clip 1)
Frame 41 from 41 (clip 0) to 0 (clip 1)
Frame 42 from 42 (clip 0) to 0 (clip 1)
Frame 43 from 43 (clip 0) to 0 (clip 1)
Frame 44 from 44 (clip 0) to 0 (clip 1)
Frame 45 from 45 (clip 0) to 0 (clip 1)
Frame 46 from 46 (clip 0) to 0 (clip 1)
Frame 47 from 47 (clip 0) to 0 (clip 1)
Frame 48 from 48 (clip 0) to 0 (clip 1)
Frame 49 from 49 (clip 0) to 0 (clip 1)
Frame 50 from 50 (clip 0) to 0 (clip 1)
Frame 51 from 51 (clip 0) to 0 (clip 1)
Frame 52 from 52 (clip 0) to 0 (clip 1)
Frame 53 from 53 (clip 0) to 0 (clip 1)
Frame 54 from 54 (clip 0) to 0 (clip 1)
Frame 55 from 55 (clip 0) to 0 (clip 1)
Frame 56 from 56 (clip 0) to 0 (clip 1)
Frame 57 from 57 (clip 0) to 0 (clip 1)
Frame 58 from 58 (clip 0) to 0 (clip 1)
Frame 59 from 59 (clip 0) to 0 (clip 1)
Frame 60 from 60 (clip 0) to 0 (clip 1)
Frame 61 from 61 (clip 0) to 0 (clip 1)
Frame 62 from 62 (clip 0) to 0 (clip 1)
Frame 63 from 63 (clip 0) to 0 (clip 1)
Frame 64 from 64 (clip 0) to 0 (clip 1)
Frame 65 from 65 (clip 0) to 0 (clip 1)
Frame 66 from 66 (clip 0) to 0 (clip 1)
Frame 67 from 67 (clip 0) to 0 (clip 1)
Frame 68 from 68 (clip 0) to 0 (clip 1)
Frame 69 from 69 (clip 0) to 0 (clip 1)
Frame 70 from 70 (clip 0) to 0 (clip 1)
Frame 71 from 71 (clip 0) to 0 (clip 1)
Frame 72 from 72 (clip 0) to 0 (clip 1)
Frame 73 from 73 (clip 0) to 0 (clip 1)
Frame 74 from 74 (clip 0) to 0 (clip 1)
Frame 75 from 75 (clip 0) to 0 (clip 1)
Transition frame 0 / 15 directional 0.5s
runTransitionOnFrame: 75.872ms
Frame 76 from 76 (clip 0) to 1 (clip 1)
Transition frame 1 / 15 directional 0.5s
runTransitionOnFrame: 39.244ms
Frame 77 from 77 (clip 0) to 2 (clip 1)
Transition frame 2 / 15 directional 0.5s
runTransitionOnFrame: 34.918ms
Frame 78 from 78 (clip 0) to 3 (clip 1)
Transition frame 3 / 15 directional 0.5s
runTransitionOnFrame: 33.693ms
Frame 79 from 79 (clip 0) to 4 (clip 1)
Transition frame 4 / 15 directional 0.5s
runTransitionOnFrame: 32.573ms
Frame 80 from 80 (clip 0) to 5 (clip 1)
Transition frame 5 / 15 directional 0.5s
runTransitionOnFrame: 33.260ms
Frame 81 from 81 (clip 0) to 6 (clip 1)
Transition frame 6 / 15 directional 0.5s
runTransitionOnFrame: 33.301ms
Frame 82 from 82 (clip 0) to 7 (clip 1)
Transition frame 7 / 15 directional 0.5s
runTransitionOnFrame: 33.802ms
Frame 83 from 83 (clip 0) to 8 (clip 1)
Transition frame 8 / 15 directional 0.5s
runTransitionOnFrame: 63.689ms
Frame 84 from 84 (clip 0) to 9 (clip 1)
Transition frame 9 / 15 directional 0.5s
runTransitionOnFrame: 53.232ms
Frame 85 from 85 (clip 0) to 10 (clip 1)
Transition frame 10 / 15 directional 0.5s
runTransitionOnFrame: 32.531ms
Frame 86 from 86 (clip 0) to 11 (clip 1)
Transition frame 11 / 15 directional 0.5s
runTransitionOnFrame: 44.255ms
Frame 87 from 87 (clip 0) to 12 (clip 1)
Transition frame 12 / 15 directional 0.5s
runTransitionOnFrame: 43.256ms
Frame 88 from 88 (clip 0) to 13 (clip 1)
Transition frame 13 / 15 directional 0.5s
runTransitionOnFrame: 28.360ms
Frame 89 from 89 (clip 0) to 14 (clip 1)
Done with transition, switching to next clip
createFrameSource gl clip 2 layer 0
Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:154:25)
    at writeGeneric (internal/stream_base_commons.js:145:3)
    at Socket._writeGeneric (net.js:784:11)
    at Socket._write (net.js:796:8)
    at doWrite (_stream_writable.js:403:12)
    at writeOrBuffer (_stream_writable.js:387:5)
    at Socket.Writable.write (_stream_writable.js:318:11)
    at /usr/local/lib/node_modules/editly/index.js:396:51
    at new Promise (<anonymous>)
    at module.exports (/usr/local/lib/node_modules/editly/index.js:396:15)

from editly.

chapmanjacobd avatar chapmanjacobd commented on May 19, 2024

@NickBusey what is the output of ffmpeg -version ?

from editly.

chapmanjacobd avatar chapmanjacobd commented on May 19, 2024

I wonder if the problem is that vf is not quoted like this:

ffmpeg -f rawvideo -vcodec rawvideo -pix_fmt rgba -s 720x1280 -r 30 -i - -map 0:v:0 -vf \
"fps=30,scale=720:1280:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" \
 -loop 0 -y test.gif

from editly.

mifi avatar mifi commented on May 19, 2024

Have now improved error handling so it shows better error messages. @chapmanjacobd feel free to open a new issue about package-lock

from editly.

thurdev avatar thurdev commented on May 19, 2024

Ok so I'm getting the same error

ffmpeg version 4.3.1
WARNING: ffmpeg: Version is outdated
ffprobe version 4.3.1
WARNING: ffprobe: Version is outdated
Extracting audio/silence from all clips
Mixing clip audio with arbitrary audio
1500x1000 30fps
  0% Fontconfig error: Cannot load default config file
  4%   8%  12%  16%  20%  25%  29%  33%  37% Done with transition, switching to next transitionFromClip (1)
 37% Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:156:25)
    at writeGeneric (internal/stream_base_commons.js:147:3)
    at Socket._writeGeneric (net.js:798:11)
    at Socket._write (net.js:810:8)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at Socket.Writable.write (internal/streams/writable.js:303:10)
    at /app/node_modules/editly/index.js:367:66
    at new Promise (<anonymous>)
    at Editly (/app/node_modules/editly/index.js:367:30)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write',
  originalMessage: 'write EPIPE',
  shortMessage: 'Command failed with EPIPE: ffmpeg -hide_banner -loglevel error -f rawvideo -vcodec rawvideo -pix_fmt rgba -s 1500x1000 -r 30 -i - -i /app/out/editly-tmp-KIc4qctsIC2MCWRJD7oBC/audio-mixed.flac -map 0:v:0 -map 1:a:0 -acodec aac -b:a 128k -vf format=yuv420p -vcodec libx264 -profile:v high -preset:v medium -crf 18 -movflags faststart -y /app/out/ZzwzLZQAyF5tidVW4n0o0WSpb3YZSM9CCIarX0_suOLusvDtj2.mp4\n' +
    'write EPIPE',
  command: 'ffmpeg -hide_banner -loglevel error -f rawvideo -vcodec rawvideo -pix_fmt rgba -s 1500x1000 -r 30 -i - -i /app/out/editly-tmp-KIc4qctsIC2MCWRJD7oBC/audio-mixed.flac -map 0:v:0 -map 1:a:0 -acodec aac -b:a 128k -vf format=yuv420p -vcodec libx264 -profile:v high -preset:v medium -crf 18 -movflags faststart -y /app/out/ZzwzLZQAyF5tidVW4n0o0WSpb3YZSM9CCIarX0_suOLusvDtj2.mp4',
  exitCode: undefined,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

My Dockerfile

FROM ubuntu:focal-20210921

WORKDIR /app

# Ensures tzinfo doesn't ask for region info.
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y \
    dumb-init \
    xvfb \
    build-essential libxi-dev libglu1-mesa-dev libglew-dev pkg-config

# Source: https://gist.github.com/remarkablemark/aacf14c29b3f01d6900d13137b21db3a
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

# update the repository sources list
# and install dependencies
RUN apt-get update \
    && apt-get install -y curl \
    && apt-get -y autoclean

RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -

RUN apt-get install -y nodejs

# confirm installation
RUN node -v
RUN npm -v

## INSTALL EDITLY

# ## Install app dependencies
COPY package.json /app/
RUN npm install

# Add app source
COPY . /app

# Ensure `editly` binary available in container
RUN npm link

RUN apt-get update && apt-get install -y wget \
    xz-utils \
    dumb-init \
    xvfb

# Get ffmpeg and ffprobe with static build
RUN wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-4.3.1-amd64-static.tar.xz \
    && tar xvf ffmpeg-4.3.1-amd64-static.tar.xz \
    && cp ffmpeg-4.3.1-amd64-static/ffmpeg /usr/local/bin/ \
    && cp ffmpeg-4.3.1-amd64-static/ffprobe /usr/local/bin/ \
    && rm -rf ffmpeg-4.3.1-amd64-static.tar.xz \
    && rm -rf ffmpeg-4.3.1-amd64-static

# Ensure ffmpeg and ffprobe are successfully copied
RUN ffmpeg -version && ffprobe -version

ENTRYPOINT ["/usr/bin/dumb-init", "--", "xvfb-run", "--server-args", "-screen 0 1280x1024x24 -ac"]

EXPOSE 3000

CMD [ "node","./index.js" ]

With these configs it works on my pc, but when I try on my droplet gives me that error.

from editly.

mifi avatar mifi commented on May 19, 2024

@thurdev I think your error is "Fontconfig error: Cannot load default config file". maybe missing something related to that?

from editly.

thurdev avatar thurdev commented on May 19, 2024

So I added this to my dockerfile

# FONT CONFIG
RUN apt-get install fontconfig -y

but didn't seem to fix the problem the EPIPE problem, but the Fontconfig error seems to be fixed now.

I also updated my ffmpeg to the latest version

my logs

ffmpeg version 5.0
ffprobe version 5.0
Extracting audio/silence from all clips
Mixing clip audio with arbitrary audio
1500x1000 30fps
  0%   4%   8%  12%  16%  20%  25%  29%  33%  37% Done with transition, switching to next transitionFromClip (1)
 37% Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:156:25)
    at writeGeneric (internal/stream_base_commons.js:147:3)
    at Socket._writeGeneric (net.js:798:11)
    at Socket._write (net.js:810:8)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at Socket.Writable.write (internal/streams/writable.js:303:10)
    at /app/node_modules/editly/index.js:367:66
    at new Promise (<anonymous>)
    at Editly (/app/node_modules/editly/index.js:367:30)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write',
  originalMessage: 'write EPIPE',
  shortMessage: 'Command failed with EPIPE: ffmpeg -hide_banner -loglevel error -f rawvideo -vcodec rawvideo -pix_fmt rgba -s 1500x1000 -r 30 -i - -i /app/out/editly-tmp-XK6nBUrKizUYAk4-PrQ6T/audio-mixed.flac -map 0:v:0 -map 1:a:0 -acodec aac -b:a 128k -vf format=yuv420p -vcodec libx264 -profile:v high -preset:v medium -crf 18 -movflags faststart -y /app/out/DMvET2k9quzWe7TvL3Q_EIhwuGEZnHgHuo5PELCZvyyW9UslpY.mp4\n' +
    'write EPIPE',
  command: 'ffmpeg -hide_banner -loglevel error -f rawvideo -vcodec rawvideo -pix_fmt rgba -s 1500x1000 -r 30 -i - -i /app/out/editly-tmp-XK6nBUrKizUYAk4-PrQ6T/audio-mixed.flac -map 0:v:0 -map 1:a:0 -acodec aac -b:a 128k -vf format=yuv420p -vcodec libx264 -profile:v high -preset:v medium -crf 18 -movflags faststart -y /app/out/DMvET2k9quzWe7TvL3Q_EIhwuGEZnHgHuo5PELCZvyyW9UslpY.mp4',
  exitCode: undefined,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

from editly.

mifi avatar mifi commented on May 19, 2024

@thurdev what does your json look like?

from editly.

thurdev avatar thurdev commented on May 19, 2024

@mifi

const clips = [
                {
                    duration: 3,
                    transition: {
                        name: 'directional-left'
                    },
                    layers: [
                        {
                            type: 'image',
                            path: files.path
                        },
                        {
                            type: 'subtitle',
                            text: text[0],
                            zoomDirection: 'out'
                        }
                    ]
                }
            ]

const config = {
            outPath: path.dirname(__dirname) + '/out/' + videoName,
            width: 1500,
            height: 1000,
            fps: 30,
            allowRemoteRequests: false,
            enableFfmpegLog: true,
            verbose: true,
            defaults: {
                duration: 4,
                transition: {
                    duration: 0.5,
                    name: 'random',
                    audioOutCurve: 'tri',
                    audioInCurve: 'tri',
                },
            },
            clips,
            audioFilePath: path.dirname(__dirname) + "/assets/songs/song.mp3",
            loopAudio: false,
            keepSourceAudio: false,
            clipsAudioVolume: 1,
            outputVolume: 1,
            audioNorm: {
                enable: false,
                gaussSize: 5,
                maxGain: 30,
            }
        }
    adding enableFFmpeglog and verbose
        Writing frame: 61 from clip 0 (frame 61)
Writing frame: 62 from clip 0 (frame 62)
Writing frame: 63 from clip 0 (frame 63)
Writing frame: 64 from clip 0 (frame 64)
Writing frame: 65 from clip 0 (frame 65)kB time=00:00:00.46 bitrate=   0.8kbits/s speed=0.0727x
Writing frame: 66 from clip 0 (frame 66)
Writing frame: 67 from clip 0 (frame 67)
Writing frame: 68 from clip 0 (frame 68)
Writing frame: 69 from clip 0 (frame 69)
Writing frame: 70 from clip 0 (frame 70)
Writing frame: 71 from clip 0 (frame 71)kB time=00:00:00.67 bitrate=   0.6kbits/s speed=0.0972x
Writing frame: 72 from clip 0 (frame 72)
Writing frame: 73 from clip 0 (frame 73)
Writing frame: 74 from clip 0 (frame 74)
Writing frame: 75 from clip 0 (frame 75) to clip 1 (frame 0 / 15) directional 0.5sspeed=0.124x
Writing frame: 76 from clip 0 (frame 76) to clip 1 (frame 1 / 15) directional 0.5sspeed=0.127x
Writing frame: 77 from clip 0 (frame 77) to clip 1 (frame 2 / 15) directional 0.5s
Writing frame: 78 from clip 0 (frame 78) to clip 1 (frame 3 / 15) directional 0.5s
Writing frame: 79 from clip 0 (frame 79) to clip 1 (frame 4 / 15) directional 0.5sspeed=0.13x
Writing frame: 80 from clip 0 (frame 80) to clip 1 (frame 5 / 15) directional 0.5s
Writing frame: 81 from clip 0 (frame 81) to clip 1 (frame 6 / 15) directional 0.5sspeed=0.133x
Writing frame: 82 from clip 0 (frame 82) to clip 1 (frame 7 / 15) directional 0.5s
Writing frame: 83 from clip 0 (frame 83) to clip 1 (frame 8 / 15) directional 0.5sspeed=0.136x
Writing frame: 84 from clip 0 (frame 84) to clip 1 (frame 9 / 15) directional 0.5s
Writing frame: 85 from clip 0 (frame 85) to clip 1 (frame 10 / 15) directional 0.5speed=0.13x
Writing frame: 86 from clip 0 (frame 86) to clip 1 (frame 11 / 15) directional 0.5s
Writing frame: 87 from clip 0 (frame 87) to clip 1 (frame 12 / 15) directional 0.5speed=0.13x
Writing frame: 88 from clip 0 (frame 88) to clip 1 (frame 13 / 15) directional 0.5s
Writing frame: 89 from clip 0 (frame 89) to clip 1 (frame 14 / 15) directional 0.5speed=0.134x
Done with transition, switching to next transitionFromClip (1)
createFrameSource image clip 2 layer 0
Loading /root/imagetovideo/assets/images/mls.jpg
Blurring background
Writing frame: 90 from clip 1 (frame 15)kB time=00:00:01.62 bitrate=   0.2kbits/s speed=0.129x
Writing frame: 91 from clip 1 (frame 16)
Cleanup
Output ffmpeg exited null
Waiting for output ffmpeg process to finish
Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:156:25)
    at writeGeneric (internal/stream_base_commons.js:147:3)
    at Socket._writeGeneric (net.js:785:11)
    at Socket._write (net.js:797:8)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at Socket.Writable.write (internal/streams/writable.js:303:10)
    at /root/imagetovideo/node_modules/editly/index.js:367:66
    at new Promise (<anonymous>)
    at Editly (/root/imagetovideo/node_modules/editly/index.js:367:30)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write',
  originalMessage: 'write EPIPE',
  shortMessage: 'Command failed with EPIPE: ffmpeg -f rawvideo -vcodec rawvideo -pix_fmt rgba -s 1500x1000 -r 30 -i - -i /root/imagetovideo/out/editly-tmp-eOo7xk9TQxq2o_MIujeTm/audio-mixed.flac -map 0:v:0 -map 1:a:0 -acodec aac -b:a 128k -vf format=yuv420p -vcodec libx264 -profile:v high -preset:v medium -crf 18 -movflags faststart -y /root/imagetovideo/out/jC364p28MjLM8JQzsv9txo6o4BvFZgONsrn2QxsRZ28tCoxeiJ.mp4\n' +
    'write EPIPE',
  command: 'ffmpeg -f rawvideo -vcodec rawvideo -pix_fmt rgba -s 1500x1000 -r 30 -i - -i /root/imagetovideo/out/editly-tmp-eOo7xk9TQxq2o_MIujeTm/audio-mixed.flac -map 0:v:0 -map 1:a:0 -acodec aac -b:a 128k -vf format=yuv420p -vcodec libx264 -profile:v high -preset:v medium -crf 18 -movflags faststart -y /root/imagetovideo/out/jC364p28MjLM8JQzsv9txo6o4BvFZgONsrn2QxsRZ28tCoxeiJ.mp4',
  exitCode: undefined,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Well removing the audio worked

{ text: [ 'TONOLI BOM', 'PRAIA sunset' ] } {
 images: [
   {
     fieldName: 'images',
     originalFilename: '201-custom-banner-bg do tonoli com espaco.png',
     path: '/tmp/P9w10ubUpoHMRVVqIgIQ3Tc1.png',
     headers: [Object],
     size: 9528,
     name: '201-custom-banner-bg do tonoli com espaco.png',
     type: 'image/png'
   },
   {
     fieldName: 'images',
     originalFilename: '3vh8caop9he01.png',
     path: '/tmp/SkXSCAbOnUsFVFV_xsicu5g2.png',
     headers: [Object],
     size: 2713847,
     name: '3vh8caop9he01.png',
     type: 'image/png'
   }
 ]
}
{
 clips: [
   { duration: 3, transition: [Object], layers: [Array] },
   { duration: 3, transition: [Object], layers: [Array] },
   { duration: 3, transition: [Object], layers: [Array] }
 ]
}
ffmpeg version 5.0
ffprobe version 5.0
1500x1000 30fps
 0%   4%   8%  12%  16%  20%  25%  29%  33%  37% Done with transition, switching to next transitionFromClip (1)
37%  41%  45%  50%  54%  58%  62%  66% Done with transition, switching to next transitionFromClip (2)
70%  75%  79%  83%  87%  91%  95% 100% Done with transition, switching to next transitionFromClip (3)
No more transitionFromClip, done

Done. Output file can be found at:
/root/imagetovideo/out/bRWx43CnTYTNCf4qFjHFwKTJBseBfcoIuiu083zsNWO_Ry8w7i.mp4

any clue why?

from editly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.