ffmpeg.wasm
ffmpeg.wasm copied to clipboard
Proposed Encoders / Decoders Libraries
So far only following encoders / decoders libraries are supported:
Update at 2020/11/24
Video
- [x] mp4 (x264)
- [x] mp4 (x265)
- [x] webm (libvpx)
- [x] ogv (theora)
- [x] mpeg-1 (native)
- [x] mpeg-2 (native)
- [x] aom (av1 / avif) (only in next version, see comments below)
Audio
- [x] mp3 (lame)
- [x] aac (fdk-aac)
- [x] wav/wv (wavpack)
- [x] ogg (vorbis)
- [x] opus (opus)
- [x] flac (native)
Image
- [x] gif (native)
- [x] webp (libwebp)
Others
- [x] font files (freetype)
- [x] *.srt, *.ass subtitle files (libass) (sample code HERE)
If you there is any library you would like to add:
- If it already exists in the replies, simply give an emoji to upvote
- If it doesn't exist, you can reply this issue to propose.
I will check this issue periodically to decide which library to integrate next, or identify which is NOT possible to integrate at the moment.
RTSP
x265 / h265
mpeg-1
mpeg-2
AAC and WAV
- AAC is a common audio codec for videos, and probably the next widest supported audio codec after MP3.
- WAV is a common lossless audio format.
I don't know how WASM works, but here's how you usually use encode to AAC or WAV with FFmpeg:
AAC:
-c:a libdfdk_aac (requires FFmpeg to be compiled with fdk-aac) or -c:a aac (the native FFmpeg AAC encoder). lidfdk_aac is preferred as it's a higher quality AAC encoder.
This may be useful: https://trac.ffmpeg.org/wiki/Encode/AAC
WAV:
-c:a pcm_s16le, -c:a pcm_s24le or -c:a pcm_s32le, where 16, 24 and 32 denote the output audio bit depth.
Ogg please! It's important for game audio, because mp3 doesn't loop properly.
AV1
gif
libwebp
It would be helpful if you could provide some instructions on how to implement these libs so we can make some PRs
Hi all, for the latest version (v0.9.3), more libraries supported has been added. Please check if it helps in your project.
@smashah It would be great if you can send PRs, for integrating new libraries, you can check this repo: https://github.com/ffmpegwasm/ffmpeg.wasm-core.
Also you can check this series of posts to learn more foundation:
- https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-1-preparation/
- https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-2-compile-with-emscripten/
- https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-3-v0.1/
- https://jeromewu.github.io/build-ffmpeg-webassembly-version-part-4-v0.2/
Thank you so much for creating this!
AVIF please! The AV1 standard is gaining support in the industry and is also used as a single frame "film" as an image format for the web: AVIF. Chrome is supporting it, cloudflare is supporting it and on https://blog.cloudflare.com/generate-avif-images-with-image-resizing/ Cloudflare gives a list of good reasons why both Intel and Apple is jumping on the AVIF (single frame AV1) wagon.
For AV1, in fact I have successfully integrated into ffmpeg.wasm, but there are two main issues:
- It takes more than a minute to transcode an one second video
- It adds 2 extra MB to ffmpeg-core.wasm
So right now I disable it as it is not usable for now. For AVIF, I will check if it is slow as well.
I would love more focus on audio side of things, I am not sure if it's covered with theora or vorbis. So Opus and Flac. I mentioned vorbis ogg because Opus can be in an ogg container.
@jeromewu 60x to transcode - aw. Hard one. But epic that you have already looked into it.
Is there any chance to obtain the version with AV1 included even it not being part of the main release?
@mathiasrw
I have published the version with AV1 in the next / 0.9.0-alpha.2 version, you can use it with following ways:
Node
$ npm install @ffmpeg/core@next
# or
$ npm install @ffmpeg/[email protected]
Browser
const ffmpeg = createFFmpeg({
corePath: 'https://unpkg.com/@ffmpeg/[email protected]/dist/ffmpeg-core.js',
});
Hey guys, new / verified libraries are updated, please check and don't forget to upgrade to latest version of ffmpeg.wasm to use them.
Any chance for h264_nvenc and hevc_nvenc (https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/)? Both of these are great and fast combined with nvidia gpus.
@sejbr From what I know, it is impossible to use GPU capabilities right now, these two flags are impossible at the moment.
You mean in web assembly? That's a shame :/.
Thank you for your excelent work @jeromewu 👏👏! if possible add libwebp plis 🙏
@smashah and @EstebanFuentealba libwebp is added in v0.9.6, please check. :smile:
SRT & RIST That would be even more awesome!!
mjpeg
Great work on the library. Can we support RTMP? It would be interesting to see if it's possible to stream from the browser to YouTube or Twitch.
Jpeg2000
I wish that it can work with mxf codec
flv(x265) mpeg2ts(HEVC) mpeg2ps(HEVC)
RTSP
RTSP Support is Now Available ? because you add it this issue but in other issues you said you don't support streaming yet
@amirzenoozi RTSP is still not supported, only the ones in the top of this issue are available. Sorry for the confusion.
please add suppor for libass