question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]: Missing video codecs for Firefox in Heroku

See original GitHub issue

It appears that videos in a headless Firefox browser within Heroku (using the Playwright buildpack) are missing codecs. I’m getting the following error:

[JavaScript Warning: "The video on this page can't be played. 
Your system may not have the required video codecs for: 
video/mp4;codecs="avc1.4d402a"" {file: "https://link/to/video" line: 0}]

This is the same error that was reported for Dockerized Playwright and had been solved by installing ffmpeg. I’ve tried to do the same within Heroku (both by forking the buildpack and requiring ffmpeg as a dependency and by including an ffmpeg buildpack) without luck. I’m unclear if this is an issue with Playwright itself or with the buildpack, so I’ve also filed an issue over there (apologies for the duplicate!)

It’s worth noting that I’m only getting this error when my script is run remotely in Heroku. Running it locally (using heroku local on my machine) returns no errors and videos play as expected.

Happy to provide more info if needed. Many thanks for such a great project!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mxschmittcommented, Sep 10, 2020

Hi @ProQuestionAsker, would be awesome if you could try out this branch on the buildpack, for me it seems to work but I don’t have the exact test case:

https://github.com/mxschmitt/heroku-playwright-buildpack.git#bugfix/pw-1-4 (just set it on Heroku)

image

Edit: I used this test case in the end that the play() function is working from a video element. On the screenshot I can verify that 2 seconds had passed after clicking play:

// @ts-check
const playwright = require("playwright-firefox");

(async () => {
  const browser = await playwright.firefox.launch()
  const page = await browser.newPage();
  await page.goto('https://www.w3.org/2010/05/video/mediaevents.html');
  await page.waitForTimeout(4000)
  await page.$eval("#video", e => e.play())
  await page.waitForTimeout(2000)
  await page.screenshot({ path: `example.png` });
  await browser.close();
})();
1reaction
mxschmittcommented, Sep 10, 2020

Hi @ProQuestionAsker. Just want to let you know that we’re on it. Should be added in the next few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot play video | Firefox Support Forum - Mozilla Support
Youtube plays some videos but some videos show error "your browser does not currently recognize any of the video formats available".
Read more >
Can't watch any mp4 file or any streaming video (like youtube ...
Hello, I've just upgraded Ubuntu 22.04 to 22.10. Everything seems to work great except Firefox,mplayer and I suppose any other mp4 player ...
Read more >
ytdl-org/youtube-dl - Buildpacks - Heroku Elements
youtube-dl is a command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter, version 2.6, 2.7, ......
Read more >
Thread Tools - VideoHelp Forum
Host: wv-proxy.ercdn.com. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0. Look at the video for ...
Read more >
Error only with firefox on deployed version on heroku
This error is from your client side code, the way its deployed isn't likely to change it (Demeteorizer, using meteor deploy instead, etc)....
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