Within my Electron Angular project, I want to preview a video file which is stored locally on Windows / MacOS within a frame, like this:
On the left side, currently, there is a placeholder image. But i want to have a snapshot out of the video, it is not important at which position of the video this is taken.
Our attempt at the moment is to use fluent-ffmpeg library from npm:
var ffmpeg = require('fluent-ffmpeg');
let command = new ffmpeg({source: "MY_VIDEO_PATH"}).inputOptions('-protocol_whitelist file,http,https,tcp,tls,crypto')
command.takeScreenshots({
count: 1,
timemarks: ['5%'],
filename: "MY_FILENAME"
}, "DESTINATION_FOLDER_PATH_FOR_THUMB");
It takes the screen after 5% of the video would have been played. However, this requires ffmpeg executable to be present, which actually costs more space for the application as we want to use.
So: Can i pick out a screenshot out of a video file without using additional executables like ffmpeg? If there are some suitable npm libaries, this would be also fine, as they are a lot smaller.