xbmc / inputstream.ffmpegdirect

Supports streams opened by FFmpeg's libavformat or Kodi's cURL such as plain TS, HLS and DASH (non-DRM) as well as many others. There is support for Archive/Catchup services where there is a replay window and can timeshift across that span. Also provides timeshift for live streams where rewind/pause and fast-forward would not have been available.
GNU General Public License v2.0
57 stars 40 forks source link

[Archlinux aarch64] How to build with external ffmpeg? #295

Closed coffeinflash closed 1 month ago

coffeinflash commented 1 month ago

Hi,

I am tryinbg to build this addon with a custom ffmpeg for my Pi so it uses the same ffmpeg as kodi: https://github.com/jc-kynesim/rpi-ffmpeg/archive/refs/tags/n6.0.1.tar.gz

But cmake always fails as ffmpeg is not found:

-- Build files have been written to: /home/mediapc/.cache/yay/kodi-addon-inputstream-ffmpegdirect-git/src/inputstream.ffmpegdirect-Omega/build
[ 12%] Building CXX object CMakeFiles/inputstream.ffmpegdirect.dir/src/StreamManager.cpp.o
[ 12%] Building CXX object CMakeFiles/inputstream.ffmpegdirect.dir/src/stream/DemuxStream.cpp.o
In file included from /home/mediapc/.cache/yay/kodi-addon-inputstream-ffmpegdirect-git/src/inputstream.ffmpegdirect-Omega/src/stream/DemuxStream.cpp:8:
/home/mediapc/.cache/yay/kodi-addon-inputstream-ffmpegdirect-git/src/inputstream.ffmpegdirect-Omega/src/stream/DemuxStream.h:24:10: fatal error: libavcodec/avcodec.h: No such file or directory
   24 | #include <libavcodec/avcodec.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /home/mediapc/.cache/yay/kodi-addon-inputstream-ffmpegdirect-git/src/inputstream.ffmpegdirect-Omega/src/stream/FFmpegStream.h:13,
                 from /home/mediapc/.cache/yay/kodi-addon-inputstream-ffmpegdirect-git/src/inputstream.ffmpegdirect-Omega/src/StreamManager.h:10,
                 from /home/mediapc/.cache/yay/kodi-addon-inputstream-ffmpegdirect-git/src/inputstream.ffmpegdirect-Omega/src/StreamManager.cpp:8:
/home/mediapc/.cache/yay/kodi-addon-inputstream-ffmpegdirect-git/src/inputstream.ffmpegdirect-Omega/src/stream/DemuxStream.h:24:10: fatal error: libavcodec/avcodec.h: No such file or directory
   24 | #include <libavcodec/avcodec.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
distcc[45591] ERROR: compile (null) on localhost failed
make[2]: *** [CMakeFiles/inputstream.ffmpegdirect.dir/build.make:90: CMakeFiles/inputstream.ffmpegdirect.dir/src/stream/DemuxStream.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
distcc[45590] ERROR: compile (null) on localhost failed
make[2]: *** [CMakeFiles/inputstream.ffmpegdirect.dir/build.make:76: CMakeFiles/inputstream.ffmpegdirect.dir/src/StreamManager.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/inputstream.ffmpegdirect.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

I am building with:

cmake \
    -DVERBOSE=ON \
    -DENABLE_INTERNAL_FFMPEG=OFF \
    -DFFMPEG_PATH="$srcdir/rpi-ffmpeg-n6.0.1/" \
    (...)

No idea what I am doing wrong here...

phunkyfish commented 1 month ago

I could be wrong but I think FFMPEG_PATH is to point to and already installed ffmpeg, not a src dir.

See here: https://github.com/xbmc/xbmc/blob/master/cmake/modules/FindFFMPEG.cmake

coffeinflash commented 1 month ago

OK, got it. Thx.