Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grimblast: screen recording #5

Open
ThatOneCalculator opened this issue Aug 2, 2022 · 11 comments
Open

grimblast: screen recording #5

ThatOneCalculator opened this issue Aug 2, 2022 · 11 comments

Comments

@ThatOneCalculator
Copy link

ThatOneCalculator commented Aug 2, 2022

Screen recording with xdg-desktop-portal-wlr would be cool cuz Kooha sucks on Hyprland lol

@fufexan
Copy link
Member

fufexan commented Aug 13, 2022

What should we record with? I've had mixed results with wf-recorder and regions/audio/odd-dimensions.

@ThatOneCalculator
Copy link
Author

What about OBS headless?

@fufexan
Copy link
Member

fufexan commented Aug 14, 2022

Didn't even know that was a thing, but sure sounds great.

@rszyma
Copy link

rszyma commented May 28, 2023

any progress on this?

@fufexan
Copy link
Member

fufexan commented May 28, 2023

Nope. I figured we can't really use OBS, as it's inflexible with --startrecording --minimize-to-tray. We could use wf-recorder, but I forgot about this issue. If anyone wants to do it feel free, as I don't have time to do it myself.

@kRHYME7
Copy link

kRHYME7 commented Oct 9, 2023

Hello bumping this issue,

What should be better wf-recorder or wl-screenrec

wl-screenrec looks promising. What can be the caveats on both.

@fufexan
Copy link
Member

fufexan commented Oct 9, 2023

Based on the benchmark, wl-screenrec would be more sensible to use. As for the caveats, I don't know.

@ThatOneCalculator
Copy link
Author

I tried wl-screenrec and it works pretty great

@rszyma
Copy link

rszyma commented Nov 7, 2023

Here's a little script I wrote which uses wl-screenrec. It's bindable to a single key for start/stop. After stoping recording it shows notification that can be clicked to reveal recording in file explorer:

#!/bin/bash

# If wl-screenrec is already running, stop recording.
if pgrep -x "wl-screenrec" > /dev/null; then
    killall -s 2 wl-screenrec
    exit 0
fi

FILE="$(xdg-user-dir VIDEOS)/$(date +'screencast_%Y%m%d%H%M%S.mp4')"
dunstify "Starting screencast" --timeout=1000
wl-screenrec -g "$(slurp)" --filename $FILE &&
ffmpeg -i $FILE -ss 00:00:00 -vframes 1 /tmp/screenrec_thumbnail.png -y &&
printf -v out "`dunstify "Recording saved to $FILE" \
    --icon "/tmp/screenrec_thumbnail.png" \
    --action="default,Open"`" &&

# If the notification is clicked, reveal the recording in default file explorer.
case "$out" in
"default")
    gdbus call --session \
        --dest org.freedesktop.FileManager1 \
        --object-path /org/freedesktop/FileManager1 \
        --method org.freedesktop.FileManager1.ShowItems "['file://$FILE']" ""
    ;;
esac

I also wanted to add a tray icon that appears after starting recording and can be clicked to stop, but I couldn't find any good program to create tray icon. If anyone knows any, let me know!

@ThatOneCalculator
Copy link
Author

Seems that the easiest way to get a tray indicator is with yad

@rszyma
Copy link

rszyma commented Nov 8, 2023

yad doesn't work natively on wayland v1cont/yad#216

And even if I use GDK_BACKEND=x11 yad it still doesn't work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants