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
190 stars 17 forks source link

Recording more than one window (parallel executions) #83

Open Rajagopalan-M opened 4 years ago

Rajagopalan-M commented 4 years ago

As I have already informed you, I am recording more than one windows here.

I just rearranged the code to take each window per recorder like shown below

recorders= ["one.exe", "two.exe", "three.exe", "four.exe", "five.exe"]

From this array, when every window opens, my program picks up one recorder for one window, Like

      ScreenRecorder.ffmpeg_binary = File.expand_path("VideoRecorder/#{recorder}")

But still it's not recording properly, the video is not continuously running, it stops at the first page and then suddenly, five page is coming. Do you have any clue as to why it happens?

kapoorlakshya commented 4 years ago

@Rajagopalan-M Can you share more of your code so I can reproduce this locally?

Rajagopalan-M commented 4 years ago

@kapoorlakshya

Hi, it's simple, Just run the automation in 5 browser simultanously and record all the window, this happens. For an example,

a=[] 5.times do a<<Thread.new do require 'watir' recorder = ScreenRecorder::Window.new(title: ScreenRecorder::Titles.fetch('chrome').last........ recorder.start b.goto "you url" "your code here(make atleast 30 lines of code, so that you can record and see)" end end

a.each(&:join)

kapoorlakshya commented 4 years ago

@Rajagopalan-M Thanks!

the video is not continuously running, it stops at the first page and then suddenly, five page is coming.

Do you have a different output file for each of the browser sessions?

Rajagopalan-M commented 4 years ago

Yes, 5 browsers are being recorded at the same time and it saves 5 files. If you still want an perfect example, I will automate my electricity bill payment flow and give you for your reference. Your video recording software perfectly works for sequential execution but it is not working for parallel execution. If you include this option, then it would be great.

kapoorlakshya commented 4 years ago

Yeah, it'll be nice to record parallel test executions.

Can you explain the following behavior a bit more?

it stops at the first page and then suddenly, five page is coming.

Rajagopalan-M commented 4 years ago

Video is moving but you can see only the first page in the video and after such a long time, suddenly last page shows up and then video ends there.

kapoorlakshya commented 4 years ago

Got it. I have an idea how to implement support for this, but will need to experiment before I can promise anything.

Rajagopalan-M commented 4 years ago

sure thing! Thank you very much for taking this forward