Skip to content

Commit

Permalink
feat: video encoding utilities configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
radoslawgrochowski committed Oct 1, 2024
1 parent 54c534e commit 63aac17
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
./presets/nixos.nix
./presets/terminal.nix
./modules/docker
./modules/video
];
specialArgs = commonSpecialArgs;
};
Expand Down
1 change: 1 addition & 0 deletions modules/nvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let
};
in
{
environment.variables.EDITOR = nvim-rg;
home-manager.users."${username}" = {
programs.bash.shellAliases = aliases;
programs.fish.shellAliases = aliases;
Expand Down
28 changes: 28 additions & 0 deletions modules/video/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ pkgs, username, ... }:
let
ffmpeg-nice = pkgs.writeShellApplication {
name = "ffmpeg-nice";
runtimeInputs = [ pkgs.ffmpeg-full ];
text = /* shell */ ''
set -o xtrace
output="''${1%.*}_NICE.mp4"
ffmpeg \
-i "$1" \
-n \
-c:v libx265 \
-crf 20 \
-preset slow \
-c:a aac -b:a 192k \
-maxrate 4000k -bufsize 8000k \
-movflags use_metadata_tags+faststart \
-map_metadata 0 \
"$output"
'';
};
in
{
users.users."${username}".packages = [
pkgs.ffmpeg-full
ffmpeg-nice
];
}

0 comments on commit 63aac17

Please sign in to comment.