aboutsummaryrefslogtreecommitdiff
path: root/.scripts/ffmpeg
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-10-22 22:50:02 +0200
committersrdusr <trevorgray@srdusr.com>2023-10-22 22:50:02 +0200
commita4f18086ba7ce108ebb041b9b0c52bf522413000 (patch)
tree8d63a98b329f4af486f38db47d0b6049c6e441d8 /.scripts/ffmpeg
parentbf45ef759815ad7ac3f6423114a96f4d56d1a2a2 (diff)
parent68a2612c8b737f6770a4d23848fe6409ddce7888 (diff)
downloaddotfiles-a4f18086ba7ce108ebb041b9b0c52bf522413000.tar.gz
dotfiles-a4f18086ba7ce108ebb041b9b0c52bf522413000.zip
Add '.scripts/' from commit 'a4ba0376ba73b1bb295d8bb459a4bf2b063ddca9'
git-subtree-dir: .scripts git-subtree-mainline: 03c0cf66468d5e04c0e3559f9f89b5eec28feb9e git-subtree-split: a4ba0376ba73b1bb295d8bb459a4bf2b063ddca9
Diffstat (limited to '.scripts/ffmpeg')
-rwxr-xr-x.scripts/ffmpeg24
1 files changed, 24 insertions, 0 deletions
diff --git a/.scripts/ffmpeg b/.scripts/ffmpeg
new file mode 100755
index 0000000..2258fbd
--- /dev/null
+++ b/.scripts/ffmpeg
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# audio
+A="$(pactl list sources | grep 'analog.*monitor' | awk '{print $2}')"
+# screen size
+S="$(xdpyinfo | grep dimensions | awk '{print $2}')"
+# file name
+N="$(date +"%m-%d-%Y_%I:%M%p").mp4"
+
+# Desktop audio + screen recording
+ffmpeg \
+-s "$S" -r 25 -f x11grab -i :0.0+0,0 \
+-ac 2 ~/"$N"
+
+# ffmpeg can output high quality GIF. Before you start it is always recommended to use a recent version: download or compile.
+
+# ffmpeg -ss 30 -t 3 -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
+
+# This example will skip the first 30 seconds (-ss 30) of the input and create a 3 second output (-t 3).
+# fps filter sets the frame rate. A rate of 10 frames per second is used in the example.
+# scale filter will resize the output to 320 pixels wide and automatically determine the height while preserving the aspect ratio. The lanczos scaling algorithm is used in this example.
+# palettegen and paletteuse filters will generate and use a custom palette generated from your input. These filters have many options, so refer to the links for a list of all available options and values. Also see the Advanced options section below.
+# split filter will allow everything to be done in one command and avoids having to create a temporary PNG file of the palette.
+# Control looping with -loop output option but the values are confusing. A value of 0 is infinite looping, -1 is no looping, and 1 will loop once meaning it will play twice. So a value of 10 will cause the GIF to play 11 times.