helloSystem / Utilities

Utilities written in PyQt5, meant for use with helloSystem
BSD 2-Clause "Simplified" License
27 stars 29 forks source link

Screencast utility #36

Open probonopd opened 3 years ago

probonopd commented 3 years ago

Add a Screencast utility that does something sensible to get good audio quality, e.g.,

#!/bin/sh

# Sound filters from
# https://dsp.stackexchange.com/questions/22442/ffmpeg-audio-filter-pipeline-for-speech-enhancement

PCM=/dev/$(cat /dev/sndstat | grep rec | tail -n 1 | cut -d ":" -f 1)
DSP=$(echo "${PCM}" | sed -e 's|pcm|dsp|g')
echo $DSP

if [ -e /tmp/screencast.mp4 ] ; then
  pkill -f ffmpeg
  pkill -f screenkey
  notify-send  "Stopped because /tmp/screencast.mp4 exists"
  sleep 1
  xdg-open /tmp/screencast.mp4
else
  screenkey &
#  ffmpeg -y -thread_queue_size 1024 -f oss -i "${DSP}" -framerate 30 -video_size 1920x1080 -f x11grab -i :0 -c:v libx264 -b:v 2000k -maxrate 2000k -bufsize 5000k -g 50 -flags +global_header -vf format=yuv420p  -filter:a "volume=10" -c:a aac -b:a 128k /tmp/screencast.mp4
  ffmpeg -y -thread_queue_size 1024 -f oss -i "${DSP}" -framerate 25 -f x11grab -i :0 -c:v libx264 -b:v 2000k -maxrate 2000k -bufsize 5000k -g 50 -flags +global_header -vf format=yuv420p -vf scale=-1:720 -af highpass-frequency=300 -af lowpass-frequency=4000 -af "bass=frequency=100:gain=-50" -af "bandreject=frequency=200:width_type=h:width=200" -af "compand=attacks=.05:decays=.05:points=-90/-90 -70/-90 -15/-15 0/-10:soft-knee=6:volume=-70:gain=10" -c:a aac -b:a 128k /tmp/screencast.mp4

fi
probonopd commented 3 years ago

TODO: Port to PyQt5, add a tray menu to select the recording device (which may well be different from the playback device)

probonopd commented 3 years ago

Maybe consider adding an option for oversized cursors (like it is implemented for HiDPI)?

image

grahamperrin commented 3 years ago

From https://github.com/helloSystem/ISO/releases/tag/r0.4.0:

  • Rudimentary screencast recording tool on Ctrl+Alt+R

NB FreeBSD bug 251817 – www/firefox Ctrl-Alt-R should enter Reader view, should not restart Firefox

probonopd commented 3 years ago

This will be reworked from a command line tool into a Menu application:

image