Open gabrielstuff opened 1 year ago
Maybe^1 the ffmpeg wasm binary was not build with --enable-libzimg
required for zscale filter?
If I try ffmpeg -buildconf
this on @ffmpeg/ffmpeg@0.12.6
latest version, I get:
<script type="module">
import { FFmpeg } from "@ffmpeg/ffmpeg";
import { toBlobURL } from "@ffmpeg/util";
const baseURL = "/assets/core/package/dist/esm";
const ffmpeg = new FFmpeg();
await ffmpeg.load({
coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, "text/javascript"),
wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, "application/wasm"),
});
ffmpeg.on("log", ({ message }) => console.log(message));
await ffmpeg.exec(['-buildconf']);
</script>
new.astro:653 ffmpeg version 5.1.3 Copyright (c) 2000-2022 the FFmpeg developers
new.astro:653 built with emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.40 (5c27e79dd0a9c4e27ef2326841698cdd4f6b5784)
new.astro:653 configuration: --target-os=none --arch=x86_32 --enable-cross-compile --disable-asm --disable-stripping --disable-programs --disable-doc --disable-debug --disable-runtime-cpudetect --disable-autodetect --nm=emnm --ar=emar --ranlib=emranlib --cc=emcc --cxx=em++ --objcc=emcc --dep-cc=emcc --extra-cflags='-I/opt/include -O3 -msimd128' --extra-cxxflags='-I/opt/include -O3 -msimd128' --disable-pthreads --disable-w32threads --disable-os2threads --enable-gpl --enable-libx264 --enable-libx265 --enable-libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libopus --enable-zlib --enable-libwebp --enable-libfreetype --enable-libfribidi --enable-libass
new.astro:653 libavutil 57. 28.100 / 57. 28.100
new.astro:653 libavcodec 59. 37.100 / 59. 37.100
new.astro:653 libavformat 59. 27.100 / 59. 27.100
new.astro:653 libavdevice 59. 7.100 / 59. 7.100
new.astro:653 libavfilter 8. 44.100 / 8. 44.100
new.astro:653 libswscale 6. 7.100 / 6. 7.100
new.astro:653 libswresample 4. 7.100 / 4. 7.100
new.astro:653 libpostproc 56. 6.100 / 56. 6.100
new.astro:653
new.astro:653 configuration:
new.astro:653 --target-os=none
new.astro:653 --arch=x86_32
new.astro:653 --enable-cross-compile
new.astro:653 --disable-asm
new.astro:653 --disable-stripping
new.astro:653 --disable-programs
new.astro:653 --disable-doc
new.astro:653 --disable-debug
new.astro:653 --disable-runtime-cpudetect
new.astro:653 --disable-autodetect
new.astro:653 --nm=emnm
new.astro:653 --ar=emar
new.astro:653 --ranlib=emranlib
new.astro:653 --cc=emcc
new.astro:653 --cxx=em++
new.astro:653 --objcc=emcc
new.astro:653 --dep-cc=emcc
new.astro:653 --extra-cflags='-I/opt/include -O3 -msimd128'
new.astro:653 --extra-cxxflags='-I/opt/include -O3 -msimd128'
new.astro:653 --disable-pthreads
new.astro:653 --disable-w32threads
new.astro:653 --disable-os2threads
new.astro:653 --enable-gpl
new.astro:653 --enable-libx264
new.astro:653 --enable-libx265
new.astro:653 --enable-libvpx
new.astro:653 --enable-libmp3lame
new.astro:653 --enable-libtheora
new.astro:653 --enable-libvorbis
new.astro:653 --enable-libopus
new.astro:653 --enable-zlib
new.astro:653 --enable-libwebp
new.astro:653 --enable-libfreetype
new.astro:653 --enable-libfribidi
new.astro:653 --enable-libass
new.astro:653 Aborted()
0
Maybe you could build your own version of ffmpeg-core.wasm
?
Nice approach, didn't think of trying : await ffmpeg.exec(['-buildconf']);
Lets see how to build that.
On mac with docker v4.22.1 it failed what ever I tried. make prd-mt
and make prd
can't finish build and fail. Trying the make dev
command.
Giving it a try too (on mac m1) with Docker Desktop v4.22.1 boosted:
$ docker buildx create --use
$ mkdir -p build-cache-st build-cache-mt
$ make prd EXTRA_ARGS="--cache-from=type=local,src=build-cache-st --cache-to=type=local,dest=build-cache-st,mode=max"
$ make prd-mt EXTRA_ARGS="--cache-from=type=local,src=build-cache-mt --cache-to=type=local,dest=build-cache-mt,mode=max"
but never ends... (or not patient enough)
Trying with (for --progress=plain
docker logs):
$ make dev EXTRA_ARGS="--cache-from=type=local,src=build-cache-st --cache-to=type=local,dest=build-cache-st,mode=max"
it's long...
I had more chance by letting Github Actions do the build for me.
For that, I forked and created my own[^1] PR: https://github.com/abernier/ffmpeg.wasm/pull/1 and let the workflow run https://github.com/abernier/ffmpeg.wasm/actions/runs/6093877792
[^1]: from my PR's branch to my own repo's main
branch, ie: abernier/ffmpeg.wasm:main <- abernier/ffmpeg.wasm:abernier-abort-signal
because actions from ffmpegwasm/ffmpeg.wasm must be validated before the workflow to be run
Did it work ?
you can then even download the artifacts:
eg: ffmpeg-core
Ok, so my fork worked out with zimg
include. After starting the command, everything looks fine but suddenly :
Aborted(OOM)
My work is here : https://github.com/gabrielstuff/ffmpeg.wasm/actions/runs/6102761096#artifacts I think it must be related to my zimg.sh
script https://github.com/gabrielstuff/ffmpeg.wasm/blob/main/build/zimg.sh
Any ideas ?
in my last experience with ffmpegwasm, "Aborted" messages didn't mean it failed (weirdly): have you checked with readFile your file isn't there?
OOM means Out of Memory. Yes it fails unforunately. Tried to load the file without success. On 7 Sep 2023 at 11:31 +0200, Antoine BERNIER @.***>, wrote:
in my last experience with ffmpegwasm, "Aborted" messages didn't mean it failed (weirdly): have you checked with readFile your file isn't there? β Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
@abernier I just started using ffmpeg.wasm this week and I am also seeing the "aborted" message even when a command completes successfully which is not what I would expect.
I'm trying to port the following ffmpeg command, which allow to map a HDR video stream to an equivalent SDR stream.
I'd like to be able to use zscale filter.
The ffmpeg command I tried to execute was :
Which result in the following error :
Thanks a lot for this amazing project.