【发布时间】:2021-12-18 03:13:34
【问题描述】:
- 在下面的代码中,我想获取前 120 帧。
- 然后我想删除顺序重复的
ffmpeg 有一个 mpdecimate 过滤器,它应该丢弃彼此没有太大差异的帧。
但我不知道是否有 ffmpeg Js 库(或等效的)可以在 p5.js 上下文中执行类似的操作。
function setup() {
frameRate(24)
video = createCapture(VIDEO)
video.size(videoWidth, videoHeight)
video.hide()
createCanvas(canvasWidth, canvasWidth)
}
let frames = []
let uniqueFrames = []
let STOP = false
function draw() {
if (video && video.loadedmetadata && frameCount <= 100) {
frames.push(image(video.get()))
} else if (!STOP) {
STOP = true
uniqueFrames = removeDuplicates(frames)
}
}
【问题讨论】:
标签: javascript image-processing ffmpeg video-processing p5.js