]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Screencaster improvements
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 16 Aug 2023 00:22:26 +0000 (21:22 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 16 Aug 2023 00:22:26 +0000 (21:22 -0300)
screencaster

index 9718528e377e337f63a54c718b565964ee158432..72b766f14d0dee1d01e74279dcfb9c1d619f0199 100755 (executable)
@@ -1,7 +1,13 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Screencast recorder
+#
 # See https://links.fluxo.info/bookmarks/rhatto/screencast
+#     https://askubuntu.com/questions/4428/how-can-i-record-my-screen
+#     https://github.com/dilawar/Scripts/blob/master/record_my_desktop.sh
+#     https://trac.ffmpeg.org/wiki/Capture/Desktop
+#     https://andreafortuna.org/2019/09/20/how-to-record-screen-on-linux-from-command-line/
+#     https://superuser.com/questions/510985/how-can-i-crop-a-video-to-a-part-of-the-view
 #
 
 # Parameters
@@ -15,8 +21,15 @@ if [ -z "$OUT" ]; then
   exit 1
 fi
 
+# Calculate
+Xaxis=$(xrandr -q | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1)
+Yaxis=$(xrandr -q | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2)
+
 # Dispatch with vertical offset
 #ffmpeg -f x11grab -r 25 -s 1366x752 -i :0.0+0,16 -vcodec libx264 -vpre lossless_ultrafast -threads 0 $OUT
 
 # Dispatch
-ffmpeg -f x11grab -r 25 -s 1366x752 -i :0.0 -vcodec libx264 -vpre lossless_ultrafast -threads 0 $OUT
+#ffmpeg -f x11grab -r 25 -s 1366x752 -i :0.0 -vcodec libx264 -vpre lossless_ultrafast -threads 0 $OUT
+
+# Run
+ffmpeg -f x11grab -s $(($Xaxis))x$(($Yaxis)) -r 25 -i :0.0 -qscale 0 $OUT