Open ThatOneCalculator opened 2 years ago
What should we record with? I've had mixed results with wf-recorder
and regions/audio/odd-dimensions.
What about OBS headless?
Didn't even know that was a thing, but sure sounds great.
any progress on this?
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.
Hello bumping this issue,
What should be better wf-recorder or wl-screenrec
wl-screenrec looks promising. What can be the caveats on both.
Based on the benchmark, wl-screenrec
would be more sensible to use. As for the caveats, I don't know.
I tried wl-screenrec
and it works pretty great
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!
Seems that the easiest way to get a tray indicator is with yad
yad doesn't work natively on wayland https://github.com/v1cont/yad/issues/216
And even if I use GDK_BACKEND=x11 yad
it still doesn't work for me.
Screen recording with
xdg-desktop-portal-wlr
would be cool cuz Kooha sucks on Hyprland lol