CapSoftware / Cap

Open source Loom alternative. Beautiful, shareable screen recordings.
https://cap.so
GNU Affero General Public License v3.0
5.02k stars 259 forks source link

Title: pnpm tauri:build fails due to ffmpeg-next compilation errors #92

Open onyedikachi-david opened 1 month ago

onyedikachi-david commented 1 month ago

Description

When attempting to build the project using pnpm tauri:build, the process fails due to compilation errors in the ffmpeg-next dependency.

Reproduction

  1. Clone the Cap repository
  2. Run pnpm install to install dependencies
  3. Execute pnpm tauri:build
  4. Observe the build failure with compilation errors related to ffmpeg-next

Additional Context

Error logs:

error[E0004]: non-exhaustive patterns: sys::AVColorSpace::AVCOL_SPC_IPT_C2, sys::AVColorSpace::AVCOL_SPC_YCGCO_RE and sys::AVColorSpace::AVCOL_SPC_YCGCO_RO not covered
--> /Users/onyedikachi/.cargo/git/checkouts/rust-ffmpeg-bf2fff940543d618/11f8d26/src/util/color/space.rs:44:15
|
44    |         match value {
|               ^^^^^ patterns sys::AVColorSpace::AVCOL_SPC_IPT_C2, sys::AVColorSpace::AVCOL_SPC_YCGCO_RE and sys::AVColorSpace::AVCOL_SPC_YCGCO_RO not covered
// ... (include the full error message here, as in your original paste)
error: could not compile ffmpeg-next (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
failed to build app: failed to build app
Error [tauri_cli_node] failed to build app: failed to build app
ELIFECYCLE  Command failed with exit code 1.
ELIFECYCLE  Command failed with exit code 1.
richiemcilroy commented 1 month ago

hey @onyedikachi-david - you may need to install ffmpeg locally with brew install ffmpeg.

Let me know if this fixes the problem!

onyedikachi-david commented 1 month ago

I have it already I've been using it in a Tauri project.:

brew list
==> Formulae
act         freetype        jbig2dec        libmpc          libxau          openssl@3       speex
aom         frei0r          jpeg-turbo      libnghttp2      libxcb          opus            sqlite
aribb24         fribidi         jpeg-xl         libogg          libxdmcp        p11-kit         srt
asdf            gcc         jq          libomp          libxext         pango           svt-av1
autoconf        gdbm            krb5            libpng          libxrender      pcre            tesseract
automake        gettext         lame            libraw          libyaml         pcre2           theora
bash            gh          leptonica       librist         little-cms2     pinentry        tree
bash-completion     ghostscript     libarchive      libsamplerate       lua         pinentry-mac        unbound
bison           giflib          libass          libsndfile      lz4         pixman          unixodbc
brotli          git         libassuan       libsodium       lzo         pkg-config      webp
btop            git-lfs         libassuan@2     libsoxr         m4          popt            wget
c-ares          gitmoji         libb2           libssh          mbedtls         postgresql@14       x264
ca-certificates     glib            libbluray       libssh2         mpdecimal       pyenv           x265
cairo           gmp         libde265        libtasn1        mpfr            python-packaging    xorgproto
chruby          gnu-tar         libevent        libtiff         mpg123          python@3.12     xvid
cjson           gnupg           libffi          libtool         ncurses         rav1e           xxhash
cmake           gnutls          libgcrypt       libunibreak     nettle          readline        xz
coreutils       graphite2       libgpg-error        libunistring        nmap            redis           zeromq
curl            harfbuzz        libheif         libusb          node            rsync           zimg
dav1d           highway         libidn          libuv           npth            rtmpdump        zlib
daytona         icu4c           libidn2         libvidstab      onednn          rubberband      zsh
direnv          imagemagick     libksba         libvmaf         oniguruma       ruby-install        zstd
ffmpeg          imath           liblinear       libvorbis       opencore-amr        sdl2
flac            isl         liblqr          libvpx          openexr         shared-mime-info
fontconfig      jasper          libmicrohttpd       libx11          openjpeg        snappy

==> Casks
android-file-transfer   docker          maccy           pearcleaner     postman         stats           warp
discord         font-fira-code      orbstack        postico         rectangle       visual-studio-code
brew list | grep ffmpeg
ffmpeg
onyedikachi-david commented 1 month ago

do you specify a rust version? @richiemcilroy

richiemcilroy commented 1 month ago

@Brendonovich could you maybe help here?

Brendonovich commented 1 month ago

From what I can tell, ffmpeg 7.1 from brew isn't compatible with ffmpeg-next - neither our fork or the main repo. 7.0 from brew might work, but since installing older versions with brew can be tricky I've been using the setup that gets used in prod, where we link against Spacedrive.framework. Just run node .github/prebuild {aarch64 or x86_64} and it should configure everything for you.