This commit is contained in:
NaiJi ✨ 2024-02-18 07:17:50 +04:00
parent bd6215bdf9
commit a4b7bf6456
3 changed files with 23 additions and 3 deletions

View File

@ -224,8 +224,8 @@ bindsym $mod+Shift+M mode "$mode_media"
set $mode_media (p)lay, (u)pdate music, (r)ecord, (s)top
mode "$mode_media" {
bindsym p exec mpv $(xclip -o), mode "default"
bindsym r exec /home/naiji/.local/bin/ffmpeg-util record, mode "default"
bindsym s exec /home/naiji/.local/bin/ffmpeg-util stop && notify-send -e -t 1000 -i video "ffmpeg" "done", mode "default"
bindsym r exec /home/naiji/.local/bin/media-util record, mode "default"
bindsym s exec /home/naiji/.local/bin/media-util stop && notify-send -e -t 1000 -i video "ffmpeg" "done", mode "default"
bindsym u exec mpc clear && systemctl --user restart mpd.service && mpc update && mpc add / && mpc play, mode "default"
# exit system mode: "Enter" or "Escape"

Binary file not shown.

View File

@ -6,6 +6,12 @@ then
exit 1
fi
if [ -z $(which shnsplit) ]
then
echo "Missing shntool package, please install it!"
exit 1
fi
if [ ! -z $1 ]
then
if [ $1 == 'cut' ]
@ -15,7 +21,7 @@ then
if [ $1 == 'shrink' ]
then
ffmpeg -i "$2" -vcodec libx264 -crf 20 -filter:v fps=30 "$3"
ffmpeg -i "$2" -vcodec libx264 -crf 20 -filter:v fps=25 "$3"
fi
if [ $1 == 'record' ]
@ -28,5 +34,19 @@ then
then
kill $(cat ~/.local/share/ffmpeg/recent-recording)
fi
if [ $1 == 'cue' ]
then
shnsplit -f $2 $3
fi
else
echo "cut:"
echo "ffmpeg -i \$2 -ss \$3 -t \$4 -c:v copy -c:a copy \$5"
echo "shrink:"
echo "ffmpeg -i \$2 -vcodec libx264 -crf 20 -filter:v fps=25 \$3"
echo "record:"
echo "ffmpeg -framerate 25 -f x11grab -i :0.0 -f pulse -ac 2 -i 57 ~/Videos/\$(date \"+%F-%N\").mkv &"
echo "cue:"
echo "shnsplit -f \$2 \$3"
fi