ffmpegwasm / ffmpegwasm/ffmpeg.wasm

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

Aperta
#298 2 commenti 3 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C
Stelle
17.8k
Fork
1.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.