mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
nix: rename custom -> packages
This commit is contained in:
parent
754882bf0d
commit
afc2eea47a
24 changed files with 1 additions and 1 deletions
42
nix/packages/ffgun.nix
Normal file
42
nix/packages/ffgun.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# adapted from https://github.com/neXromancers/hacksaw
|
||||
|
||||
{
|
||||
writeShellApplication,
|
||||
shotgun,
|
||||
ffmpeg_5-full,
|
||||
}:
|
||||
|
||||
writeShellApplication {
|
||||
name = "ffgun";
|
||||
runtimeInputs = [
|
||||
shotgun
|
||||
ffmpeg_5-full
|
||||
];
|
||||
text = ''
|
||||
dir=/tmp
|
||||
current=$(date +%F_%H-%M-%S)
|
||||
|
||||
echo "$dir/$current.mp4"
|
||||
|
||||
hacksaw -n | {
|
||||
IFS=+x read -r w h x y
|
||||
|
||||
w=$((w + w % 2))
|
||||
h=$((h + h % 2))
|
||||
|
||||
ffmpeg \
|
||||
-v 16 \
|
||||
-r 30 \
|
||||
-f x11grab \
|
||||
-s "''${w}x''${h}" \
|
||||
-i ":0.0+$x,$y" \
|
||||
-preset slow \
|
||||
-c:v h264 \
|
||||
-pix_fmt yuv420p \
|
||||
-crf 20 \
|
||||
"$dir/$current.mp4"
|
||||
}
|
||||
'';
|
||||
|
||||
meta.description = "Shotgun's integration script with ffmpeg from their github";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue