Skip to content
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

FITS 1.6.0 does not have a mediainfo library for the ARM Mac’s #389

Open
awoods opened this issue Aug 21, 2023 · 21 comments
Open

FITS 1.6.0 does not have a mediainfo library for the ARM Mac’s #389

awoods opened this issue Aug 21, 2023 · 21 comments

Comments

@awoods
Copy link
Contributor

awoods commented Aug 21, 2023

/Applications/fits/fits.sh -x -i /Volumes/mediapres2/globus_dropbox/Memnon/Memnon-Batch-06/BATCH_0005/DEPOSIT_230705145315/32044160172193/archival/32044160172193_AM_01_01.mov -o /Volumes/mediapres2/globus_dropbox/Memnon/Memnon-Batch-06/BATCH_0005/DEPOSIT_230705145315/32044160172193/archival/32044160172193_AM_01_01_test.xml
2023-08-21 13:30:19 - ERROR - MediaInfo:95 - Error loading native library for this operating system for tool: MediaInfo. ostype=[MacOS] -- jvmModel=[64] -- nativeLibPath=[/Applications/fits/tools/mediainfo/mac] -- No native MediaInfo library for this OS
java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/gh/gszlyl290h1dnlk8t2_th5s80000gp/T/jna-2040574825/jna16480843601716805071.tmp
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2638)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1850)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:761)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:736)
at com.sun.jna.Native.(Native.java:131)
at edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfoNativeWrapper$MediaInfoDLL_Internal.(MediaInfoNativeWrapper.java:101)
at edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfoNativeWrapper.Option_Static(MediaInfoNativeWrapper.java:442)
at edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo.(MediaInfo.java:86)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at edu.harvard.hul.ois.fits.tools.ToolBelt.createToolClassInstance(ToolBelt.java:169)
at edu.harvard.hul.ois.fits.tools.ToolBelt.init(ToolBelt.java:122)
at edu.harvard.hul.ois.fits.tools.ToolBelt.(ToolBelt.java:58)
at edu.harvard.hul.ois.fits.Fits.(Fits.java:244)
at edu.harvard.hul.ois.fits.Fits.(Fits.java:124)
at edu.harvard.hul.ois.fits.Fits.(Fits.java:113)
at edu.harvard.hul.ois.fits.Fits.constructFits(Fits.java:348)
at edu.harvard.hul.ois.fits.Fits.main(Fits.java:326)
2023-08-21 13:30:19 - ERROR - ToolBelt:139 - Thread [1] Error instantiating class: edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo -- Exception thrown: java.lang.InstantiationException -- Error message: edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo

@pwinckles
Copy link
Contributor

@awoods I think there's something else going on here. I just downloaded 1.6.0 and ran it on a M1 and MediaInfo works as expected. In fact, the MediaInfo lib for x86_64 and arm64 is identical: https://mediaarea.net/en/MediaInfo/Download/Mac_OS

@awoods
Copy link
Contributor Author

awoods commented Aug 21, 2023

@pwinckles : Running FITS on a Mac ARM works for you?

@pwinckles
Copy link
Contributor

@pwinckles : Running FITS on a Mac ARM works for you?

Yes, that's correct

@kaylieackerman
Copy link

@pwinckles Are you running Ventura 13.4.1?

@kaylieackerman
Copy link

FWIW, media info itself runs fine on this machine. I redownloaded fits and I am getting a slightly different stack trace (below). I think I was 1 version back this morning. This machine is running a native java 11 install through brew.

openjdk 11.0.20 2023-07-18
OpenJDK Runtime Environment Homebrew (build 11.0.20+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.20+0, mixed mode)

$echo $JAVA_HOME
/opt/homebrew/Cellar/openjdk@11/11.0.20/libexec/openjdk.jdk/Contents/Home

Here is the stack trace

./fits.sh -x -i /Volumes/mediapres2/VIDEO/FY24/Divinity/Pearson_Batch_03/6/DEPOSIT_230405180848/32044160156444/archival/32044160156444_AM_01_01.mov -o /Volumes/mediapres2/VIDEO/FY24/Divinity/Pearson_Batch_03/6/DEPOSIT_230405180848/32044160156444/archival/32044160156444_AM_01_01_test.xml
2023-08-21 16:08:17 - ERROR - ToolBelt:140 - Thread 1 error initializing edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo: java.lang.InstantiationException Message: edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo
java.lang.InstantiationException: edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo
at java.base/java.lang.Class.newInstance(Class.java:571)
at edu.harvard.hul.ois.fits.tools.ToolBelt.createToolClassInstance(ToolBelt.java:174)
at edu.harvard.hul.ois.fits.tools.ToolBelt.init(ToolBelt.java:122)
at edu.harvard.hul.ois.fits.tools.ToolBelt.(ToolBelt.java:58)
at edu.harvard.hul.ois.fits.Fits.(Fits.java:243)
at edu.harvard.hul.ois.fits.Fits.(Fits.java:123)
at edu.harvard.hul.ois.fits.Fits.(Fits.java:112)
at edu.harvard.hul.ois.fits.Fits.constructFits(Fits.java:325)
at edu.harvard.hul.ois.fits.Fits.main(Fits.java:307)
Caused by: java.lang.NoSuchMethodException: edu.harvard.hul.ois.fits.tools.mediainfo.MediaInfo.()
at java.base/java.lang.Class.getConstructor0(Class.java:3349)
at java.base/java.lang.Class.newInstance(Class.java:556)
... 8 more

@kaylieackerman
Copy link

This might be the issue. Media info is only x86 and java is ARM.

'If the running JDK targets aarch64 (ARM), the architecture used by an M1 Mac, then an UnsatisfiedLinkError is thrown at startup. There is no native ARM build of TypeDB yet, so in order for TypeDB to run correctly on an M1 MacBook you need to ensure that a JDK that targets x64 architecture is installed.'

https://stackoverflow.com/questions/71237976/unsatisfiedlinkerror-when-running-typedb-on-an-m1-macbook

I could try installing an x86 java and see, though that seems like a stupid thing to have to do.

@pwinckles
Copy link
Contributor

@kaylieackerman I was able to run it on a M1 OS 13.1 (22C65) (so, different version than you), using java 17 (arm build) (I'll try with java 11 in a minute).

The development version of FITS has the latest release of MediaInfo in it, you could try build it, and seeing if that works for you.

mvn -DskipTests clean package

That should produce a zip file at target/fits-1.6.1-SNAPSHOT.zip that you could try.

@pwinckles
Copy link
Contributor

Yes, it worked for me with java 11 as well.

@pwinckles
Copy link
Contributor

If you don't feel like figuring out why it's not working on your system, you could just install mediainfo at the system level and delete tools/mediainfo in you FITS install

@kaylieackerman
Copy link

I wish it were so simple, but that also didn't work.

@kaylieackerman
Copy link

kaylieackerman commented Aug 21, 2023

Installing x86 java cleared the issue. Also tried a fresh ARM installation through brew which failed in the same way. So either it's a mixed architecture issue, which I think is most likely, or it's something specific with the java brew is installing.

Also, the lib in the media info Mac folder is from 2015, so no way that is ARM compatible. Perhaps that can be updated to the latest universal version?

@awoods
Copy link
Contributor Author

awoods commented Aug 21, 2023

It seems like we can document this as a known issue when run in a mixed architecture environment, then close this ticket. Does that sound right to you @kaylieackerman and @pwinckles ?

@pwinckles
Copy link
Contributor

@awoods @kaylieackerman : I don't understand what the problem is here. I use sdkman to manage/install java versions, so it's possible that there's something wrong with the brew version. I don't know haven't tried it. On my machine, it works with both an arm64 build and x86_64 build. Maybe it's related to the OS version? I don't know. I don't feel like upgrading right now to test it as that can be a can of worms.

My installs:

file $JAVA_HOME/bin/javac
/Users/peter.winckles/.sdkman/candidates/java/current/bin/javac: Mach-O 64-bit executable arm64

file $JAVA_HOME/bin/javac
/Users/peter.winckles/.sdkman/candidates/java/17.0.4-amzn-x86/bin/javac: Mach-O 64-bit executable x86_64

It's not possible to install x84_64 builds through sdkman. That version I installed manually.

@kaylieackerman
Copy link

kaylieackerman commented Aug 22, 2023 via email

@pwinckles
Copy link
Contributor

pwinckles commented Aug 22, 2023

@kaylieackerman the fits-latest link on that page is for version 1.4.0. This is the correct place to download 1.6.0: https://github.com/harvard-lts/fits/releases/tag/1.6.0

Versions prior to 1.6.0 I would not expect to work on the M1

@kaylieackerman
Copy link

kaylieackerman commented Aug 22, 2023 via email

@pwinckles
Copy link
Contributor

@kaylieackerman Yes, the version of MediaInfo in 1.4.0 is extremely old. 1.6.0 is using MediaInfo 22.09

@kaylieackerman
Copy link

kaylieackerman commented Aug 22, 2023 via email

@pwinckles
Copy link
Contributor

@kaylieackerman You need to either install Python or disable Jpylyzer in the fits.xml

@kaylieackerman
Copy link

kaylieackerman commented Aug 22, 2023 via email

@awoods
Copy link
Contributor Author

awoods commented Aug 23, 2023

@kaylieackerman : In case you want to take advantage of Jpylyzer in the future, here are instructions for having Python recognized by FITS:
bb2_4_mac_python_plus_security.docx

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

3 participants