ffmpegwasm / ffmpegwasm/ffmpeg.wasm

How to get images for each frame of a video, without file writing operations

未关闭
#298 2 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C
星标
17.8k
派生
1.1k
PR 合并指标
30 天内没有已合并 PR

描述

## On web, it takes very long time for get much frame of a video(100 frame from a mp4 file, size:3.3MB, length: 10s, 1280*720, takes 20-30 seconds),

I read the exact procedure,
* Frame extraction task about 300ms
* write file maybe taks 25 seconds

some info
* MacBook Pro (15-inch, 2017)
* 2.8 GHz 4 Core Intel Core i7
* 16 GB 2133 MHz LPDDR3
* Radeon Pro 555 2 GB
* Intel HD Graphics 630 1536 MB
* Chrome 96.0.4664.110(Stable) (x86_64)

code:

```javascript
await ffmpeg.run('-i', name, '-vf', `select='between(t\,0\,99)`, '-vsync', '0','frames%d.jpg')
```

## Can i quickly read each frame by Memory , like:

```javascript
// await ffmpeg.run('-i', name, '-vf', `select='between(t\,0\,99)`, '-vsync', '0','frames%d.jpg')
const frameArray
await ffmpeg.run('-i', name, '-vf', `select='between(t\,0\,99)`, '-vsync', '0', frameArray)
frameArray.length // 100
frameArray[10] // a image obj or a image blob
```

## solutions now:

* i try to use `pipe` but i don't know how to use is
* now, i use `ffmpeg -i ./test.mp4 -vf 'fps=1/0.1:round=zero:start_time=0,scale=1280x720,tile=10x10' M%d.jpg`
* Faster than before, but still takes a long time

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。