Skip to content

namespace 'com.phronemophobic.clj-media.impl.raw' not found (not compiled) #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
WorldsEndless opened this issue Jan 31, 2024 · 1 comment

Comments

@WorldsEndless
Copy link

I just want to try out clj-media to probe the aspect ratio of input videos. However, I am getting an error when I try to use it.

I use leiningen. In :dependencies in my project.clj:

;;;;;; everything else
[com.phronemophobic/clj-media "2.3"]

attempting use in an ns:

(ns test.ns
  (:require
   [com.phronemophobic.clj-media :as cljm]
  ) ;; attempting to evaluate the ns statement:
  ;; => namespace 'com.phronemophobic.clj-media.impl.raw' not found

I have checked the maven repository and verified that the downloaded jar DOES include the impl.raw ns, so perhaps the error is not what it says it is. fwiw, I do have ffmpeg installed on my system and can use it from the CLI. Why can't I use clj-media?

edit: I restarted my system repl and found a more instructive error:

Syntax error (UnsatisfiedLinkError) compiling at (com/phronemophobic/clj_media/impl/raw.clj:61:1).
~/.javacpp/cache/ffmpeg-6.0-1.5.9-linux-x86_64.jar/org/bytedeco/ffmpeg/linux-x86_64/libjniavdevice.so: libxcb.so.1: cannot open shared object file: No such file or directory

it looks like a system error of some kind. I see I am not alone with similar errors: https://stackoverflow.com/questions/72554450/aws-ec2-linux-cannot-open-shared-object-file

The solution is to make a bunch of system upgrades, which are apparently needed so that the latest xcb version is viable. For clj-media, I guess the docs should mention that a recent libxcb library is needed so that the C-linker has what it needs when Clong does its thing.

I'm trying to update things so that it works. I'm leaving this message here so that others might find it when necessary.

@phronmophobic
Copy link
Owner

Yes, clj-media relies on ffmpeg 6. Unfortunately, there's not really a painless way to make native dependencies for linux "just work". At least, not that I'm aware of.

I'm not sure if your package manager can install a ffmpeg 6 development package. If so, you should be able to just install it from your package manager and then exclude the ffmpeg-platform dependency similar to a locally built ffmpeg.

com.phronemophobic/clj-media {:mvn/version "2.3"
                              :exclusions [org.bytedeco/ffmpeg-platform]}

You could also locally compile ffmpeg 6, but that's its own rabbit hole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants