Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get error ffmpeg when running wdio-video-reporter in jenkins and centos #162

Open
mpermperpisang opened this issue Feb 1, 2024 · 7 comments

Comments

@mpermperpisang
Copy link

Describe the bug
i got error when i run wdio-video-reporter on jenkins and the OS is centos 8

Log
There is no wdio log because it failed from start
But here is the error

file:///var/data/jenkins-slave/workspace/QE_Playground/web-testing-pr-only/test/support/wdio.conf.chrome.js: undefined Could not find ffmpeg executable, tried "/var/data/jenkins-slave/workspace/QE_Playground/web-testing-pr-only/node_modules/@ffmpeg-installer/linux-x64/ffmpeg", "/var/data/jenkins-slave/workspace/QE_Playground/web-testing-pr-only/node_modules/@ffmpeg-installer/ffmpeg/node_modules/@ffmpeg-installer/linux-x64/ffmpeg" and "/var/data/jenkins-slave/workspace/QE_Playground/web-testing-pr-only/node_modules/@ffmpeg-installer/linux-x64/ffmpeg"

To Reproduce

  1. Install "wdio-video-reporter": "^4.0.5" (i have to use this version only)
  2. Setup wdio config
  reporters: [
    [video, {
      saveAllVideos: true,
      videoSlowdownMultiplier: 3,
      outputDir: './allure-results',
      onlyRecordLastFailure: true,
    }],
    ['allure', {
      outputDir: './allure-results',
      disableWebdriverStepsReporting: true,
      disableWebdriverScreenshotsReporting: false,
      useCucumberStepReporter: true,
      addConsoleLogs: true,
    }],
  ],
  1. Run wdio scenario

Expected behavior
I want the video to be accessable in the jenkins builder with spec Centos 8

Desktop (please complete the following information):

  • OS: Centos
  • Version 8

Additional context
I've tried many ways to import ffmpeg

  1. Put jenkins env => PATH=/usr/bin/ffmpeg
  2. Put wdio config => ffmpegPath: ${process.cwd()}/node_modules/@ffmpeg-installer/linux-x64/ffmpeg

Please help and thanks in advance

@seanpoulter seanpoulter added the help wanted Extra attention is needed label Mar 6, 2024
@seanpoulter
Copy link
Contributor

Sorry to hear you're having trouble @mpermperpisang. It looks like the path to ffmpeg is set using @ffmpeg-installer/ffmpeg. Could you have a look if it supports your platform and processor architecture? If it does, can you install one of the optionalDependency npm packages in your build to ensure the binary is installed?

If that works we'd appreciate any contribution to improve our docs.

@seanpoulter seanpoulter added the good first issue Good for newcomers label Mar 6, 2024
@mpermperpisang
Copy link
Author

hi @seanpoulter
already tried that on the previous attempt, but still no hope
i even put this config ffmpegPath: '/usr/bin/ffmpeg',

full reporter config

reporters: [
    ['video', {
      saveAllVideos: true,
      videoSlowdownMultiplier: 3,
      ffmpegPath: '/usr/bin/ffmpeg',
      outputDir: './allure-results',
      onlyRecordLastFailure: true,
    }],
    ['allure', {
      outputDir: './allure-results',
      disableWebdriverStepsReporting: true,
      disableWebdriverScreenshotsReporting: false,
      useCucumberStepReporter: true,
      addConsoleLogs: true,
    }],
  ],

and also i tried the config from the repository

Screenshot 2024-03-07 at 09 36 27

@seanpoulter
Copy link
Contributor

To offer some feedback on what you've shared:

  • I don't see the ffmpegPath option documented in this repo. Why do you think that would help? Are you using an LLM? 😓
  • The usage examples you've shared are from the @ffmpeg-installer/ffmpeg repo, not this one.
    What did the first example output? Does the path exist? Can you run ffmpeg?
      console.log(require("@ffmpeg-installer/ffmpeg"))
    That first usage example is very similar to how we're using @ffmpeg-installer/ffmpeg in this project:
    https://github.com/webdriverio-community/wdio-video-reporter/blob/main/src/index.ts#L11

I was able to install and run ffmpeg in a centos8 container with no problems after installing @ffmpeg-installer/ffmpeg. This leads me to believe there's a problem installing the npm packages and downloading the binary in your environment. I'd suggest checking the logs, or trying to reproduce the issue with only @ffmpeg-installer/ffmpeg as a dependency:

mkdir issue-162
cd issue-162
npm init -y
npm install --save @ffmpeg-installer/ffmpeg
# => Should install with warnings about optional dependencies.

node -e 'console.log(require("@ffmpeg-installer/ffmpeg"))'
# => Should print the path to ffmpeg in node_modules and not say unsupported architecture.

I believe you'll see the same error as your original post. That means the binary isn't being found in these locations:
https://github.com/kribblo/node-ffmpeg-installer/blob/3c38a9573b2eb5dc6030977cbf1011896e262e31/index.js#L42

What package manager are you using? Is it a monorepo, or an old version of Node and npm?

@mpermperpisang
Copy link
Author

mpermperpisang commented Mar 7, 2024

i'm using node v18.19.0 & npm 10.4.0, @seanpoulter

@seanpoulter seanpoulter added more info needed and removed help wanted Extra attention is needed good first issue Good for newcomers labels Mar 7, 2024
@seanpoulter
Copy link
Contributor

i'm using node v18.19.0 & npm 10.4.0

Oh, interesting. As you'll see below, ffmpeg installed and ran OK for me. We'll need more information, or a minimal example including complete steps to create the environment, to help you any further.

--

Here's what I tried:

$ docker run -it centos:centos8 bash
[Evidence that bash has started]

$ dnf install nodejs
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

It sounds like this is an expected error because CentOS 8 reached end-of-life at the end of 2021. I've followed the instructions from https://stackoverflow.com/a/70930049.

$ dnf module install nodejs:18/common
[Evidence Node.js is installed]

$ node -v
v18.9.1

$ npm -v
v8.19.1

These versions don't match what you provided so I've followed these docs to install Node.js using the binaries from NodeSource.

And to repeat the example from above:

$ npm init -y
$ npm install --save @ffmpeg-installer/ffmpeg
[No warnings[

$ node -e 'console.log(require("@ffmpeg-installer/ffmpeg").path)'
<directory>/node_modules/@ffmpeg-installer/linux-arm64/ffmpeg

$ ./node_modules/@ffmpeg-installer/linux-arm64/ffmpeg -v
ffmpeg version N-49006-...

ffmpeg is installed and found. I believe yours would say x64 instead of arm64:

@mpermperpisang
Copy link
Author

hi @seanpoulter
i see you're using docker(?) but i don't..i literally run the jenkins in centos8 vm
but i'll try to use the same method as you

@seanpoulter
Copy link
Contributor

I used Docker since it was the fastest way to run CentOS 8 and don't have steps to reproduce your environment.

Good luck. Hopefully you find something interesting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants