Commit fa3677a1 authored by Guillaume Lebigot's avatar Guillaume Lebigot

Added ffmpegPath parameter to findFPS function for module use

parent 531a7f8e
# CHANGELOG
## 1.0.5
- Made findFPS function accept a ffmpegPath parameter (defaults to 'ffmpeg')
## 1.0.2 -> 1.0.4
- Fixed various bugs about templates (see commits)
## 1.0.2
- Added proper type definitions when used as a module
......
{
"name": "toyunda2ass",
"version": "1.0.4",
"version": "1.0.5",
"description": "Convert Epitanime Toyunda karaoke files to ASS files",
"main": "dist/index.js",
"bin": {
......
......@@ -40,9 +40,9 @@ export function splitTime(txt: string): ToyundaData {
}
}
export async function findFPS(videoFile: string): Promise<number> {
export async function findFPS(videoFile: string, ffmpegPath = 'ffmpeg'): Promise<number> {
try {
const result = await execa('ffmpeg', ['-i', videoFile, '-vn', '-f','null', '-'], { encoding : 'utf8' });
const result = await execa(ffmpegPath, ['-i', videoFile, '-vn', '-f','null', '-'], { encoding : 'utf8' });
const outputArray = result.stderr.split(' ');
const indexFPS = outputArray.indexOf('fps');
let fps = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment