Proposed Encoders / Decoders Libraries
jeromewu opened this issue ยท 81 comments
So far only following encoders / decoders libraries are supported:
Update at 2020/11/24
Video
- mp4 (x264)
- mp4 (x265)
- webm (libvpx)
- ogv (theora)
- mpeg-1 (native)
- mpeg-2 (native)
- aom (av1 / avif) (only in next version, see comments below)
Audio
- mp3 (lame)
- aac (fdk-aac)
- wav/wv (wavpack)
- ogg (vorbis)
- opus (opus)
- flac (native)
Image
- gif (native)
- webp (libwebp)
Others
- font files (freetype)
- *.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?
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/core@0.9.0-alpha.2Browser
const ffmpeg = createFFmpeg({
corePath: 'https://unpkg.com/@ffmpeg/core@0.9.0-alpha.2/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. ๐
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
@jeromewu Why is libaom-av1 in WASM implementation so slow? In normal use it's pretty okay speed wise.
Could you try making a build with libsvt-av1 or rav1e? See https://gitlab.com/AOMediaCodec/SVT-AV1 or https://github.com/xiph/rav1e
Just want to see how it performs for you, maybe that's at least a way to implement AV1 support.
For faster (and better) AVIF support there's also https://github.com/kornelski/cavif-rs available based on rav1e, although I don't know if that can be easily merged into ffmpeg.
Is it possible to add support for Avisynth?
@amirzenoozi RTSP is still not supported, only the ones in the top of this issue are available. Sorry for the confusion.
Are there any plans to support RTSP streaming?
Libass is added in v0.9.8, feel free to check. ๐
Animated WebP ( libwebp_anim ) which is in the latest version of FFMPEG.
ALAC
flv(h264+aac)
RTSP please
RTSP please
RTSP please
rtsp please
aom
rtsp is not supported yet?
amv
Can you support VP9 codec please? I was wondering why encoding some webm videos resulted in a black screen video, and now I see that the VP9 codec isn't supported here.
trying to compile with https support but getting this when running in browser:
RuntimeError: abort(Assertion failed: undefined) at Error
at jsStackTrace (ffmpeg.js:1:48319)
at stackTrace (ffmpeg.js:1:48487)
at abort (ffmpeg.js:1:26617)
at assert (ffmpeg.js:1:14046)
at Object.createSocket (ffmpeg.js:1:116479)
at ___sys_socketcall (ffmpeg.js:1:131668)
at _emscripten_receive_on_main_thread_js (ffmpeg.js:1:224397)
at ffmpeg.wasm:0xd1d2cb
at ffmpeg.wasm:0xd1cb33
at ffmpeg.wasm:0xd1daf6
ffmpeg.js:1 RuntimeError: abort(Assertion failed: undefined) at Error
at jsStackTrace (ffmpeg.js:1:48319)
at stackTrace (ffmpeg.js:1:48487)
at abort (ffmpeg.js:1:26617)
at assert (ffmpeg.js:1:14046)
at Object.createSocket (ffmpeg.js:1:116479)
at ___sys_socketcall (ffmpeg.js:1:131668)
at _emscripten_receive_on_main_thread_js (ffmpeg.js:1:224397)
at ffmpeg.wasm:0xd1d2cb
at ffmpeg.wasm:0xd1cb33
at ffmpeg.wasm:0xd1daf6
abort @ ffmpeg.js:1
___sys_socketcall @ ffmpeg.js:1
_emscripten_receive_on_main_thread_js @ ffmpeg.js:1
$func20031 @ ffmpeg.wasm:0xd1d2cb
$emscripten_current_thread_process_queued_calls @ ffmpeg.wasm:0xd1cb33
$emscripten_main_thread_process_queued_calls @ ffmpeg.wasm:0xd1daf6
(anonymous) @ ffmpeg.js:1
worker.onmessage @ ffmpeg.js:1
ffmpeg.js:1 Uncaught RuntimeError: abort(RuntimeError: abort(Assertion failed: undefined) at Error
at jsStackTrace (ffmpeg.js:1:48319)
at stackTrace (ffmpeg.js:1:48487)
at abort (ffmpeg.js:1:26617)
at assert (ffmpeg.js:1:14046)
at Object.createSocket (ffmpeg.js:1:116479)
at ___sys_socketcall (ffmpeg.js:1:131668)
at _emscripten_receive_on_main_thread_js (ffmpeg.js:1:224397)
at ffmpeg.wasm:0xd1d2cb
at ffmpeg.wasm:0xd1cb33
at ffmpeg.wasm:wasm-function[20048]:0xd1daf6) at Error
at jsStackTrace (ffmpeg.js:1:48319)
at stackTrace (ffmpeg.js:1:48487)
at abort (ffmpeg.js:1:26617)
at ___sys_socketcall (ffmpeg.js:1:135180)
at _emscripten_receive_on_main_thread_js (ffmpeg.js:1:224397)
at ffmpeg.wasm:0xd1d2cb
at ffmpeg.wasm:0xd1cb33
at ffmpeg.wasm:0xd1daf6
at ffmpeg.js:1:27502
at Worker.worker.onmessage (ffmpeg.js:1:45693)
at abort (ffmpeg.js:1:26648)
at ___sys_socketcall (ffmpeg.js:1:135180)
at _emscripten_receive_on_main_thread_js (ffmpeg.js:1:224397)
at ffmpeg.wasm:0xd1d2cb
at ffmpeg.wasm:0xd1cb33
at ffmpeg.wasm:0xd1daf6
at ffmpeg.js:1:27502
at Worker.worker.onmessage (ffmpeg.js:1:45693)
abort @ ffmpeg.js:1
___sys_socketcall @ ffmpeg.js:1
_emscripten_receive_on_main_thread_js @ ffmpeg.js:1
$func20031 @ ffmpeg.wasm:0xd1d2cb
$emscripten_current_thread_process_queued_calls @ ffmpeg.wasm:0xd1cb33
$emscripten_main_thread_process_queued_calls @ ffmpeg.wasm:0xd1daf6
(anonymous) @ ffmpeg.js:1
worker.onmessage @ ffmpeg.js:1
any idea why? ()ffmpeg -protocols does show https)
vp9 and frei0r ?
@jeromewu Just shooting my shot as I am not that prolific in WASM, but wouldnt something like Go AVIF library help for .avif files?
jpegxl, would complete the set of codecs for images! https://ffmpeg.org/ffmpeg-codecs.html#libjxl
does this support Worker thread?
mp2 codec, please
fak-aac is non-free or which license ?
audio - ALAW, MULAW, RTP
Multicast, if not yet
Rtsp please
Does the new version support rtsp?
Does it support GPU now?
Hi guys!
First off, awesome work on the project! Love it a lot.
I was wondering if it would be possible for SVG rendering support through librsvg or resvg.
Thanks!
Rtsp please
could do with mutiple variations based on different tasks to save bandwidth and store the wasm's on a storage service for people to use.
how to slowdown a video ?
im using this command : await ffmpeg.run('-i video.mp4 -filter:v "setpts=2.0PTS" output.mp4');
but im get this error : [fferr] Unrecognized option 'i video.mp4 -filter:v "setpts=2.0PTS" output.mp4'.
createFFmpeg.js:43 [fferr] Error splitting the argument list: Option not found
createFFmpeg.js:43 [ffout] FFMPEG_END
How hard would it be to handle .apng file inputs?
RTSP please
h265 is not working
webgpu has been released recently, RTSP please,god bless you
I am using FFPLAY.EXE
my CL: ffplay -protocol_whitelist pipe,file,udp,rtp -i play.sdp
play/sdp file:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
m=audio 5153 RTP/AVP 97
a=rtpmap:97 opus/48000/2
Can you help?
Will donate! Thanks!
I guess it is becoming a tradition to ask for RTSP each year. :)
LIVE555?
.webm ?
PCMA wanted
@jeromewu You should update aac (fdk-aac) in the OP to aac as it seems like ffmpeg.wasm doesn't support libfdk_aac.
webp decoding
webp decoding
You can use ImageMagick for webp
rtsp?
Is there an updated / reliable list of supported formats and codecs for the latest release? Shouldn't this be in the README / FAQ?
librsvg, for svg rasterisation
Image
avif [animated & static] (libaom-av1 / libsvtav1 / librav1e)
mkv / Matroska?
@shubhamsinghshubham777 .mkv is already implemented. see https://ffmpegwasm.netlify.app/playground