[BUG] ffmpeg-linux executable doesn't exist

See original GitHub issue

Context:

  • Playwright Version: 1.22.0
  • Operating System: Windows (using Docker Desktop)
  • Java version: 17
  • Browser: [e.g. All, Chromium, Firefox, WebKit]
  • Extra: I use the Docker image browserless/chrome:1.53.0-chrome-stable. I do not connect via cdp but use the browserless playwright endpoint, see https://docs.browserless.io/docs/playwright.html

Code Snippet

Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:

try ( Playwright playwright = Playwright.create( ) ) {
  final Browser browser = playwright.chromium( ).connect( "ws://" + chromeContainer.getHost( ) + ":" + chromeContainer.getFirstMappedPort( ) + "/playwright" );
  final String baseUrl = String.format( "http://%s:%s", hostname, port );
  try (BrowserContext browserContext = browser.newContext( new Browser.NewContextOptions( ).setRecordVideoDir( screenshotAndVideoPath ) );
  Page page = browserContext.newPage( ) ) {
    [...]
  }
}

Describe the bug

Without setting the recordvideodir the test passes, but whenever I try to record a video, I run into this error:

com.microsoft.playwright.PlaywrightException: Error {
  message='Executable doesn't exist at /usr/src/app/ffmpeg-1007/ffmpeg-linux
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
  name='Error
  stack='Error: Executable doesn't exist at /usr/src/app/ffmpeg-1007/ffmpeg-linux
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
    at executablePathOrDie (/usr/src/app/node_modules/playwright-core/lib/server/registry/index.js:297:15)
    at Object.executablePathOrDie (/usr/src/app/node_modules/playwright-core/lib/server/registry/index.js:484:43)
    at FrameSession._createVideoRecorder (/usr/src/app/node_modules/playwright-core/lib/server/chromium/crPage.js:1008:68)
    at FrameSession._initialize (/usr/src/app/node_modules/playwright-core/lib/server/chromium/crPage.js:511:18)
    at async CRBrowserContext.newPage (/usr/src/app/node_modules/playwright-core/lib/server/browserContext.js:366:25)
    at async BrowserContextDispatcher.newPage (/usr/src/app/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js:179:47)
    at async DispatcherConnection.dispatch (/usr/src/app/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js:352:22)
}
	at com.microsoft.playwright.impl.WaitableResult.get(WaitableResult.java:54)
	at com.microsoft.playwright.impl.ChannelOwner.runUntil(ChannelOwner.java:103)
	at com.microsoft.playwright.impl.Connection.sendMessage(Connection.java:105)
	at com.microsoft.playwright.impl.ChannelOwner.sendMessage(ChannelOwner.java:94)
	at com.microsoft.playwright.impl.ChannelOwner.sendMessage(ChannelOwner.java:90)
	at com.microsoft.playwright.impl.BrowserContextImpl.newPageImpl(BrowserContextImpl.java:323)
	at com.microsoft.playwright.impl.BrowserContextImpl.lambda$newPage$12(BrowserContextImpl.java:316)
	at com.microsoft.playwright.impl.LoggingSupport.withLogging(LoggingSupport.java:47)
	at com.microsoft.playwright.impl.ChannelOwner.withLogging(ChannelOwner.java:79)
	at com.microsoft.playwright.impl.BrowserContextImpl.newPage(BrowserContextImpl.java:316)
	at com.microsoft.playwright.impl.BrowserContextImpl.newPage(BrowserContextImpl.java:44)
	at de.libutzki.mailsender.integration.Stage_08_MailSenderApplicationIntegrationTest.testApplication(Stage_08_MailSenderApplicationIntegrationTest.java:174)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:95)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:91)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:60)
	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:98)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: com.microsoft.playwright.impl.DriverException: Error {
  message='Executable doesn't exist at /usr/src/app/ffmpeg-1007/ffmpeg-linux
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
  name='Error
  stack='Error: Executable doesn't exist at /usr/src/app/ffmpeg-1007/ffmpeg-linux
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers:              ║
║                                                                         ║
║     npx playwright install                                              ║
║                                                                         ║
║ <3 Playwright Team                                                      ║
╚═════════════════════════════════════════════════════════════════════════╝
    at executablePathOrDie (/usr/src/app/node_modules/playwright-core/lib/server/registry/index.js:297:15)
    at Object.executablePathOrDie (/usr/src/app/node_modules/playwright-core/lib/server/registry/index.js:484:43)
    at FrameSession._createVideoRecorder (/usr/src/app/node_modules/playwright-core/lib/server/chromium/crPage.js:1008:68)
    at FrameSession._initialize (/usr/src/app/node_modules/playwright-core/lib/server/chromium/crPage.js:511:18)
    at async CRBrowserContext.newPage (/usr/src/app/node_modules/playwright-core/lib/server/browserContext.js:366:25)
    at async BrowserContextDispatcher.newPage (/usr/src/app/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js:179:47)
    at async DispatcherConnection.dispatch (/usr/src/app/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js:352:22)
}
	at com.microsoft.playwright.impl.Connection.dispatch(Connection.java:183)
	at com.microsoft.playwright.impl.Connection.processOneMessage(Connection.java:163)
	at com.microsoft.playwright.impl.ChannelOwner.runUntil(ChannelOwner.java:101)
	... 79 more

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rwollcommented, Jul 4, 2022

