amiaopensource / homebrew-amiaos

Homebrew tap for AMIA Open Source
MIT License
29 stars 14 forks source link

ffmpegdecklink -- Ubuntu 20.04 #335

Closed camardo closed 1 year ago

camardo commented 1 year ago

Upon installing ffmpegdecklink, libiec61883 does not appear to be installing with ffmpeg 5.1.2.

privatezero commented 1 year ago

Did you apply the flag when you ran brew install? brew install ffmpegdecklink --with-iec61883.

It won't install it automatically otherwise. You will also need to have the dependencies for the iec61883 device installed, which should be all or some of

sudo apt-get install libiec61883-dev
sudo apt-get install libraw1394-dev
sudo apt-get install libavc1394-dev
sudo apt-get install libavc1394-tools

See the vrecord linux install page for more information about the process and potential issues

belak1 commented 1 year ago

Thanks @privatezero. I'm working with @ncam610 on this issue. We were missing the flag, and I ran through installing all the dependencies. Now when I attempt to install with iec61883, I get the following error message.

brew reinstall ffmpegdecklink --with-iec61883
==> Downloading https://ffmpeg.org/releases/ffmpeg-5.1.2.tar.xz
Already downloaded: /home/postsuper/.cache/Homebrew/downloads/7f8448ac2cf8ab4812d1b22a41a9e768f7b2c537f9a79a74bde1e0a91752a54c--ffmpeg-5.1.2.tar.xz
==> Reinstalling amiaopensource/amiaos/ffmpegdecklink --with-iec61883
==> ./configure --prefix=/home/linuxbrew/.linuxbrew/Cellar/ffmpegdecklink/5.1.2 
Last 15 lines from /home/postsuper/.cache/Homebrew/Logs/ffmpegdecklink/01.configure:
--disable-libjack
--disable-indev=jack
--enable-libiec61883
--enable-nonfree
--enable-decklink
--extra-cflags=-I/home/linuxbrew/.linuxbrew/include
--extra-ldflags=-L/home/linuxbrew/.linuxbrew/include

ERROR: libiec61883 not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
camardo commented 1 year ago

@privatezero -- I was confused about that. I was previously running ffmpeg 4.2.7 with -libiec61883 enabled. I received an error about updating ffmpeg to avoid potential a/v sync issues. I was having trouble installing ffmpeg 5 with iec61883, so I turned to the amiaos repo. It looks like there is a flag in ffmpegdecklink to enable libiec61883 if OS = linux:

class Ffmpegdecklink < Formula
  desc "FFmpeg with --enable-decklink"
  homepage "https://ffmpeg.org/"
  url "https://ffmpeg.org/releases/ffmpeg-5.1.2.tar.xz"
  sha256 "619e706d662c8420859832ddc259cd4d4096a48a2ce1eefd052db9e440eef3dc"
  head "https://github.com/FFmpeg/FFmpeg.git", branch: "master"
  keg_only "anything that needs this will know where to look"

  option "with-iec61883", "Enable DV device (Linux)" if OS.linux?
  depends_on "nasm" => :build
  depends_on "pkg-config" => :build
  depends_on "texinfo" => :build

  depends_on "amiaopensource/amiaos/decklinksdk"
  depends_on "fontconfig"
  depends_on "freetype"
  depends_on "lame"
  depends_on "libvorbis"
  depends_on "libvpx"
  depends_on "openjpeg"
  depends_on "opus"
  depends_on "sdl2"
  depends_on "snappy"
  depends_on "theora"
  depends_on "x264"
  depends_on "x265"
  depends_on "xvid"
  depends_on "xz"

  def install
    args = %W[
      --prefix=#{prefix}
      --disable-shared
      --enable-version3
      --cc=#{ENV.cc}
      --host-cflags=#{ENV.cflags}
      --host-ldflags=#{ENV.ldflags}
      --enable-gpl
      --enable-libfreetype
      --enable-libmp3lame
      --enable-libopenjpeg
      --enable-libopus
      --enable-libsnappy
      --enable-libtheora
      --enable-libvorbis
      --enable-libvpx
      --enable-libx264
      --enable-libx265
      --enable-libxvid
      --enable-libfontconfig
      --disable-libjack
      --disable-indev=jack
    ]

    args << "--enable-neon" if OS.mac? && Hardware::CPU.arm?

    args << "--enable-libiec61883" if (build.with? "iec61883") && OS.linux?

    # decklink options
    args << "--enable-nonfree"
    args << "--enable-decklink"
    args << "--extra-cflags=-I#{HOMEBREW_PREFIX}/include"
    args << "--extra-ldflags=-L#{HOMEBREW_PREFIX}/include"
    mv "VERSION", "VERSION.txt"

    system "./configure", *args
    system "make"
    bin.install "ffmpeg" => "ffmpeg-dl"
    bin.install "ffprobe" => "ffprobe-dl"
    bin.install "ffplay" => "ffplay-dl"
  end

  test do
    # Create an example mp4 file
    mp4out = testpath/"video.mp4"
    system bin/"ffmpeg-dl", "-filter_complex", "testsrc=rate=1:duration=1", mp4out
    assert_predicate mp4out, :exist?
  end
end
retokromer commented 1 year ago

@belak1 @ncam610 : Have you done

sudo apt-get install libiec61883-dev

as mentioned in Steps for a successful install of Vrecord on Linux?

privatezero commented 1 year ago

@belak1 I uninstalled ffmpegdecklink on my Ubuntu 20.04 machine, and was able to recreate your problem. It doesn't appear to be an issue on Ubuntu 22.04...@retokromer, are you aware of any changes that might have affected where Homebrew searches for dependencies on 20.04?

retokromer commented 1 year ago

@privatezero Off the top of my head, no. I am currently in Jerusalem and will be traveling to The Hague in a few days, therefore I cannot check it right now. I am sorry for that.

privatezero commented 1 year ago

@belak1 @ncam610, is this still an issue on your end? I've just retested on the same machine that reproduced the problem, and after a brew upgrade I was now able to successfully build ffmpegdecklink with the usual brew command. Possibly something upstream was worked out?

retokromer commented 1 year ago

@privatezero I am not aware of an upstream change, but it works on my end as well (with a little different setting though).

DabeDotCom commented 1 year ago

For whomevr this helps...

I managed to work around this by linking the system-installed libiec61883 and lib*1394 headers and libraries into a place the brew-installed gcc-12 could find them:

eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) \
  && ln -sf /usr/include/libiec61883 "$(brew --prefix)/include/" \
  && ln -sf /usr/include/libraw1394  "$(brew --prefix)/include/" \
  && ln -sf /usr/include/libavc1394  "$(brew --prefix)/include/" \
  && ln -sf /usr/lib/x86_64-linux-gnu/libiec61883* "$(brew --prefix)/lib/" \
  && ln -sf /usr/lib/x86_64-linux-gnu/libraw1394*  "$(brew --prefix)/lib/" \
  && ln -sf /usr/lib/x86_64-linux-gnu/libavc1394*  "$(brew --prefix)/lib/" \ 
  && ln -sf /usr/lib/x86_64-linux-gnu/librom1394*  "$(brew --prefix)/lib/"

After that, brew install ffmpegdecklink --with-iec61883 applied cleanly.

privatezero commented 1 year ago

Thanks much for reporting that @DabeDotCom!

retokromer commented 1 year ago

Thanks! Troubleshooting updated in https://github.com/amiaopensource/homebrew-amiaos/pull/342