kapoorlakshya / screen-recorder

A Ruby gem to video record and take screenshots of your desktop or specific application window. Works on Windows, Linux, and macOS.
MIT License
192 stars 17 forks source link

AVFoundation input device @ 0x7f95d350a000] Configuration of video device failed, falling back to default. #88

Closed Vito300187 closed 4 years ago

Vito300187 commented 4 years ago

Summary

AVFoundation input device @ 0x7f95d350a000] Configuration of video device failed, falling back to default.

Debug Info

I am trying to run tests with notes, but as I see it, the problem is in an undefined video device. How to determine?

Expected Behavior

Run tests and record test run video

Actual Behavior

The test passes, but the video file is empty

@recorder.stop
=> #<FFMPEG::Movie:0x00007fd3265c84c8
 @duration=0,
 @invalid=true,
 @metadata={:error=>{:code=>-1094995529, :string=>"Invalid data found when processing input"}},
 @path="/Users/vitalii-artec3d/Desktop/Work/CRM_specs/downloads/recording.mkv">
**~ ffmpeg -f avfoundation -list_devices 1 -i ""**
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.59)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_3 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags=-fno-stack-check --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[AVFoundation input device @ 0x7fbcd2c01480] AVFoundation video devices:
[AVFoundation input device @ 0x7fbcd2c01480] [0] FaceTime HD Camera
[AVFoundation input device @ 0x7fbcd2c01480] [1] Capture screen 0
[AVFoundation input device @ 0x7fbcd2c01480] [2] Capture screen 1
[AVFoundation input device @ 0x7fbcd2c01480] AVFoundation audio devices:
[AVFoundation input device @ 0x7fbcd2c01480] [0] Built-in Microphone
: Input/output error
kapoorlakshya commented 4 years ago

@Vito300187 Thanks for the bug report. I'm able to reproduce the error on macOS, but haven't had time to figure out the root cause.

I'll look into it further in the coming days.

kapoorlakshya commented 4 years ago

@Vito300187 Can you give it another try? I am unable to reproduce the issue today on the same Macbook using the exact same ffmpeg version 4.2.2, and the unit tests pass as well. It's weird... I am still seeing the following warning in the log, but ffmpeg continues with the default device, whatever that is:

Configuration of video device failed, falling back to default.

The resulting file is playable in VLC as well. This is definitely an issue with ffmpeg and not the gem, but I'll look into it further if you're still experiencing this issue.

Vito300187 commented 4 years ago

@kapoorlakshya I understand the problem. In the mac os catalina system, you need to play with the rights for terminals -

I fixed the problem, the gem works

kapoorlakshya commented 4 years ago

@Vito300187 Ah, that's it! I am able to reproduce it using the Terminal , which doesn't have screen recording permissions, but works fine using RubyMine, which does have the permission.

Glad you figured it out! Closing ticket.

alexhaha123 commented 2 years ago

@kapoorlakshya I understand the problem. In the mac os catalina system, you need to play with the rights for terminals -

  • Goto System Preferences (Apple sign on top left corner, then menu item System Preferences...), click on the
  • Security & Privacy item, then on the Privacy tab.
  • If the Terminal app is listed and is unchecked, click the checkbox, then restart Terminal.app. or Rubymine

I fixed the problem, the gem works

thanks, i fixed the problem use your method!

speeder179 commented 1 year ago

@kapoorlakshya I understand the problem. In the mac os catalina system, you need to play with the rights for terminals -

  • Goto System Preferences (Apple sign on top left corner, then menu item System Preferences...), click on the
  • Security & Privacy item, then on the Privacy tab.
  • If the Terminal app is listed and is unchecked, click the checkbox, then restart Terminal.app. or Rubymine

I fixed the problem, the gem works

it works for me. thanks

slhck commented 2 months ago

In recent versions this has been changed, see Screen & System Audio Recording:

image