ffmpeg snap compatibility is broken by ffplay naming convention
psigen opened this issue · comments
I was able to get reStream working very easily on Ubuntu with only the following two snaps:
sudo snap install ffmpeg lz4
However, the ffmpeg snap packages ffplay as ffmpeg.ffplay
, so I had to manually edit reStream.sh
to use that instead of the default command ffplay
. I was wondering if there was a reasonable way to support this use, since it's really nice to only depend on two confined snaps from an installation perspective.
Here are some options:
- Add a CLI option to specify an alternate ffplay executable:
reStream.sh --ffplay-cmd "ffmpeg.ffplay"
- Read an environment variable like
RESTREAM_FFPLAY_CMD
to override the default command - Always try
ffplay
first and thenffmpeg.ffplay
- Does the normal
ffmpeg
have an alias forffmpeg.ffplay
? If so, default to that instead in the script. - Is there some way to use
ffplay
from the snap? Here is the package description.
My suggestion would be to alias ffplay as ffmpeg.ffplay instead of modifying the script.
Just so I know, why are you using snap installs and not direct host versions if you're on Ubuntu ?
sudo apt-get install ffmpeg lz4
isn't working ? I would find it strange.
There are a few reasons why someone would want to use snap installs
- snaps include all dependencies, which is very useful if ffmpeg gets finicky w.r.t. upstream library versioning
- installing an up-to-date ffmpeg on an older ubuntu machine often requires additionally adding a PPA, while the snap repository works the same across different ubuntu/debian versions
- snaps are automatically updated via snap refreshes, so this is useful on managed systems where admins don't want to handle to run
apt-get upgrade
- snaps are a preferred package in a hermetic ecosystem like Ubuntu Core
So there are a number of reasons why people use snaps. You can read more about them here: https://snapcraft.io/docs
Thanks 👍
Feel free to make a PR to put the ffplay and ffmpeg executables in an environment variable. However it is also easily fixable by replacing the ffplay command in the script.
I'll close this issue for now at has been open for quite a while 🙂