leonid-shevtsov / headless

Create a virtual X screen from Ruby, record videos and take screenshots.
http://leonid.shevtsov.me/en/headless
MIT License
968 stars 113 forks source link

ffmpeg issue on Mac #92

Open sgup opened 7 years ago

sgup commented 7 years ago

I'm getting the following error with the video: { log_file_path: STDERR} option

Unknown input format: 'x11grab'

This page seems to suggest that avfoundation should be used instead on mac. https://github.com/Homebrew/legacy-homebrew/issues/17641

Any ideas on how to fix this?

more-ron commented 7 years ago

Same issue here using OSX.

I get this on the log file:

avconv version 12, Copyright (c) 2000-2016 the Libav developers
  built on Mar  6 2017 22:35:59 with Apple LLVM version 8.0.0 (clang-800.0.42.1)
Unknown input format: 'x11grab'
leonid-shevtsov commented 7 years ago

Avfoundation won't let you grab video from the Xvfb display - only the screen of your Mac. So it's not a direct replacement.

Are you sure you need to grab from Xvfb specifically? If not, you don't need headless at all.

iacobus commented 7 years ago

Hi @leonid-shevtsov, thanks for your work on this tool. Trying to use it to record some RSpec/Capybara tests running on PhantomJS/Selenium, but having the same problem. I can actually reproduce it with the test suite — running rspec spec/integration_spec.rb:19 fails with no specific error message besides the assertion, but if you add a log_file_path and read it you see the error message. This happens with both avconv and ffmpeg, with latest and older versions of both (going back to libav 9.10 and ffmpeg 2.7.2, which based on their CHANGELOGs still support x11grab, but clearly don't?).

I've noticed that the Travis CI build configured for this repo is still passing. That runs on Linux and I see how it runs sudo apt-get install -y libav-tools, but I'm unclear reading the printout on what actual versions are installed. I wonder if you could throw some light here? I'm also confused because these versions are kind of old, so presumably this hasn't been working for a while? Or I'm missing something, which is quite possible given that I know nothing about ffmpeg or avconv.

Thank you!

xgraffm commented 5 years ago

I attempted to use this and specified the path to ffmpeg but headless still complains it can't be found yet i can run ffmpeg from commandline

<Headless:0x00007ff76052e6d0 @display=99, @xvfb_launch_timeout=10, @autopick_display=true, @reuse_display=true, @dimensions="1280x1024x24", @video_capture_options={:provider_binary_path=>"/usr/local/bin/ffmpeg"}, @destroy_at_exit=true, @pid=18221, @old_display="/private/tmp/com.apple.launchd.7tpGUVqPN2/org.macosforge.xquartz:0", @at_exit_hook_installed=true>

(byebug) continue

Error Message: /usr/local/bin/ffmpeg not found on your system. Install it or change video recorder provider
Stacktrace: 

> 698 | headless.video.start_capture
gustiando commented 5 years ago

@leonid-shevtsov any ideas? I'm getting the same issue and not sure of how to go about getting headless to work on OSX.