Newbie Question: Adding commands

I’m trying to snap my CUDA enabled version FFMPEG and seem unable to include ffprobe???
To run ffprobe I need to enter ffmpeg.ffprobe ? How do I make it execute as just ffprobe ?

apps:
  ffmpeg:
    command: usr/bin/ffmpeg  
  ffprobe:
    command: usr/bin/ffprobe 
    
parts:
  ffmpeg:
    source: ./FFmpeg-master    
    plugin: make    
    organize: 
        usr/local/bin/: usr/bin/

A few points, ffmpeg complies and runs fun, however it installs to /usr/local/bin and I couldn’t figure a way of including the path so I used 'organize" to /usr/bin which is in the wrapper path to execute ffmpeg. ffprobe only runs as ffmpeg.ffprobe not ffprobe which is a problem that is driving me insane.

Time to step away from the keyboard and quiz more experienced heads, many thanks in advance

Refer-to: The snapcraft syntax - Snaps are universal Linux packages

If the app name matches the snap name, the app will be executed when the
name of the snap is called. Otherwise, the executable will have the snap
name and a dot prefixed to the app name.

You may only make one and only one app directly runnable by calling its name by naming the app to be exactly the same as the snap name. This is snapd’s current limitation.

UPDATE: Refer https://forum.snapcraft.io/t/newbie-question-adding-commands/6925/4

Is there any reason ffprobe have to be run as ffprobe instead of _snap_name_.ffprobe?

If having ffprobe as a standalone command is essential for you, you can request an alias.
See:

1 Like

SOLVED: Thank you everyone for the replies. I have a number of different video tools that use ffprobe to scrap off essential information for certain weird and wonderful variations of the so-called same video formats.

As much as I understand the logic behind it, you would think an option to alias within the ‘snapcraft.yaml’ is essential so the snap worked out of the box on install. And not expect the poor end-user to read the docs and have to add the alias for themselves? Perhaps this will change in the later iterations?

According to @zyga-snapd’s comment, it can be set automatically by the store via assertions after a review process.

so if my snap ships ffprobe too … and @Lin-Buo-Ren’s as well, who would own the alias then ? my snap might even ship an ancient ffmpeg (because “ancient video editor” that ships it alongside in the ancient-video-editor snap only works with this specific version) while lin ships the latest git master (that his shiny-video-player snap requires to work) and you ship some stable release in awesome-cuda-tool.snap …

… to overcome such a battle between different snaps you need to have a single authority that defines what the default alias for a well known command is, which is why this can only be managed by the store or locally being overridden by the user. if you would allow all snapcraft.yaml’s to define aliases without the namespacing of <snap>.<appname> you’d end up with a mess of potentially incompatible commands pretty quickly. a user can at any time set an alias manually using the snap alias command to make a snap-shipped-binary the default … if you think your ffmpeg version should be the one everyone uses as default you can request (in this forum) that a default alias for it gets set in the store for all snap users.

1 Like