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

Unable to load MediaInfo library #7

Open
ahvahsky2008 opened this issue Mar 9, 2018 · 9 comments
Open

Unable to load MediaInfo library #7

ahvahsky2008 opened this issue Mar 9, 2018 · 9 comments

Comments

@ahvahsky2008
Copy link

I add MediaInfo folder to PATH, but program rise error.

@dashkan
Copy link
Contributor

dashkan commented Mar 12, 2018

Assuming you are targeting .net standard / core.

Can you give more detail?
Are you running x86 or x64?
What's the exception?

@StefH StefH self-assigned this Mar 12, 2018
@StefH
Copy link
Owner

StefH commented Mar 12, 2018

When using this on Linux, I also doubt if this works.

I installed mediainfo using apt-get. And this gets installed in

/usr/bin/mediainfo

However when I clone this git project in Linux (bash on windows 10) and do a dotnet run: I get the same error.

@StefH StefH assigned ahvahsky2008 and unassigned StefH and ahvahsky2008 Mar 12, 2018
@dashkan
Copy link
Contributor

dashkan commented Mar 12, 2018

I must have broken something. I'll check it out on all platforms ASAP.

@dashkan
Copy link
Contributor

dashkan commented Mar 12, 2018

I did a fresh clone in win x64, MacOs 10.13 and Ubuntu 16.04 and all three environments work for me.

You do need to use the official MediaInfo release in linux distros. Please uninstall apt-get version of media info and do the following

# Download libzen
wget https://mediaarea.net/download/binary/libzen0/0.4.37/libzen0v5_0.4.37-1_amd64.Debian_9.0.deb
# Install libzen package
dpkg -i libzen0v5_0.4.37-1_amd64.Debian_9.0.deb
# Force install missing packages
apt-get upgrade -f 
# Download libmediainfo
wget https://mediaarea.net/download/binary/libmediainfo0/17.12/libmediainfo0v5_17.12-1_amd64.Debian_9.0.deb
# Install libmediainfo package
dpkg -i libmediainfo0v5_17.12-1_amd64.Debian_9.0.deb
# Force install missing packages
apt-get upgrade -f
# Create symbolic link for libmediainfo.so. For whatever reason the official package does not create it
ln -s /usr/lib/x86_64-linux-gnu/libmediainfo.so.0.0.0 /usr/lib/x86_64-linux-gnu/libmediainfo.so

git clone https://github.com/StefH/MediaInfo.DotNetWrapper.git
cd MediaInfo.DotNetWrapper/test/MediaInfo.DotNetWrapper.ConsoleTest.NetCore20/
dotnet run

@StefH
Copy link
Owner

StefH commented Mar 13, 2018

Running the first step gives me error:

stef@stef: /mediainfo/MediaInfo.DotNetWrapper/test/MediaInfo.DotNetWrapper.ConsoleTest.NetCore20$ sudo dpkg -i libzen0v5_0.4.37-1_amd64.Debian_9.0.deb
dpkg: considering removing libzen0:amd64 in favour of libzen0v5:amd64 ...
dpkg: yes, will remove libzen0:amd64 in favour of libzen0v5:amd64
(Reading database ... 29563 files and directories currently installed.)
Preparing to unpack libzen0v5_0.4.37-1_amd64.Debian_9.0.deb ...
Unpacking libzen0v5:amd64 (0.4.37-1) ...
dpkg: dependency problems prevent configuration of libzen0v5:amd64:
libzen0v5:amd64 depends on libstdc++6 (>= 5.2); however:
Version of libstdc++6:amd64 on system is 4.8.4-2ubuntu1~14.04.4.

dpkg: error processing package libzen0v5:amd64 (--install):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-0ubuntu6.14) ...
Errors were encountered while processing:
libzen0v5:amd64

@dashkan
Copy link
Contributor

dashkan commented Mar 13, 2018

You are trying to install ubuntu 16.04 version on ubuntu 14.04. The MediaInfo ubuntu site has the links for each version of ubuntu.

Here are instructions for 14.04

# So you dont have to run sudo command for the following
sudo -s
apt-get install -y git wget curl apt-transport-https libunwind8 liblttng-ust0 libcurl3 libssl1.0.0 libuuid1 libkrb5-3 zlib1g libicu52
# Start install dotnet sdk - only do the following if you dont have dotnet sdk installed
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
apt-get update
apt-get install -y dotnet-sdk-2.1.4
# End install dotnet sdk

# Download libzen & libmediainfo for ubuntu trusty 14.04
wget https://mediaarea.net/download/binary/libzen0/0.4.37/libzen0_0.4.37-1_amd64.xUbuntu_14.04.deb
wget https://mediaarea.net/download/binary/libmediainfo0/17.12/libmediainfo0_17.12-1_amd64.xUbuntu_14.04.deb
# Install packages
dpkg -i libzen0_0.4.37-1_amd64.xUbuntu_14.04.deb
dpkg -i libmediainfo0_17.12-1_amd64.xUbuntu_14.04.deb
# Fix pacakge dependencies
apt-get install -f 
# Create symbolic link
ln -s /usr/lib/x86_64-linux-gnu/libmediainfo.so.0.0.0 /usr/lib/x86_64-linux-gnu/libmediainfo.so
# Exit sudo
exit
# Clone and run mediainfo wrapper
git clone https://github.com/StefH/MediaInfo.DotNetWrapper.git
cd MediaInfo.DotNetWrapper/test/MediaInfo.DotNetWrapper.ConsoleTest.NetCore20/
dotnet run

@StefH
Copy link
Owner

StefH commented Mar 13, 2018

Still some error Unhandled Exception: System.Exception: Unable to load MediaInfo library.

(I did not install dotnet again.)

@dashkan
Copy link
Contributor

dashkan commented Mar 14, 2018

It was also successful using aptitude version of libmediainfo. Be happy to do some sort of screen sharing if this doesn't work.

Please try the following

# Uninstall official / downloaded versions
sudo apt remove --purge libmediainfo0v5 libzen0v5
sudo apt autoremove
sudo apt install libmediainfo-dev
# Clone and run mediainfo wrapper
git clone https://github.com/StefH/MediaInfo.DotNetWrapper.git
cd MediaInfo.DotNetWrapper/test/MediaInfo.DotNetWrapper.ConsoleTest.NetCore20/
dotnet run

@StefH
Copy link
Owner

StefH commented Mar 14, 2018

All works fine, except for E: Invalid operation autoremove.

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