Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions nixos/modules/services/video/epgstation/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ in
description = "epgstation package to use";
};

ffmpeg = lib.mkOption {
default = pkgs.ffmpeg-full;
Copy link
Member

@mweinelt mweinelt May 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it require ffmpeg-full or could it do with e.g. ffmpeg-headless?

The closure size difference is striking. 1.05 GB vs 169 MB.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Practically, it's required for performance reasons. EPGStation streams videos, so it needs hardware accelerated encoding to get acceptable performance. ffmpeg-headless drops support for those, which is a deal breaker for this use case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardware acceleration usually comes via VAAPI or VDPAU/NVENC/NVDEC, all of which are support by ffmpeg-headless, so I'm not sure what you are missing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed that. Last time I checked, ffmpeg-headless didn't support libmfx and I misremembered that as not having support for hardware acceleration in general.

I'll fix it in #233053.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use mkPackageOption

type = lib.types.package;
defaultText = lib.literalExpression "pkgs.ffmpeg-full";
description = "ffmpeg package to use for encoding";
};

usePreconfiguredStreaming = lib.mkOption {
type = lib.types.bool;
default = true;
Expand Down Expand Up @@ -277,6 +284,8 @@ in
package = lib.mkDefault pkgs.mariadb;
ensureDatabases = [ cfg.database.name ];
# FIXME: enable once mysqljs supports auth_socket
# https://github.com/mysqljs/mysql/issues/1507
#
# ensureUsers = [ {
# name = username;
# ensurePermissions = { "${cfg.database.name}.*" = "ALL PRIVILEGES"; };
Expand All @@ -294,8 +303,8 @@ in
database = cfg.database.name;
};

ffmpeg = lib.mkDefault "${pkgs.ffmpeg-full}/bin/ffmpeg";
ffprobe = lib.mkDefault "${pkgs.ffmpeg-full}/bin/ffprobe";
ffmpeg = lib.mkDefault "${cfg.ffmpeg}/bin/ffmpeg";
ffprobe = lib.mkDefault "${cfg.ffmpeg}/bin/ffprobe";

# for disambiguation with TypeScript files
recordedFileExtension = lib.mkDefault ".m2ts";
Expand Down