
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
gatsby-transformer-ffmpeg
Advanced tools
Creates VideoFFMPEG
nodes from locally hosted video files.
npm install --save gatsby-transformer-ffmpeg gatsby-plugin-ffmpeg
// In your gatsby-config.js
module.exports = {
plugins: [`gatsby-transformer-ffmpeg`],
}
Please note that you must have a source plugin (which brings in images) installed in your project. Otherwise no VideoFFMPEG
nodes can be created for your files. The recommended example would be gatsby-source-filesystem
.
Currently it only detects files with the extensions avi
, mp4
, mov
, mkv
. If you have a different container and would like it added, open an issue or create a PR and I'm happy to include it.
Each image file is parsed into a node of type VideoFFMPEG
.
This query generates both webm and h264 mp4 files for every video file found.
{
allVideoFfmpeg {
edges {
node {
webm: transcode(codec: "libvpx-vp9", maxWidth: 900, maxHeight: 480, fileExtension: "webm", outputOptions: ["-crf 20", "-b:v 0"]) {
width
src
presentationMaxWidth
presentationMaxHeight
originalName
height
aspectRatio
}
mp4: transcode(codec: "libx264", maxWidth: 900, maxHeight: 480, fileExtension: "mp4", options:[["-profile:v", "main"], ["-pix_fmt", "yuv420p"]], outputOptions: ["-movflags faststart"]) {
width
src
presentationMaxWidth
presentationMaxHeight
originalName
height
aspectRatio
}
}
}
}
}
In your gatsby-config, have a filesystem source plugin that loads a certain folder for example.
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/packages/resources`,
name: 'resources',
ignore: [`**/\.*`],
},
},
With a video file in packages/resources/videofile.mp4
we will be able to grab the following:
{
file(relativePath: {eq: "videofile.mp4"}) {
childVideoFfmpeg {
mp4: transcode(maxWidth: 900, maxHeight: 480, fileExtension: "mp4", codec: "libx264", options:[["-profile:v", "main"], ["-pix_fmt", "yuv420p"]], outputOptions: ["-movflags faststart"]) {
width
src
presentationMaxWidth
presentationMaxHeight
originalName
height
aspectRatio
}
}
}
}
Work on gatsby-transformer-ffmpeg
is funded by Electric UI. If you need to design an Arduino GUI, want visualisations for a complex robotics system or generally need a user interface for your hardware project, please take a look at the website.
FAQs
Gatsby transformer plugin for video using FFMPEG
The npm package gatsby-transformer-ffmpeg receives a total of 16 weekly downloads. As such, gatsby-transformer-ffmpeg popularity was classified as not popular.
We found that gatsby-transformer-ffmpeg demonstrated a not healthy version release cadence and project activity because the last version was released 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
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.