VLC builded to webassembly starts but not working
To build, I add to vlc/contrib/src/main.mak in section HAVE_EMSCRIPTEN between HAVE_SOLARIS and HAVE_WINSTORE
ifdef HAVE_EMSCRIPTEN CC := emcc CXX := em++ LD := emcc AR := emar RANLIB := emranlib NM := llvm-nm EXTRA_CFLAGS := -pthread -sUSE_ZLIB=1 $(EXTRA_CFLAGS) EXTRA_CXXFLAGS := -pthread -sUSE_ZLIB=1 $(EXTRA_CXXFLAGS) EXTRA_LDFLAGS := -pthread -sPTHREAD_POOL_SIZE=8 -sUSE_ZLIB=1 $(EXTRA_LDFLAGS) endif
and edit section emscripten in vlc/configure.ac to add compiler flags as -pthread -sUSE_ZLIB=1
*emscripten*) SYS=emscripten AC_LIBOBJ([clock_nanosleep]) CC=emcc LD=emcc LDSHARED=emcc NM=llvm-nm CPP=emcc CXX=em++ AR=emar RANLIB=emranlib # tdestroy() is a GNU extension CFLAGS="${CFLAGS} -D__NEED_ssize_t -D_GNU_SOURCE -pthread -sUSE_ZLIB=1" CPPFLAGS="${CPPFLAGS} -pthread -sUSE_ZLIB=1" CXXFLAGS="${CXXFLAGS} -pthread -sUSE_ZLIB=1" LDFLAGS="${LDFLAGS} -pthread -sPTHREAD_POOL_SIZE=8 -sUSE_ZLIB=1" ac_cv_func_if_nameindex=yes ac_cv_header_sys_shm_h=no ;;
and edit src/emscripten/thread.c
return (unsigned long)pthread_self();
and edit vlc/contrib/src/png/rules.mak
cd $< && $(HOSTVARS) ./configure $(HOSTCONF) CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
and same edit vlc/contrib/src/aribb24/rules.mak
cd $< && $(HOSTVARS) ./configure $(HOSTCONF) CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
and edit vlc/contrib/src/ffmpeg/rules.mak for add flags --extra-cflags, --extra-cxxflags to configure
cd $< && $(HOSTVARS) ./configure \ --extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) \ --extra-cflags="$(CFLAGS)" \ --extra-cxxflags="$(CXXFLAGS)" \ --prefix="$(PREFIX)" --enable-static --disable-shared
Export some variables
EMSDK=/opt/Qt/Tools/emsdk source $EMSDK/emsdk_env.sh export PKG_CONFIG_PATH=$EMSDK/upstream/emscripten/system/lib/pkgconfig export PKG_CONFIG_LIBDIR=$PWD/contrib/wasm32_unknowm_emscripten/lib/pkgconfig export PKG_CONFIG_PATH_CUSTOM=$PKG_CONFIG_LIBDIR export PATH="/opt/Qt/Tools/emsdk/upstream/bin:$PATH"
After that I build vlc without errors: vlc/extras/package/wasm-emscripten/build.sh
Further I copy main.c and BigBuckBunny.mp4 to vlc/vlc/build-emscripten and build my test programm with create_main.sh it's okay for now. main.c create_main.sh
Further I start my test programm
emrun --no_browser --port 8080 experimental.html
And open it at brouser Chrome and Firefox
http://localhost:8080/experimental.html
But VLC Player dont play video ((( If any help me. At conslole I see:
h264 @ 0x241c5b0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x241c5b0] nal_unit_type: 8(PPS), nal_ref_idc: 3
Tried to spawn a new thread, but the thread pool is exhausted.
This might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.
If you want to increase the pool size, use setting -sPTHREAD_POOL_SIZE=...
.
If you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting -sPTHREAD_POOL_SIZE_STRICT=2
.
Tried to spawn a new thread, but the thread pool is exhausted.
This might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.
If you want to increase the pool size, use setting -sPTHREAD_POOL_SIZE=...
.
If you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting -sPTHREAD_POOL_SIZE_STRICT=2
.
Tried to spawn a new thread, but the thread pool is exhausted.
This might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.
If you want to increase the pool size, use setting -sPTHREAD_POOL_SIZE=...
.
If you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting -sPTHREAD_POOL_SIZE_STRICT=2
.
Tried to spawn a new thread, but the thread pool is exhausted.
This might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.
If you want to increase the pool size, use setting -sPTHREAD_POOL_SIZE=...
.
If you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting -sPTHREAD_POOL_SIZE_STRICT=2
.
Tried to spawn a new thread, but the thread pool is exhausted.
This might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.
If you want to increase the pool size, use setting -sPTHREAD_POOL_SIZE=...
.
If you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting -sPTHREAD_POOL_SIZE_STRICT=2
.
Tried to spawn a new thread, but the thread pool is exhausted.
This might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.
If you want to increase the pool size, use setting -sPTHREAD_POOL_SIZE=...
.
If you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting -sPTHREAD_POOL_SIZE_STRICT=2
.
Tried to spawn a new thread, but the thread pool is exhausted.
This might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.
If you want to increase the pool size, use setting -sPTHREAD_POOL_SIZE=...
.
If you want to throw an explicit error instead of the risk of deadlocking in those cases, use setting -sPTHREAD_POOL_SIZE_STRICT=2
.
[h264 @ 0x241c5b0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x241c5b0] Format yuv420p chosen by get_format().
[h264 @ 0x241c5b0] Reinit context to 1280x720, pix_fmt: yuv420p
[h264 @ 0x241c5b0] get_buffer() failed
[h264 @ 0x241c5b0] thread_get_buffer() failed
[h264 @ 0x241c5b0] decode_slice_header error
[h264 @ 0x241c5b0] no frame!
[h264 @ 0x2660d10] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x2660d10] get_buffer() failed
[h264 @ 0x2660d10] thread_get_buffer() failed
[h264 @ 0x2660d10] decode_slice_header error
[h264 @ 0x2660d10] no frame!
[h264 @ 0x2879450] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[h264 @ 0x2879450] Frame num gap 2 0
[h264 @ 0x2879450] get_buffer() failed
[h264 @ 0x2879450] thread_get_buffer() failed
[h264 @ 0x2879450] decode_slice_header error
[h264 @ 0x2879450] no frame!