I use javascript, Vue 3 and FFmpeg version:
"@ffmpeg/core": "^0.11.0",
"@ffmpeg/ffmpeg": "^0.11.6",
I have a function that cuts videos based on times entered by the user:
async videoTrim() {
this.ffmpeg.FS("writeFile", "video.mp4", await fetchFile(videoData.source));
await this.ffmpeg.run(
"-ss", startTime,
"-i", "video.mp4",
"-to", endTime,
"-crf", "23",
"-c:v", "copy",
"-c:a", "copy",
"-reset_timestamps", "1",
"-avoid_negative_ts", "1",
"videoNew.mp4",
)
return this.ffmpeg.FS("readFile", "videoNew.mp4");
}
PROBLEM:
I need to find out the percentage progress during video trimming so that I can give the user information about how long the trimming will take
(If you have any comments or suggestions for improving the function this.ffmpeg.run
, please let me know)