ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Get ffmpeg metadata

Ouverte
#431 3 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
C
Étoiles
17.8k
Forks
1.1k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I would like to obtain `ffmpeg` metadata like

```
ffmpeg -hide_banner -i /root/audio.mp3 2>&1
Input #0, mp3, from '/root/audio.mp3':
Metadata:
Duration: 00:11:25.04, start: 0.025056, bitrate: 66 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, mono, fltp, 64 kb/s
Stream #0:1: Video: png, rgb24(pc), 600x600 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
```

so that to obtain metadata like the duration:

```
ffmpeg -hide_banner -i /root/audio.mp3 2>&1 | grep Duration | cut -d ',' -f1
Duration: 00:11:25.04
```

If I try

```javascript
await ffmpeg.load();
await ffmpeg.FS('writeFile', inAudio, await fetchFile(`/root/${inAudio}`));
await ffmpeg.run(...[
'-i',
inAudio
]);
```

I get an error
```
...
[fferr] [mp3 @ 0x1f65c80] invalid concatenated file detected - using bitrate for duration
[fferr] [mp3 @ 0x1f65c80] Estimating duration from bitrate, this may be inaccurate
[fferr] Input #0, mp3, from '/root/audio.mp3':
[fferr] Metadata:
[fferr] encoder : Lavf58.29.100
[fferr] Duration: 00:06:28.35, start: 0.025057, bitrate: 128 kb/s
[fferr] Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
[fferr] Metadata:
[fferr] encoder : Lavc58.54
[fferr] At least one output file must be specified
[fferr] Conversion failed!
[ffout] FFMPEG_END
```

how to support metadata output only?
Thank you.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.