From cc314c37a67178d0037f193628e131269d328f39 Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 9 Mar 2023 21:29:56 -0600 Subject: [PATCH] Use libopus for ffmpeg --- dev.toml | 1 + flake.nix | 6 +++++- pict-rs.toml | 4 ++-- shell.nix | 16 ---------------- src/ffmpeg.rs | 2 +- 5 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 shell.nix diff --git a/dev.toml b/dev.toml index c44c2ba..f62d2eb 100644 --- a/dev.toml +++ b/dev.toml @@ -21,6 +21,7 @@ max_height = 10000 max_area = 40000000 max_file_size = 40 enable_silent_video = true +enable_full_video = true filters = ['blur', 'crop', 'identity', 'resize', 'thumbnail'] skip_validate_imports = false cache_duration = 168 diff --git a/flake.nix b/flake.nix index d79fc5a..8426e76 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,10 @@ default = dev; }; - devShell = pkgs.callPackage ./shell.nix { }; + devShell = with pkgs; mkShell { + nativeBuildInputs = [ cargo cargo-outdated cargo-zigbuild clippy gcc protobuf rust-analyzer rustc rustfmt ]; + + RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; + }; }); } diff --git a/pict-rs.toml b/pict-rs.toml index 50f1d0b..e612d83 100644 --- a/pict-rs.toml +++ b/pict-rs.toml @@ -161,11 +161,11 @@ enable_full_video = false ## Optional: set the default video codec # environment variable: PICTRS__MEDIA__VIDEO_CODEC -# default: h264 +# default: vp9 # # available options: av1, h264, h265, vp8, vp9 # this setting does nothing if video is not enabled -video_codec = "h264" +video_codec = "vp9" ## Optional: set the default audio codec # environment variable: PICTRS__MEDIA__AUDIO_CODEC diff --git a/shell.nix b/shell.nix deleted file mode 100644 index df89250..0000000 --- a/shell.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs -, mkShell -, cargo -, clippy -, gcc -, protobuf -, rust-analyzer -, rustc -, rustfmt -}: - -mkShell { - nativeBuildInputs = [ cargo clippy gcc protobuf rust-analyzer rustc rustfmt ]; - - RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; -} diff --git a/src/ffmpeg.rs b/src/ffmpeg.rs index 3da0757..0e9693a 100644 --- a/src/ffmpeg.rs +++ b/src/ffmpeg.rs @@ -310,7 +310,7 @@ impl AudioCodec { const fn to_ffmpeg_codec(self) -> &'static str { match self { Self::Aac => "aac", - Self::Opus => "opus", + Self::Opus => "libopus", Self::Vorbis => "vorbis", } }