Thanks! Marking as 1.25 so I take some time to add a few more details to the diagram and document either in our repo or the official docs.

1reaction
rwollcommented, Jul 2, 2022

I see… and if I connect over CDP it does not have to be under this location?

If using connectOverCDP, ffmpeg needs to be installed on the machine calling connectOverCDP at the location npx playwright install ffmpeg installs it to.

In your case (at some level of absrtaction), things look sort of like:

connectOverCDP Screen Shot 2022-07-02 at 1 13 58 AM
connect Screen Shot 2022-07-02 at 1 14 27 AM
// @ts-check
const playwright = require('playwright-core');

(async () => {
  const browser = await playwright.chromium.connectOverCDP('ws://browserless:3000/'); // ⚠️ NB: connectOverCDP v. connect
  const context = await browser.newContext({ recordVideo: { dir: './examples' } });
  const page = await context.newPage();
  await page.goto('https://example.com');
  await page.close();
  await page.video()?.saveAs('example.webm');
  await context.close();
  await browser.close();
})()
  • browserType.connect is different from browserType.connectOverCDP
  • browserType.connectOverCDP is used to connect to a remote Chromium CDP Session/Endpoint. In this case, Playwright (nor its ffmpeg binary) don’t even need to be installed in the Docker container, but Playwright (including ffmpeg) MUST be installed on your Laptop. Your Laptop will talk Chromium CDP to the Docker container, and the Playwright Client (and Playwright Server) will both be running directly on your Laptop. The Playwright Server is what’s doing the ffmpeg processing.
  • browserType.connect is used to connect to a remote Playwright Server launched via browserType.launchServer. Your Laptop would be talking the Playwright protocol to the Playwright Server running in Docker, and then within the container the Playwright Server would be talking CDP to the Browser. The Playwright Server would use ffmpeg on the Server/Docker container.

Once you make the following change:

- const browser = await playwright.chromium.connectOverCDP('ws://browserless:3000/'); // ⚠️ NB: connectOverCDP v. connect
+ const browser = await playwright.chromium.connect('ws://browserless:3000/playwright');

ffmpeg needs to be installed in the Docker container. It looks like the Browserless container is missing Playwright’s ffmpeg install, but if you build an image from the following Dockerfile:

FROM browserless/chrome:1.53.0-chrome-stable
RUN npx playwright install ffmpeg

and then run it:

docker build -t patched-container .
docker run -it --rm -p 3000:3000 patched-container

video will work with:

await playwright.chromium.connect('ws://browserless:3000/playwright');

Let me know if this explains things!

Closing since patching the Browserless Dockerfile/container fixes the original reported issue, and you have filed a bug with them, but feel free to re-open or comment if you have additional questions or follow up is needed. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ubuntu ffmpeg command -i not found
I've tried the export PATH=$PATH:/path/to/ffmpeg/executable but it doesn't work :( – Gerwin. Apr 12, 2016 at 14:35. I hope you ...
Read more >
ffmpeg: error while loading shared libraries: libopenh264.so.5
I faced this error when I run ffmpeg 4.2.2 under python 3.8 environment. The root cause is that libopen264.so from python 3.8 is...
Read more >
No such file or directory in FFmpeg - Super User
mp4: No such file or directory exist. I am in command prompt (in Windows 7) and have the path as C:\Files\ffmpeg (Where ffmpeg...
Read more >
FFmpeg FAQ
1.1 Why doesn't FFmpeg support feature [xyz]?; 1.2 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support...
Read more >
can't seem to exec properly - Google Groups
2013/11/18 15:57:45 The ffmpeg command failed: exit status 1 ... From what I can tell, the error is probably that the input file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found