Ffmpeg doesnt work - libslang.so.2 - No such file

I tried to use base core22, core20, core18

If I run:
snap run tryuuid

ffmpeg: error while loading shared libraries: libslang.so.2: cannot open shared object file: No such file or directory

My snapcraft.yamll:

name: tryuuid
base: core22
version: '0.1'
summary:  myapp
description: |
  myapp
grade: devel
confinement: devmode
apps:
  tryuuid:
    command: bin/tryuuid.py
    plugs:
    - pulseaudio
    - home
    - audio-playback
parts:
  tryuuid:
    plugin: python
    source: .
    stage-packages: [ffmpeg]
  part-try:
    plugin: dump
    source: .
    organize:
      tryuuid.py: bin/

this is the Python file tryuuid.py:

import subprocess
import os
rc = subprocess.run("ffmpeg -i /home/element/myfile.mp3 2>&1 | grep -A1 Duration:", shell=True, capture_output=True)
print(rc)
os.system('ffmpeg -version')

You can add missing libraries to the snap by adding their packages to the stage-packages list, but it should have already been fetched and unpacked if ffmpeg depends on it. Also note that having two parts using the same source: location is strange, are you sure this is what you want to do?

Thanks, I found the solution, for some reason ffmpeg doesn’t install libslang2 dependency, its needed to install separately.

    stage-packages: 
      - ffmpeg
      - libslang2