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

Recorder is not working when I upgrade to Chrome 77 version. #80

Closed Rajagopalan-M closed 4 years ago

Rajagopalan-M commented 5 years ago

I have upgraded to Chrome77 version and now your recorder is not working. It throws this error

FFMPEG::Error: [gdigrab @ 0000021f04f5a540] Can't find window 'https://uat.allianz-go.com/login.max?preprocess=true - Google Chrome', aborting. title=https://uat.allianz-go.com/login.max?preprocess=true - Google Chrome: I/O error

ffmpeg.log is here

ffmpeg version N-94960-g53d31e91c5 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9.1.1 (GCC) 20190807 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 35.100 / 56. 35.100 libavcodec 58. 57.100 / 58. 57.100 libavformat 58. 32.104 / 58. 32.104 libavdevice 58. 9.100 / 58. 9.100 libavfilter 7. 58.102 / 7. 58.102 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 [gdigrab @ 0000021f04f5a540] Can't find window 'https://uat.allianz-go.com/login.max?preprocess=true - Google Chrome', aborting. title=https://uat.allianz-go.com/login.max?preprocess=true - Google Chrome: I/O error

kapoorlakshya commented 5 years ago

@Rajagopalan-M I don't think the Chrome version will affect the recorder. Can you share how you're providing the title to the recorder?

Rajagopalan-M commented 5 years ago

@kapoorlakshya

This is the way I am passing the title

@recorder = ScreenRecorder::Window.new(title: ScreenRecorder::Titles.fetch('chrome').last, output: File.expandpath("Output/Video/#{scenario}/#{testCase.first + '' + testCase[1]}.mp4"))

Rajagopalan-M commented 5 years ago

@kapoorlakshya Hi, any update on this? I couldn't upgrade to the newest version of Chrome because of this video recorder. Your recorder works fine in earlier version but not in the newer version.

kapoorlakshya commented 5 years ago

Hi @Rajagopalan-M, the problem is not with Chrome or the recorder. The issue is that your project (test framework I assume) is attempting to start the recorder before the page in the browser is fully loaded. The actual title of the page is AllianzGo - Google Chrome, but the log you shared shows that the URL is being used. This tells us that the page is still loading when the recorder tries to get a handle on the browser window.

The following worked for me once the page was fully loaded:

rec = ScreenRecorder::Window.new(title: "AllianzGo - Google Chrome", output: 'rec.mp4')
rec.start

Try adding @browser.wait (using watir) or some other wait strategy to make sure the page is fully loaded first. Another thing you could do is start the recorder before navigating to your test app:

  1. Launch browser (title will be "New Tab - Google Chrome")
  2. Start recording
  3. Navigate to the app
Rajagopalan-M commented 5 years ago

Hi, it's not happening while it starts the browser. it's happening while it closes the browser.


[gdigrab @ 0000028292b5adc0] Can't find window 'https://uat.allianz-go.com/login.max?preprocess=true - Google Chrome', aborting.
 title=https://uat.allianz-go.com/login.max?preprocess=true - Google Chrome: I/O error
kapoorlakshya commented 5 years ago

Hmm... I am unable to reproduce the issue in Chrome 77. Are you stopping the recorder after closing the window?

kapoorlakshya commented 5 years ago

@Rajagopalan-M I think this error is definitely happening when you start the recorder. I would recommend waiting for the page to load before starting the recorder. Give it a try and let me know if you still get this error.

Rajagopalan-M commented 5 years ago

Okay, I am in vacation now. Once I am back, let me try and let you know. I am using your gem in my framework. And I am using my framework in my many project. So when Chrome upgraded, all the people who uses my framework got this problem.

kapoorlakshya commented 5 years ago

Sounds good! Enjoy your vacation.

Rajagopalan-M commented 5 years ago

I am back. But now another problem is, higher version of chrome has some problem. Can't even open google.com in chrome now. Once chrome people fix this problem, I will get back to you. Until then I use your recent version of gem with Chrome <75. Thanks for supporting.

Rajagopalan-M commented 4 years ago

@kapoorlakshya Hi, I started using chrome 78 and your gem works perfectly. Thanks. Your gem is very useful for me, I have incorporated inside my framework. Videos are good to review the errors.

kapoorlakshya commented 4 years ago

Good :)