-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: video encoding utilities configuration
- Loading branch information
1 parent
54c534e
commit 63aac17
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
]; | ||
} |