0.0.2 • Published 3 years ago

media-meta v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

media-meta Build Status Npm Version npm: total downloads Types Dep license

This is a side project of my electron based application. For fonts, audios, videos resources meta data and video screenshot. The default behavior is it will call system-wide ffmpeg(for screenshot) and ffprobe(for media meta) binary, for bundle with electron recommand libs are ffprobe-static-electron and ffmpeg-static-electron, there's a good example application autoEdit_2, Please check https://github.com/OpenNewsLabs/autoEdit_2/blob/master/package.json for configuration of electron-builder

Installation

yarn add media-meta

or

npm i --save media-meta

import { getAudioMetaData, getVideoMetaData, getVideoScreenshot, getFontMetaData } from '../src';

const path1 = path.join(__dirname, 'example/', 'file_example_MP3_1MG.mp3');
const path2 = path.join(__dirname, 'example/', 'big_buck_bunny_240p_1mb.mp4');
const path3 = path.join(__dirname, 'example/', 'OpenSans-Regular.ttf');

const a = await getAudioMetaData(path1);
const b = await getVideoMetaData(path2);
const c = await getVideoScreenshot({ inputPath: path2 });
const d = await getFontMetaData(path3);