Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
The easiest way to get ffmpeg v5 installed through python.
> pip install static-ffmpeg
import static_ffmpeg
# ffmpeg installed on first call to add_paths(), threadsafe.
static_ffmpeg.add_paths() # blocks until files are downloaded
# or static_ffmpeg.add_paths(weak=True) to only add if ffmpeg/ffprobe not already on path
# Now ffmpeg and ffprobe will use static_ffmpeg versions.
os.system("ffmpeg -i myfile.mp4 ...")
Or if you want more lazy behavior to install on first use, or you don't want to modify system paths, use static_ffmpeg
import static_ffmpeg
# ffmpeg installed on first call, threadsafe.
os.system("static_ffmpeg -i myfile.mp4 ...")
You can also use it on the command line
> pip install static-ffmpeg
> static_ffmpeg -i file.mp4 ...
> static_ffprobe ...
> static_ffmpeg_paths
FFMPEG=c:\users\niteris\dev\static_ffmpeg\static_ffmpeg\bin\win32\ffmpeg.exe
FFPROBE=c:\users\niteris\dev\static_ffmpeg\static_ffmpeg\bin\win32\ffprobe.exe
This tool installs binaries for ffmpeg and ffprobe binary (with all plugins and codecs) into the running platform. The platform binaries are installed on first use and is done without requiring elevated permissions.
This package is designed to allow tools that rely on ffmpeg
to have a fully featured ffmpeg
available by just including this package. No seperate install of ffmpeg is needed.
Your ffmpeg tool would have to rely on the user to install ffmpeg
, with the right build settings to ensure your tool functions correctly. This is a major pain for ffmpeg based tools (missing codecs for example) and this library solves this problem.
As of now, binaries are available for:
win32
(Windows)darwin
(MacOS)linux
(From Ubuntu 20LTS)There is both an python api and a command line api. After installing this package the command line aliases will be available:
static_ffmpeg
operates just like ffmpeg
static_ffprobe
operates just like ffprobe
.static_ffmpeg_paths
prints out the paths of the ffmpeg binaries.> static_ffmpeg_paths
FFMPEG=c:\users\niteris\dev\static_ffmpeg\static_ffmpeg\bin\win32\ffmpeg.exe
FFPROBE=c:\users\niteris\dev\static_ffmpeg\static_ffmpeg\bin\win32\ffprobe.exe
Here's how to get the binaries and execute them.
# Using the alias method
import os
# Platform binaries will be installed the first run.
os.system("static_ffmpeg -version") # static_ffmpeg is an alias for this tools ffmpeg.
os.system("static_ffprobe -version")
# Using the program location method
import subprocess
from static_ffmpeg import run
# Platform binaries are installed on the first run of below.
ffmpeg, ffprobe = run.get_or_fetch_platform_executables_else_raise()
# ffmpeg, ffprobe will be paths to ffmpeg and ffprobe.
subprocess.check_output([ffmpeg, "-version"])
subprocess.check_output([ffprobe, "-version"])
git clone https://github.com/zackees/static_ffmpeg
cd static_ffmpeg
tox
To test it in a virtual environment, use this easy helper:
To easily setup a virtual environment, please run
python setupvirtualenv.py
Then run ./activate.sh
to activate the shell.
ffmpeg and ffprobe are both version: 5.0
add_paths(...)
can now be called multiple times without polluting the os env path.add_paths()
now has optional weak
parameter (default False). If True then ffmpeg/ffprobe
binaries are only only if either ffmpeg
OR ffprobe
doesn't already exist on pathstatic_ffmpeg.add_paths()
FAQs
Cross platform ffmpeg to work on various systems.
We found that static-ffmpeg demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.