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.
Modern Python FFmpeg wrappers offer comprehensive support for complex filters, complete with detailed typing and documentation.
typed-ffmpeg offers a modern, Pythonic interface to FFmpeg, providing extensive support for complex filters with detailed typing and documentation. Inspired by ffmpeg-python
, this package enhances functionality by addressing common limitations, such as lack of IDE integration and comprehensive typing, while also introducing new features like JSON serialization of filter graphs and automatic FFmpeg validation.
graphviz
for visual representation, aiding in understanding and debugging.Please note that the following features are under consideration or development for future releases:
typed-ffmpeg
is currently built with FFmpeg version 6.0 in mind, we are working to ensure compatibility across different FFmpeg versions. Feedback and issue reports are welcome to improve version support.typed-ffmpeg
. Continuous updates will be made to include more complex and varied filters.To install typed-ffmpeg
, simply use pip:
pip install typed-ffmpeg
Note: FFmpeg must be installed on your system.
Note: If you need to install ffmpeg-python
at the same time, use pip install typed-ffmpeg-compatible
to prevent conflicts with the module name.
To enable graph visualization features:
pip install 'typed-ffmpeg[graph]'
Note: This requires Graphviz to be installed on your system.
Here's how to quickly start using typed-ffmpeg
:
import ffmpeg
# Flip video horizontally and output
f = (
ffmpeg
.input(filename='input.mp4')
.hflip()
.output(filename='output.mp4')
)
f
For a more complex example:
import ffmpeg.filters
import ffmpeg
# Complex filter graph example
in_file = ffmpeg.input("input.mp4")
overlay_file = ffmpeg.input("overlay.png")
f = (
ffmpeg.filters
.concat(
in_file.trim(start_frame=10, end_frame=20),
in_file.trim(start_frame=30, end_frame=40),
)
.video(0)
.overlay(overlay_file.hflip())
.drawbox(x="50", y="50", width="120", height="120", color="red", thickness="5")
.output(filename="out.mp4")
)
f
See the Usage section in our documentation for more examples and detailed guides.
This project was initially inspired by the capabilities of GPT-3, with the original concept focusing on using GPT-3 to generate an FFmpeg filter SDK directly from the FFmpeg documentation. However, during the development process, I encountered limitations with GPT-3's ability to fully automate this task.
As a result, I shifted to traditional code generation methods to complete the SDK, ensuring a more robust and reliable tool. Despite this change in approach, both GitHub Copilot and GPT-3 were instrumental in accelerating the development process, providing valuable insights and saving significant time.
I would also like to extend my gratitude to the ffmpeg-python
project, which inspired this project significantly. The API style and design ideas from ffmpeg-python
have been influential, and I have utilized these aspects to shape the development of our SDK.
This project is dedicated to my son, Austin, on his seventh birthday (February 24, 2024), whose curiosity and zest for life continually inspire me.
Feel free to check the Documentation for detailed information and more advanced features.
FAQs
Modern Python FFmpeg wrappers offer comprehensive support for complex filters, complete with detailed typing and documentation.
We found that typed-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.