-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Description
Hello,
I have a few things about the headless gem and video recording.
- How can I hide the mouse cursor?
- In method stop_and_save in VideoRecorder class good option is add mkdir_p before mv
def stop_and_save(path)
Recorder::CliUtil.kill_process(@pid_file_path, :wait => true)
if File.exists? @tmp_file_path
begin
**FileUtils.mkdir_p(File.dirname(path))**
FileUtils.mv(@tmp_file_path, path)
rescue Errno::EINVAL
nil
end
end
end
what do you think?
- In method command_line_for_capture in VideoRecorder class is a small bug:
Before (look on @Devices position in array):
[
CliUtil.path_to(provider_binary_path),
"-y",
"-r #{@frame_rate}",
"-s #{dimensions}",
"-f x11grab",
@devices,
"-i :#{@display}",
group_of_pic_size_option,
"-vcodec #{@codec}",
@extra,
@tmp_file_path
].flatten.compact.join(' ')
After:
[
CliUtil.path_to(provider_binary_path),
"-y",
"-r #{@frame_rate}",
"-s #{dimensions}",
"-f x11grab",
"-i :#{@display}",
@devices,
group_of_pic_size_option,
"-vcodec #{@codec}",
@extra,
@tmp_file_path
].flatten.compact.join(' ')
Could you fix it?
- Good idea is add something like post_processing_video method or yield that will be triggered in method stop_and_save before
FileUtils.mv(@tmp_file_path, path)command. For instance:
def stop_and_save(path, &block)
Recorder::CliUtil.kill_process(@pid_file_path, :wait => true)
if File.exists? @tmp_file_path
begin
FileUtils.mkdir_p(File.dirname(path))
yield(@tmp_file_path) if block_given?
FileUtils.mv(@tmp_file_path, path)
rescue Errno::EINVAL
nil
end
end
end
This solution will be very helpful for add watermark or other operation after recording.
What do you think?
- Last one question: how can I stop recording from bash or external script if I know screen number?
Best Regards
Peter
Metadata
Metadata
Assignees
Labels
No labels