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

Failing FFMPEG on Windows Container on Azure CI #2812

Closed
bahmutov opened this issue Nov 20, 2018 · 11 comments
Closed

Failing FFMPEG on Windows Container on Azure CI #2812

bahmutov opened this issue Nov 20, 2018 · 11 comments
Labels
CI General issues involving running in a CI provider OS: windows type: bug

Comments

@bahmutov
Copy link
Contributor

Recording test on Azure CI windows container fails with ffmpeg error

https://cypress-io.visualstudio.com/cypress-example-kitchensink/_build/results?buildId=87

2018-11-20T15:23:35.9223544Z > cypress-example-kitchensink@1.0.2 start:ci D:\_work\1\s
2018-11-20T15:23:35.9246880Z > http-server app -c-1 --silent
2018-11-20T15:23:35.9378224Z 
2018-11-20T15:23:37.2188259Z 
2018-11-20T15:23:48.6459449Z 
2018-11-20T15:23:49.1204989Z ====================================================================================================
2018-11-20T15:23:49.1227349Z 
2018-11-20T15:23:49.1228555Z   (Run Starting)
2018-11-20T15:23:49.1228918Z 
2018-11-20T15:23:49.1773556Z   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
2018-11-20T15:23:49.1774677Z   Γöé Cypress:    3.1.1                                                                              Γöé
2018-11-20T15:23:49.1775702Z   Γöé Browser:    Electron 59 (headless)                                                             Γöé
2018-11-20T15:23:49.1776299Z   │ Specs:      19 found (examples\actions.spec.js, examples\aliasing.spec.js, examples\assertion… │
2018-11-20T15:23:49.1776959Z   Γöé Params:     Group: false, Parallel: false                                                      Γöé
2018-11-20T15:23:49.1777508Z   Γöé Run URL:    https://dashboard.cypress.io/#/projects/4b7344/runs/3385                           Γöé
2018-11-20T15:23:49.1778345Z   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
2018-11-20T15:23:49.1778758Z 
2018-11-20T15:23:49.5270847Z 
2018-11-20T15:23:49.5646104Z ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
2018-11-20T15:23:49.5647074Z                                                                                                     
2018-11-20T15:23:49.5647650Z   Running: examples\actions.spec.js...                                                    (1 of 19) 
2018-11-20T15:23:49.5667717Z   Estimated: 16 seconds
2018-11-20T15:23:49.6171868Z Warning: We failed to record the video.
2018-11-20T15:23:49.6172423Z 
2018-11-20T15:23:49.6173205Z This error will not alter the exit code.
2018-11-20T15:23:49.6175602Z 
2018-11-20T15:23:49.6175987Z Error: ffmpeg exited with code 3221225781
2018-11-20T15:23:49.6176393Z     at ChildProcess.<anonymous> (C:\Users\VssAdministrator\AppData\Local\Cypress\Cache\3.1.1\Cypress\resources\app\packages\server\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
2018-11-20T15:23:49.6176854Z     at emitTwo (events.js:125:13)
2018-11-20T15:23:49.6177442Z     at ChildProcess.emit (events.js:213:7)
2018-11-20T15:23:49.6177880Z     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
2018-11-20T15:23:49.6178255Z 
2018-11-20T15:23:50.5781731Z npm ERR! code ELIFECYCLE
2018-11-20T15:23:50.5782311Z npm ERR! errno 1
@simologos
Copy link

Hi,
Sorry if this is the wrong bug to comment, but we also have troubles getting video recording to work when running headless.
Btw, we verified the following on all Versions since Cypress 3.0.0.

We are using Atlassian Bamboo as CI Server, running on Windows 2012 R2, and have developers running on Windows 7 and Windows 10.

Here is what we observed:

  • Installing and running with an Admin Profile (and running with admin privileges) has no effect (Blank video recording #1304).
  • Windows 7 Pro: No Error in stout, Video is blank, Screenshots are blank
  • Windows 10: Everything is working as expected
  • Windows Server 2012 R2 (CI): Error in stout:
    Error: ffmpeg exited with code 1: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height, resulting in no video and blank screenshots. This could indeed have something to do with the screen resolution.
  • Windows Server 2016: Everything is OK.

We did some further testing and installed fresh VM's to capture log files using the debug modul:

Win7.txt

What we see on Windows 7 Pro: [mjpeg @ 00000000004265c0] EOI missing, emulating'
This hint does not occur when running on Windows 10. Otherwise the logs look very similar:

Win10.txt

What we've tried to fix this on Windows 7:

  • Install ffmpeg manually
  • Verify screen capture works using the build-in GDI screengrabber: ffmpeg -f gdigrab -framerate 25 -i desktop output.mkv.

This indeed failed too. After a bit of googling we found out that older windows versions have problems with newer pixel formats.

So we tried setting the pixel format with -pix_fmt to yuv420p. This worked and we could capture the screen on Windows 7 Pro, with ffmpeg on its own.

Next step was to try and use fluent-ffmpeg like Cypress does internally, but unfortunately with no luck. Same result: blank videos all over.
Now we hope this information helps you guys :-)

Having video support on our CI Server is important for us in order to analyse failed test runs. The only thing we could imagine so far is upgrading the CI Server's OS from Win2012 to Win2016. But this is a whole project on its own since there are many servers and many many dev projects involved.

Thank you for doing a great job on Cypress!
Have a great day,
Simon

@bahmutov
Copy link
Contributor Author

bahmutov commented Dec 9, 2018

@simologos unbelievable persistence, bravo! I am using your comment and debugging digging as an example for other users. Since a particular system setup is so so hard to recreate, it is up to a user (unfortunately) to dig and find the specific problem.

If you find what specific flags fluent-ffmpeg needs in order to work on Windows 7 and Win2012 server, of course we would be happy to merge the PR, or at least expose the code so you could configure it via a Cypress plugin for example.

@benmonro
Copy link

I'm also getting this error as well. I'm actually trying to run cypress in a docker container (WCOW) and get the following:

PS C:\Cypress> .\node_modules\.bin\cypress run

+ .\node_modules\cypress\bin\cypress run
====================================================================================================
At line:1 char:1
  (Run Starting)\cypress\bin\cypress run
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ??????????????????????????????????????????????????????????????????????????????????????????????????
  ? Cypress:    3.1.3                                                                              ?
  ? Browser:    Electron 59 (headless)                                                             ?
  ? Specs:      1 found (home\index.spec.js)                                                       ?
  ??????????????????????????????????????????????????????????????????????????????????????????????????


????????????????????????????????????????????????????????????????????????????????????????????????????

  Running: home\index.spec.js...                                                           (1 of 1)
(node:5684) Warning: Promise.defer is deprecated and will be removed in a future version. Use new Promise instead.
(node:5684) Warning: Promise.defer is deprecated and will be removed in a future version. Use new Promise instead.
Warning: We failed to record the video.

This error will not alter the exit code.

Error: ffmpeg exited with code 3221225781
    at ChildProcess.<anonymous> (C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.1.3\Cypress\resources\app\packages\server\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

{ Error: ffmpeg exited with code 3221225781
    at ChildProcess.<anonymous> (C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.1.3\Cypress\resources\app\packages\server\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) recordingVideoFailed: true }
Error: ffmpeg exited with code 3221225781
    at ChildProcess.<anonymous> (C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.1.3\Cypress\resources\app\packages\server\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)```

@benmonro
Copy link

benmonro commented Dec 10, 2018

@brian-mann @jennifer-shehane @bahmutov this is super important for us, we are now also running into this issue. any way someone can try to reproduce this? I'm trying to convince my employer to use cypress and this is blocking us from proceeding. Even a work around would be helpful.

Should also mention I'm trying to run this on windows serer 2016 datacenter.

@andrexello
Copy link

andrexello commented Dec 11, 2018

My team is also running into this issue. Our CI setup is with Octopus + Jenkins, running on Windows 2012 R2.
The Cypress version is 3.1.1, using Electron v. 59. The error we see is:

Warning: We failed to record the video.
This error will not alter the exit code.
Error: ffmpeg exited with code 4294967295: frame=30729 fps= 25 q=12.0 size=   41984kB time=00:20:28.84 bitrate= 279.9kbits/s dup=7631 drop=2 speed=   1x     
Past duration 0.999992 too large 
frame=30742 fps= 25 q=13.0 size=   41984kB time=00:20:29.36 bitrate= 279.8kbits/s dup=7633 drop=2 speed=   1x     
frame=30755 fps= 25 q=20.0 size=   41984kB time=00:20:29.88 bitrate= 279.6kbits/s dup=7636 drop=2 speed=   1x    
    at ChildProcess.<anonymous> (C:\Users\jenkins\AppData\Local\Cypress\Cache\3.1.1\Cypress\resources\app\packages\server\node_modules\fluent-ffmpeg\lib\processor.js:182:22) 
    at emitTwo (events.js:125:13) 
    at ChildProcess.emit (events.js:213:7) 
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)```

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Dec 27, 2018
@bbalon
Copy link

bbalon commented Mar 27, 2019

Looks like "Desktop Experience" Feature needs to be enabled for ffmpeg to work properly.

@jennifer-shehane
Copy link
Member

Same error code here: 3221225781 #4625

@benmonro
Copy link

benmonro commented Jul 1, 2019

We switched to testcafe.

@jennifer-shehane
Copy link
Member

Since this issue hasn't had activity in a while, we'll close the issue until we can confirm this is still happening. Please comment if there is new information to provide concerning the original issue and we'd be happy to reopen.

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Feb 3, 2021
@tfrijsewijk
Copy link

I'm experiencing the exact same issue as the opening post. I'm trying to run Cypress from a Windows Docker container. Doesn't matter whether using electron or chrome.

Error: ffmpeg exited with code 3221225781
    at ChildProcess.<anonymous> (C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\9.1.1\Cypress\resources\app\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
    at ChildProcess.emit (node:events:394:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)

Error: ffmpeg exited with code 3221225781
    at ChildProcess.<anonymous> (C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\9.1.1\Cypress\resources\app\node_modules\fluent-ffmpeg\lib\processor.js:182:22)
    at ChildProcess.emit (node:events:394:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)

@klofi
Copy link

klofi commented Feb 14, 2023

This is still happening on Windows Docker container with cypress v12.5.1 and Chrome v110.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI General issues involving running in a CI provider OS: windows type: bug
Projects
None yet
Development

No branches or pull requests

8 participants