Hey guys i am newbie to node and ffmpeg,
Right now i am working on getting different resolution of video with ffmpeg. Its working fine i am getting new converted video. But my question is after original file get converted, new files are getting store in same folder where original file exists.
Can some please please let me know how to not to store converted files into the server? Or its will automatically store video to the folder?
Please help, any help will be appreciated. Thanks in advance
Below is my code
const outOptions: any = VIDEO_OPTIONS.OUTPUT.FFMPEG_OPTIONS[format];
const outPath = pathJoin(dirname(url), `${getFileName(url)}_${outOptions.height}p_${outOptions.bitRate}_${outOptions.fps}fps${VIDEO_OPTIONS.OUTPUT.EXTENSION}`);
await runFfmpeg(['-i', pathJoin(__dirname, '..', url),
'-vf', 'scale=-2:' + outOptions.height, '-c:v', 'h264',
'-profile:v', 'baseline', '-r', outOptions.fps, '-g', outOptions.fps * 2,
'-b:v', outOptions.bitRate, '-f', VIDEO_OPTIONS.OUTPUT.FORMAT, pathJoin(__dirname, '..', outPath), '-y']);
return outPath;
}
This is where ffmpeg command fires
let ffmpeg = spawn(ffmpeg, ffmpegOptions);