How to get Kdenlive speech to text & python working?

I am using Kdenlive and trying to use its speech to text module that requires python and pip3. 2 problems happen
The first problem is that the python tab does not appear in the Environment section in settings.

Compare this to the screenshot on their official site or the flatpak version

The second problem is that kdenlive cannot seem to run its python script using whatever python it detects. If I only install python3, kdenlive tells me it doesn’t detect pip3.
If I install python312Packages.pip this warning pops up twice instead

Does anyone know how I can configure this to make it work?
The flatpak version also cannot detect python so if there’s a way to make it work that way instead please do tell.

Figured it out.
First I have to use kdenlive from kdePackages instead of just the default one so that it uses qt6 I assume. This way the python tab actually appears in the environment section.
Then install the needed python packages (pip, numba, vosk, openai-whipser, etc) using python3.withPackages so that kdenlive and the python modules themselves can find each other.

mind sharing the config for that? I tried the following, but says: undefined variable 'vosk'

{ pkgs, inputs, ... }:
{
  environment.systemPackages = with pkgs; [
    kdePackages.kdenlive
    kdePackages.breeze
    (python3.withPackages (python-pkgs: with python-pkgs; [
      pip
      vosk
    ]))
  ];
}

never mind. I managed to get openai-whisper working with this config:

{ pkgs, config, ... }:
let 
  srt_equalizer = pkgs.python3Packages.buildPythonPackage
  rec {
    pname = "srt_equalizer";
    version = "0.1.10";
    pyproject = true;

    src = pkgs.fetchPypi {
      inherit pname version;
      sha256 = "sha256-X2sbLEixK7HKqxOCLX3dClSod3K4JKCqK6ZMAz03k1M=";
    };
    doCheck = false;
    nativeBuildInputs = [
      pkgs.python3Packages.poetry-core
    ];
    propagatedBuildInputs = [
      pkgs.python3Packages.srt
    ];
  };
in
  {
    environment.systemPackages = with pkgs; [
      kdePackages.kdenlive
      kdePackages.breeze
      (python3.withPackages (python-pkgs: with python-pkgs; [
        pip
        openai-whisper
        srt
        srt_equalizer
        torch
      ]))
    ];
  }

had to package srt_equalizer because it is not in nixpkgs

1 Like

How did you manage to install the speech model you wanted to use?
Before using this config, nothing would show up when clicking ‘manage models’.
With this installed it shows the options, but clicking install does nothing at all.
How did you get this working?
Thank you :]

Sorry, turned out I spoke too early in my first response. In the end I just separately used openai whisper in nixpkgs, and copied the resulting subtitle file into kdenlive

I only clicked on ‘Whisper’ and selected the the Model and Language. See Screenshot.