darkskygit / minimp4.rs

A minimp4 Rust binding, h264/h265 stream muxer
https://crates.io/crates/minimp4
Mozilla Public License 2.0
20 stars 7 forks source link

Compilation Error with fdk-aac-sys dependency #4

Closed 0Ky closed 2 months ago

0Ky commented 1 year ago

When attempting to include minimp4 = "0.1.0" or minimp4 = { git = "https://github.com/darkskygit/minimp4.rs.git" } into my project, I received an error regarding the fdk-aac-sys v0.4.0 library, which is a dependency used by this crate.

I'm compiling in MinGW64 environment on Windows 11.

The following error and warning messages were emitted during compilation:

warning: In file included from aac/libAACdec/src/aac_ram.h:106,
warning:                  from aac/libAACdec/src/aac_ram.cpp:103:
warning: aac/libFDK/include/common_fix.h:410:18: error: redefinition of 'SHORT fMax(SHORT, SHORT)'
warning:   410 | FDK_INLINE SHORT fMax(SHORT a, SHORT b) { return fixmax_S(a, b); }
warning:       |                  ^~~~
warning: aac/libFDK/include/common_fix.h:404:21: note: 'FIXP_SGL fMax(FIXP_SGL, FIXP_SGL)' previously defined here
warning:   404 | FDK_INLINE FIXP_SGL fMax(FIXP_SGL a, FIXP_SGL b) { return fixmax_S(a, b); }
warning:       |                     ^~~~
warning: aac/libFDK/include/common_fix.h:411:18: error: redefinition of 'SHORT fMin(SHORT, SHORT)'
warning:   411 | FDK_INLINE SHORT fMin(SHORT a, SHORT b) { return fixmin_S(a, b); }
warning:       |                  ^~~~
warning: aac/libFDK/include/common_fix.h:403:21: note: 'FIXP_SGL fMin(FIXP_SGL, FIXP_SGL)' previously defined here
warning:   403 | FDK_INLINE FIXP_SGL fMin(FIXP_SGL a, FIXP_SGL b) { return fixmin_S(a, b); }
warning:       |                     ^~~~
warning: In file included from aac/libAACdec/src/aac_rom.h:106,
warning:                  from aac/libAACdec/src/aac_rom.cpp:103:
warning: aac/libFDK/include/common_fix.h:410:18: error: redefinition of 'SHORT fMax(SHORT, SHORT)'
warning:   410 | FDK_INLINE SHORT fMax(SHORT a, SHORT b) { return fixmax_S(a, b); }
warning:       |                  ^~~~
warning: aac/libFDK/include/common_fix.h:404:21: note: 'FIXP_SGL fMax(FIXP_SGL, FIXP_SGL)' previously defined here
warning:   404 | FDK_INLINE FIXP_SGL fMax(FIXP_SGL a, FIXP_SGL b) { return fixmax_S(a, b); }
warning:       |                     ^~~~
warning: aac/libFDK/include/common_fix.h:411:18: error: redefinition of 'SHORT fMin(SHORT, SHORT)'
warning:   411 | FDK_INLINE SHORT fMin(SHORT a, SHORT b) { return fixmin_S(a, b); }
warning:       |                  ^~~~
warning: aac/libFDK/include/common_fix.h:403:21: note: 'FIXP_SGL fMin(FIXP_SGL, FIXP_SGL)' previously defined here
warning:   403 | FDK_INLINE FIXP_SGL fMin(FIXP_SGL a, FIXP_SGL b) { return fixmin_S(a, b); }
warning:       |                     ^~~~

error: failed to run custom build command for `fdk-aac-sys v0.4.0`

Caused by:
process didn't exit successfully: `C:\msys64\home\user\tauri-app\src-tauri\target\debug\build\fdk-aac-sys-43ade16a42ce00f4\build-script-build` (exit code: 1)

error occurred: Command "gcc.exe" "-O0" "-ffunction-sections" "-fdata-sections" "-gdwarf-2" "-fno-omit-frame-pointer" "-m64" "-I" "aac/libAACdec/include" "-I" "aac/libAACenc/include" "-I" "aac/libPCMutils/include" "-I" "aac/libFDK/include" "-I" "aac/libSYS/include" "-I" "aac/libMpegTPDec/include" "-I" "aac/libMpegTPEnc/include" "-I" "aac/libSBRdec/include" "-I" "aac/libSBRenc/include" "-I" "aac/libArithCoding/include" "-I" "aac/libDRCdec/include" "-I" "aac/libSACdec/include" "-I" "aac/libSACenc/include" "-DFDK_FALLTHROUGH=" "-o" "C:\\msys64\\home\\user\\tauri-app\\src-tauri\\target\\debug\\build\\fdk-aac-sys-32a39a70a6608d83\\out\\aac/libAACdec/src/aac_ram.o" "-c" "aac/libAACdec/src/aac_ram.cpp" with args "gcc.exe" did not execute successfully (status code exit code: 1).

Will you be able to provide build instructions?

darkskygit commented 1 year ago

Have you tried compiling with the msvc compiler? Sorry, I haven't tested the package with MinGW64 environment.

In fact, it is not appropriate for this crate to add codec-related dependencies as a muxer/demuxer.

If I have time recently, I will try to refactor the relevant APIs to make them optional.

0Ky commented 1 year ago

It compiles fine with MSVC, but my project uses libraries that have different build requirements which is why I compile in the MinGW64 environment.

darkskygit commented 2 months ago

new version 0.1.2 has been published to crates.io this version will disable aac feature by default i will refactor audio encoding in next version