kRHYME7 / Hyde-cli

A HyDE CLI, wrapper, tweaks , workarounds, and more!
https://github.com/prasanthrangan/hyprdots
GNU General Public License v3.0
56 stars 4 forks source link

Simple Script to record screen #9

Closed se7en-x230 closed 5 months ago

se7en-x230 commented 5 months ago

Having a simple screen recorder available would be appreciated.

kRHYME7 commented 5 months ago

Hello! For the meantime, I will implement the screencorder using wf-recorder as it just works for the majority.
As wl-screenrec needs some setting-up of vaapi for some devices. This might cause a bunch of issues.

kRHYME7 commented 5 months ago

Hello dunno if this is simple but here you go.

❯ Hyprdots run screencap
Screenrecord: 'wl-screenrec'
Screenshot: 'grimblast'

[Usage] Hyprdots run screencap [option]

-pa|--print-all                 󰄀 Print all outputs
-ra|--record-all                󰃽 Record all outputs if supported by the screenrecorder, default to focused monitor
-ps|--print-snip                󰄀 Drag to manually snip an area
-rs|--record-snip               󰃽 Drag to manually snip an area to screen record it
-f|--freeze                     󰄀 Frozen screen, drag to manually snip an area
-pm|--print-monitor             󰄀 Print focused monitor
--stop                           Stop every instance of Screencap

For Screen Recording you can pass an argument (--help for for options for 'wl-screenrec' )
Example you can append [--audio] to capture audio.

For now we have two options for screen recording

-rs|--record-snip               󰃽 Drag to manually snip an area to screen record it
-ra|--record-all                󰃽 Record all outputs if supported by the screenrecorder, default to focused monitor

I did not add focused monitor yet as I don't have an extra monitor yet

se7en-x230 commented 5 months ago

Amazing work. Thanks works fine

se7en-x230 commented 5 months ago

https://github.com/kRHYME7/Hyprdots-ctl/assets/69777713/01f19670-d189-41d4-89ba-2ff8f172f314

Added a notify-send to see that something is happening

bind = $mainMod, o, exec, notify-send "Recording" ; Hyprdots run screencap -ra -a

se7en-x230 commented 5 months ago

The video format does not play on android. At least not on Telegram. Whatsapp can play it

kRHYME7 commented 5 months ago

~the file type used is '.mp4'. Can telegram run .mp4? I'll add an option for a manual file extension if the file format mp4 is incompatible.~

Tried it on my phone on Telegram, seems to play. Dunno yet how to replicate it.

what is the output of

cat ~/.cache/hyprdots-ctl/screencap
se7en-x230 commented 5 months ago

! Oh no! wl-screenrec is not working for you. Do not worry we will use wf-recorder instead. Try to run 'wl-screenrec' in termianl.

screen_recorder="wf-recorder"

kRHYME7 commented 5 months ago

Have you tried using wl-screenrec on terminal? It says that wl_screenrec is not working.

wl-screenrec is better than wf-recorder according to their github readme.

~I will test wf-recorder to see if it has different formatting than wl-screenrec.~

UPDATE:

wf-recorder have caveats. Try to experiment with some flags for wf-recorder Hyprdots run screencap --record-all --help

I get compatablity with telegram by adding some flags Hyprdots run screencap -rs -c h264_vaapi -d /dev/dri/renderD128 with those flags, it tells the wf-recorder that it should use GPU encoding. This is not defaulted because some device do not support it.

BTW if you can get wl-screenrec working tell me.

se7en-x230 commented 5 months ago

Yes I guess it's a codec problem with android I have to look into what exact codec works

se7en-x230 commented 5 months ago

Nope can't get wl-screenrec work at all

kRHYME7 commented 5 months ago

@se7en-x230 Hello, May I ask do you have intel or amd GPU ?

se7en-x230 commented 5 months ago

I am a Intel user as they usually just work under linux

kRHYME7 commented 5 months ago

I think wl-screenrec might work for you. For intel users install this:

libva-intel-driver 
intel-media-driver 

If it does I will add checks to install this packages for screen recording.

se7en-x230 commented 5 months ago

I will test and report tomorrow

se7en-x230 commented 5 months ago

I had to change -ra into -rf (focused) and now it works including sound. That is with wf-recorder

bind = $mainMod, o, exec, Hyprdots run screencap -rf -a bind = $mainMod Shift, o, exec, Hyprdots run screencap --stop

se7en-x230 commented 5 months ago

https://github.com/kRHYME7/Hyprdots-ctl/assets/69777713/66b7cfff-e97b-4768-957e-ea972fe68982