async-ffmetadata is a module that gives you the possability to edit metadata for music and video files using the ffmpeg cli with nodejs
To run this nodemodule you need to install ffmpeg on you machine. It can be downloaded from here: ffmpeg Download
npm i async-ffmetadata
// or
yarn add async-ffmetadata
import { getMetaDataFromFile, setMetaDataToFile } from 'async-ffmetadata'
const inFilePath = "/path/to/File"
// Gives back the metadata of the file as object
getMetaDataFromFile(inFilePath)
.then((metaData) => {
console.log(metaData)
})
const outFilePath = "/path/to/NewFile"
const metaData = {
title: "New Cool title"
}
// Saves the File as Copy with the added Metadata
setMetaDataToFile(metaData, inFilePath, outFilePath)
.then((success) => {
if (success === true) console.log("File written")
else if (success === false) console.log("File not written")
})
In the case of a bug report, bugfix or a suggestions, please feel very free to open an issue.
Pull requests are always welcome, and I'll do my best to do reviews as fast as I can.
This project is licensed under the MIT License
- Contact me on [email protected]
- If appropriate, open an issue on GitHub
I searched for a easy to use way to write and read metadata with nodejs for a diffrent project. So i made this.